aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/utils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/e2e/src/utils.ts')
-rw-r--r--client/e2e/src/utils.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/client/e2e/src/utils.ts b/client/e2e/src/utils.ts
new file mode 100644
index 000000000..e19da6402
--- /dev/null
+++ b/client/e2e/src/utils.ts
@@ -0,0 +1,30 @@
1import { browser } from 'protractor'
2
3async function browserSleep (amount: number) {
4 if (await isIOS()) browser.ignoreSynchronization = false
5
6 await browser.sleep(amount)
7
8 if (await isIOS()) browser.ignoreSynchronization = true
9}
10
11async function isMobileDevice () {
12 const caps = await browser.getCapabilities()
13 return caps.get('realMobile') === 'true' || caps.get('realMobile') === true
14}
15
16async function isSafari () {
17 const caps = await browser.getCapabilities()
18 return caps.get('browserName') && caps.get('browserName').toLowerCase() === 'safari'
19}
20
21async function isIOS () {
22 return await isMobileDevice() && await isSafari()
23}
24
25export {
26 isMobileDevice,
27 isSafari,
28 isIOS,
29 browserSleep
30}