-
Notifications
You must be signed in to change notification settings - Fork 0
/
msvacation.test.js
41 lines (32 loc) · 1.46 KB
/
msvacation.test.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
'use strict'
var webdriver = require('selenium-webdriver');
var chrome = require('selenium-webdriver/chrome');
describe.each([
['chrome', 'WINDOWS'],
['chrome', 'ANDROID']
])('%s: %s',
(browser, platform) => {
let driver;
beforeEach(async () => {
jest.setTimeout(30000);
const options = new chrome.Options();
if (platform === 'ANDROID') {
options.setMobileEmulation({deviceName: 'iPhone X'});
}
driver = new webdriver.Builder().forBrowser(browser)
.setChromeOptions(options).build();
await driver.get('http://msvacation/');
});
afterEach(() => {
driver.quit();
});
test('button is present', async () => {
driver.switchTo().frame('MsVacationLeft');
await driver.wait(webdriver.until.elementLocated(webdriver.By.css('#PendingApprovalsSection1_rdPending_Content_Toggle')), 1000);
// const drop = await driver.findElement(webdriver.By.id('PendingApprovalsSection1_rdPending_Content_Toggle'));
await driver.findElement(webdriver.By.css('#PendingApprovalsSection1_rdPending_Content_Toggle')).click();
const query = await driver.wait(webdriver.until.elementsLocated(webdriver.By.css('#PendingApprovalsSection1_lblPendingVacation')), 1000);
expect(query).not.toBe(0);
});
}
)