-
Notifications
You must be signed in to change notification settings - Fork 0
/
test-google-search.js
42 lines (32 loc) · 1.06 KB
/
test-google-search.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
// run with nyancat: node_modules/mocha/bin/mocha -R nyan test-google-search.js
// run without nyancat: node_modules/mocha/bin/mocha test-google-search.js
var assert = require('assert');
var test = require('selenium-webdriver/testing');
test.describe('Google Search Page', function() {
this.timeout(10000);
var drivers = null;
var navigation = require('./navigation');
var googleSearchPage = require('./page_objects/googleSearchPage');
test.before(function() {
// this also initializes the browser
drivers = require('./page_driver');
});
test.beforeEach(function () {
navigation.goTo('http://www.google.com');
});
test.it('Page Title is Google', function () {
// ensure navigation
drivers.browser.getTitle().then(function (value) {
assert.equal(value, 'Google');
});
});
test.it('User can enter a search term', function() {
var searchBox = googleSearchPage.search('SURGE Forward');
googleSearchPage.getSearchValue(function (value) {
assert.equal(value, 'SURGE Forward');
});
});
test.after(function () {
drivers.browser.quit();
});
});