forked from react-native-webview/react-native-webview
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAlert.test.js
More file actions
31 lines (24 loc) · 891 Bytes
/
Alert.test.js
File metadata and controls
31 lines (24 loc) · 891 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
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { driver, By2 } from 'selenium-appium'
import { until } from 'selenium-webdriver';
const setup = require('../jest-setups/jest.setup');
jest.setTimeout(50000);
beforeAll(() => {
return driver.startWithCapabilities(setup.capabilites);
});
afterAll(() => {
return driver.quit();
});
describe('Alert Tests', () => {
test('Show Alert', async () => {
const showAlertButton = await driver.wait(until.elementLocated(By2.nativeName('Show alert')));
await showAlertButton.click();
await driver.wait(until.elementLocated(By2.nativeName('Hello! I am an alert box!')));
await By2.nativeName('OK').click();
const dismissMessage = await driver.wait(until.elementLocated(By2.nativeName('Alert dismissed!')));
expect(dismissMessage).not.toBeNull();
});
});