forked from react-native-webview/react-native-webview
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Alert.test.js
26 lines (21 loc) · 836 Bytes
/
Alert.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
/**
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License.
*/
import { driver, By2 } from 'selenium-appium'
const setup = require('../jest-setups/jest.setup');
jest.setTimeout(150000);
const WindowsApplicationDriverUrl = "http://127.0.0.1:4723/wd/hub";
describe('Alert Tests', () => {
test('Show Alert', async () => {
await driver.startWithCapabilities(setup.capabilities, WindowsApplicationDriverUrl);
const showAlertButton = By2.nativeName('Show alert');
await showAlertButton.click();
await By2.nativeName('Hello! I am an alert box!');
const okButton = By2.nativeXpath('//Button[@Name="OK"]');
await okButton.click();
const dismissMessage = By2.nativeName('Alert dismissed!');
expect(dismissMessage).not.toBeNull();
await driver.quit();
});
});