mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-24 06:45:24 +02:00
add groups feature
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
/**
|
||||
* Copyright © 2019 contains code contributed by Orange SA, authors: Denis Barbaron - Licensed under the Apache license 2.0
|
||||
**/
|
||||
|
||||
var util = require('util')
|
||||
|
||||
var uuid = require('uuid')
|
||||
@@ -7,10 +11,8 @@ var dbapi = require('../db/api')
|
||||
var devices = require('stf-device-db/dist/devices-latest')
|
||||
|
||||
module.exports.generate = function(wantedModel) {
|
||||
var serial = util.format(
|
||||
'fake-%s'
|
||||
, uuid.v4(null, new Buffer(16)).toString('base64')
|
||||
)
|
||||
// no base64 because some characters as '=' or '/' are not compatible through API (delete devices)
|
||||
const serial = 'fake-' + util.format('%s', uuid.v4()).replace(/-/g, '')
|
||||
|
||||
return dbapi.saveDeviceInitialState(serial, {
|
||||
provider: {
|
||||
@@ -28,7 +30,7 @@ module.exports.generate = function(wantedModel) {
|
||||
, model: model
|
||||
, version: '4.1.2'
|
||||
, abi: 'armeabi-v7a'
|
||||
, sdk: 8 + Math.floor(Math.random() * 12)
|
||||
, sdk: (8 + Math.floor(Math.random() * 12)).toString() // string required!
|
||||
, display: {
|
||||
density: 3
|
||||
, fps: 60
|
||||
@@ -49,6 +51,8 @@ module.exports.generate = function(wantedModel) {
|
||||
, phoneNumber: '0000000000'
|
||||
}
|
||||
, product: model
|
||||
, cpuPlatform: 'msm8996'
|
||||
, openGLESVersion: '3.1'
|
||||
})
|
||||
})
|
||||
.then(function() {
|
||||
|
||||
Reference in New Issue
Block a user