-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwho.test.js
More file actions
34 lines (26 loc) · 944 Bytes
/
who.test.js
File metadata and controls
34 lines (26 loc) · 944 Bytes
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
var webdriver = require('selenium-webdriver');
chrome = require('selenium-webdriver/chrome');
jest.setTimeout(30000);
describe.each([
['chrome', 'WINDOWS'],
['chrome', 'ANDROID']
])('%s',
(browser, platform) => {
let driver;
beforeEach(async () => {
const options = new chrome.Options();
if (platform === 'ANDROID') {
options.setMobileEmulation({deviceName: 'iPhone X'});
}
driver = new webdriver.Builder().forBrowser(browser).setChromeOptions(options).build();
driver.get('http://who/');
});
afterEach(() => {
driver.quit();
});
test('button is present', async () => {
const query = await driver.wait(webdriver.until.elementsLocated(webdriver.By.css('#searchBox')));
expect(query).not.toBe(0);
});
}
)