-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenvironment.js
43 lines (37 loc) · 1.16 KB
/
environment.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
const wd = require('wd');
const { Before, After, setWorldConstructor } = require('@cucumber/cucumber');
const CustomWorld = require("../support/customWorld.js")
const PORT = 4723;
setWorldConstructor(CustomWorld);
const config = [{
name: 'personal',
platformName: 'Android',
deviceName: '89MX0BQPQ',
udid: '89MX0BQPQ',
address: 'https://www.miro.com',
browserName: 'Chrome',
automationName: 'UIAutomator2'
}, {
name: 'simulator-android',
platformName: 'Android',
deviceName: 'Pixel5',
udid: 'emulator-5554',
address: 'https://www.miro.com',
browserName: 'Chrome',
automationName: 'UIAutomator2'
}
];
const driver = wd.promiseChainRemote('0.0.0.0', PORT);
CustomWorld.driver = driver;
Before({timeout: 100000}, async () => {
device_capabilities = await config.find(device => device.name === process.env.DEVICE_NAME);
delete device_capabilities.name;
await CustomWorld.driver.init(device_capabilities);
await CustomWorld.driver.sleep(6000);
});
After(async() => {
await CustomWorld.driver.quit();
});
module.exports = {
CustomWorld
};