-
Notifications
You must be signed in to change notification settings - Fork 3
/
section_6_notes.txt
59 lines (49 loc) · 2.15 KB
/
section_6_notes.txt
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
Section 6 - WDIO sync mode
1. Go into wdio.conf.js and change the value of sync from false to true. This will turn on sync mode.
2. Turning on sync mode allows synchronous calls. Instead of returning a browser object. You can just
add browser to every call function, i.e.(located in the tests directory/WebDriverIOUniverity.js):
******************** Old code ********************
describe("Verify webdriveruniveristy links on homepage work correctly", function(){
it("check that the Contact us button opens the Contact Us page", function(done){
return browser
.setViewportSize({
width: 1200,
height: 800
})
.url('http://www.webdriveruniversity.com/')
.getTitle().then(function(title) {
console.log('Title is: ' + title);
})
.click('#contact-us')
.pause(3000)
});
it("check that the Login button opens the Login Portal page", function(){
return browser
.url('http://www.webdriveruniversity.com/')
.click('#login-portal')
.getTitle().then(function(title){
console.log('Title is: '+title);
})
});
});
******************** New code ********************
describe("Verify webdriveruniveristy links on homepage work correctly", function(){
it("check that the Contact us button opens the Contact Us page", function(done){
browser.setViewportSize({
width: 1200,
height: 800
})
browser.url('http://www.webdriveruniversity.com/')
var title = browser.getTitle()
console.log('Title is: ' + title);
browser.click('#contact-us')
browser.pause(3000)
});
it("check that the Login button opens the Login Portal page", function(){
browser.url('http://www.webdriveruniversity.com/')
browser.click('#login-portal')
var title = browser.getTitle()
console.log('Title is: '+ title);
});
});
3. Go to your wdio.conf.js file and uncomment services=[], and change it to: services: ['selenium-standalone']