deno.land / x / oauth4webapi@v1.2.2 / tap / browserstack.mjs

browserstack.mjs
View Documentation
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
36
37
38
39
40
41
42
43
44
import browserstack from 'testcafe-browser-provider-browserstack'import { parseArgs } from 'node:util'
const { positionals: { 0: identifier },} = parseArgs({ allowPositionals: true })
await browserstack.init()
const browserlist = await browserstack.getBrowserList()
let resultswitch (identifier) { case 'browserstack:android': ;[result] = browserlist .filter((id) => id.startsWith('Google Pixel')) .sort((a, b) => { const va = parseFloat(a.split('@')[1]) const vb = parseFloat(b.split('@')[1])
return va < vb ? 1 : -1 }) break case 'browserstack:safari': ;[result] = browserlist.filter( (id) => !!new RegExp(`safari@\\\d+\\\.\\\d+:OS X Monterey`).exec(id), ) break case 'browserstack:ios': ;[result] = browserlist .filter((id) => id.startsWith('iPhone')) .sort((a, b) => { const va = parseFloat(a.split('@')[1]) const vb = parseFloat(b.split('@')[1])
return va < vb ? 1 : -1 }) break default: throw new TypeError('unsupported browser identifier')}
console.log(`browserstack:${result}`)
oauth4webapi

Version Info

Tagged at
2 years ago