forked from webdriverio/appium-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.webview.xpath.spec.js
33 lines (30 loc) · 1.06 KB
/
app.webview.xpath.spec.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
import TabBar from '../screenobjects/components/tab.bar';
import WebViewScreen from '../screenobjects/webview.screen';
import { timeDifference } from '../helpers/utils';
describe('WebdriverIO and Appium', () => {
let start;
beforeEach(() => {
browser.reset();
TabBar.waitForTabBarShown(true);
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 go to the webview by xpath', () => {
WebViewScreen.waitForWebViewIsDisplayedByXpath();
const end = Date.now();
timeDifference(start, end);
});
it('should be able to go to the webview faster', () => {
WebViewScreen.waitForWebViewContextLoaded();
const end = Date.now();
timeDifference(start, end);
});
});