diff options
author | Chocobozzz <me@florianbigard.com> | 2021-09-03 10:27:04 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-09-03 16:35:18 +0200 |
commit | 6d210220be0875d63461829d83c6e3a59d05cf7a (patch) | |
tree | 60ec5b596ef06295b70ebb553920a39b549e0f13 /client/e2e/src/utils.ts | |
parent | 2ede07153ce0282b116345dfee09bff902355a75 (diff) | |
download | PeerTube-6d210220be0875d63461829d83c6e3a59d05cf7a.tar.gz PeerTube-6d210220be0875d63461829d83c6e3a59d05cf7a.tar.zst PeerTube-6d210220be0875d63461829d83c6e3a59d05cf7a.zip |
Fix NSFW filter and add tests
Diffstat (limited to 'client/e2e/src/utils.ts')
-rw-r--r-- | client/e2e/src/utils.ts | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/client/e2e/src/utils.ts b/client/e2e/src/utils.ts deleted file mode 100644 index df1c29238..000000000 --- a/client/e2e/src/utils.ts +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | async function browserSleep (amount: number) { | ||
2 | await browser.pause(amount) | ||
3 | } | ||
4 | |||
5 | function isMobileDevice () { | ||
6 | const platformName = (browser.capabilities['platformName'] || '').toLowerCase() | ||
7 | |||
8 | return platformName === 'android' || platformName === 'ios' | ||
9 | } | ||
10 | |||
11 | function isSafari () { | ||
12 | return browser.capabilities['browserName'] && | ||
13 | browser.capabilities['browserName'].toLowerCase() === 'safari' | ||
14 | } | ||
15 | |||
16 | function isIOS () { | ||
17 | return isMobileDevice() && isSafari() | ||
18 | } | ||
19 | |||
20 | async function go (url: string) { | ||
21 | await browser.url(url) | ||
22 | |||
23 | // Hide notifications that could fail tests when hiding buttons | ||
24 | await browser.execute(() => { | ||
25 | const style = document.createElement('style') | ||
26 | style.innerHTML = 'p-toast { display: none }' | ||
27 | document.head.appendChild(style) | ||
28 | }) | ||
29 | } | ||
30 | |||
31 | export { | ||
32 | isMobileDevice, | ||
33 | isSafari, | ||
34 | isIOS, | ||
35 | go, | ||
36 | browserSleep | ||
37 | } | ||