forked from webdriverio/appium-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.webview.xpath.spec.ts
35 lines (31 loc) · 1.33 KB
/
app.webview.xpath.spec.ts
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
import TabBar from '../screenobjects/components/TabBar.js';
import WebViewScreen from '../screenobjects/WebviewScreen.js';
import { timeDifference } from '../helpers/Utils.js';
describe('WebdriverIO and Appium, when interacting with a webview through XPATH', () => {
let start:number;
beforeEach(async () => {
// @ts-expect-error command deprecated
await browser.reset();
await TabBar.waitForTabBarShown();
await TabBar.openWebView();
start = Date.now();
});
/**
* CHECK THE CONSOLE FOR THE TIME DIFFERENCE BETWEEN
* WAITING FOR THE WEBVIEW TO BE LOADED WITH XPATH
* AND WAITING FOR THE WEBVIEW TO BE LOADED IN A FASTER WAY
*
* THIS IS JUST ONE EXAMPLE IN THE DIFFERENCE BETWEEN USING
* XPATH OR A DIFFERENT LOCATOR STRATEGY
*/
it('should be able to verify that the WebView is shown by xpath', async () => {
await WebViewScreen.waitForWebViewIsDisplayedByXpath();
const end = Date.now();
timeDifference('Test time for using XPATH', start, end);
});
it('should be able to verify that the WebView is shown by switching to the WebView', async () => {
await WebViewScreen.waitForWebViewContextLoaded();
const end = Date.now();
timeDifference('Test time for switching to the WebView', start, end);
});
});