-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
43 lines (39 loc) · 1017 Bytes
/
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
40
41
42
43
var webdriverio = require('webdriverio');
var options = {
desiredCapabilities: {
browserName: 'firefox'
}
};
webdriverio
.remote(options)
.init()
.url('http://www.google.com')
.title(function(err, res) {
console.log('Title was: ' + res.value);
})
.end();
var assert = require('assert');
var webdriverio = require('../../index'),
client = webdriverio.remote({
desiredCapabilities: {
browserName: 'chrome',
version: '27',
platform: 'XP',
tags: ['examples'],
name: 'This is an example test'
},
host: 'ondemand.saucelabs.com',
port: 80,
user: process.env.SAUCE_USERNAME,
key: process.env.SAUCE_ACCESS_KEY,
logLevel: 'silent'
}).init();
client
.url('http://google.com')
.setValue('*[name="q"]','webdriverio')
.click('*[name="btnG"]')
.pause(1000)
.getTitle(function(err,title) {
console.log(title);
})
.end();