-
Notifications
You must be signed in to change notification settings - Fork 0
/
a.test.js
executable file
·39 lines (33 loc) · 866 Bytes
/
a.test.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
34
35
36
37
38
39
":" //; exec /usr/bin/env node --harmony --expose-gc --trace-deprecation "$0" "$@"
const { expect } = require('chai')
const { asyncPostData, asyncGetData } = require('./apitests/utils')
const options = {
hostname: 'localhost',
port: 4444,
path: '/wd/hub/session',
method: 'POST',
headers: {
'Content-Type': 'application/json'
}
}
let postData = JSON.stringify({
desiredCapabilities:
{
browserName: 'chrome',
javascriptEnabled: true,
acceptSslCerts: true,
platform: 'ANY'
}
})
const test = async () => {
const { sessionId } = await asyncPostData(postData, options)
console.log('!!!!!!!!')
options.path = `/wd/hub/session/${sessionId}/url`
postData = JSON.stringify({
url: 'https://weblium.co'
})
console.log('!!!!!!!!!!!!!!')
const data = await asyncPostData(postData, options)
console.log(data)
}
test()