aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/e2e/src/utils.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-05-12 16:38:55 +0200
committerChocobozzz <me@florianbigard.com>2020-05-12 16:49:35 +0200
commitee68bbc481c154111c60fe80d57565d35bfac46e (patch)
tree64de79b49228feb35af486e2cf755bc7839fe148 /client/e2e/src/utils.ts
parent853c3d533d287d762053e0fa6ecf6bfc3feb0051 (diff)
downloadPeerTube-ee68bbc481c154111c60fe80d57565d35bfac46e.tar.gz
PeerTube-ee68bbc481c154111c60fe80d57565d35bfac46e.tar.zst
PeerTube-ee68bbc481c154111c60fe80d57565d35bfac46e.zip
Unblock ios e2e tests
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}