-
Notifications
You must be signed in to change notification settings - Fork 402
/
Copy pathbasic-specs.js
52 lines (40 loc) · 1.19 KB
/
basic-specs.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
44
45
46
47
48
49
50
/* global sauceJobTitle, mergeDesired */
require('../helpers/setup');
describe('basic ' + env.ENV_DESC, function() {
this.timeout(env.TIMEOUT);
var browser;
var allPassed = true;
before(function() {
browser = wd.promiseChainRemote(env.REMOTE_CONFIG);
var sauceExtra = {
name: sauceJobTitle(this.runnable().parent.title),
tags: ['e2e']
};
return browser
.configureLogging()
.init(mergeDesired(env.DESIRED, env.SAUCE? sauceExtra : null ));
});
beforeEach(function() {
return browser.get('http://admc.io/wd/test-pages/guinea-pig.html');
});
afterEach(function() {
allPassed = allPassed && (this.currentTest.state === 'passed');
});
after(function() {
return browser
.quit().then(function() {
if(env.SAUCE) { return(browser.sauceJobStatus(allPassed)); }
});
});
it("should retrieve the page title", function() {
return browser
.title().should.eventually.include("WD");
});
it("submit element should be clicked", function() {
/* jshint evil: true */
return browser
.elementById("submit")
.click()
.eval("window.location.href").should.eventually.include("http://");
});
});