forked from nightwatchjs/nightwatch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added more tests for describe interface
- Loading branch information
1 parent
47e4dd1
commit 51a34ed
Showing
5 changed files
with
138 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
describe('basic describe test', function () { | ||
|
||
this.desiredCapabilities = { | ||
name: 'basicDescribe' | ||
}; | ||
|
||
this.timeout(55); | ||
this.tags = ['something']; | ||
this.endSessionOnFail = false; | ||
this.skipTestcasesOnFail = false; | ||
|
||
test('demoTest one', function (client) { | ||
client.url('http://localhost') | ||
.assert.elementPresent('#weblogin'); | ||
}); | ||
|
||
test.only('demoTest two', function (client) { | ||
client.assert.strictEqual(client.options.globals.waitForConditionTimeout, 55); | ||
client.assert.strictEqual(this.settings.desiredCapabilities.name, 'basicDescribe'); | ||
|
||
client.url('http://localhost') | ||
.assert.elementPresent('#weblogin'); | ||
}); | ||
|
||
test('demoTest three', function (client) { | ||
client.url('http://localhost') | ||
.assert.elementPresent('#weblogin'); | ||
}); | ||
}); | ||
|
37 changes: 37 additions & 0 deletions
37
test/sampletests/withdescribe/failures/sampleSkipTestcases.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
describe('sample test with skipTestcasesOnFail', function() { | ||
this.skipTestcasesOnFail = false; | ||
this.endSessionOnFail = false; | ||
this.timeout(10); | ||
|
||
let endFn; | ||
|
||
before(function(client, done) { | ||
endFn = client.end; | ||
done(); | ||
}); | ||
|
||
it('demoTest', function (client) { | ||
client.globals.calls++; | ||
|
||
client.url('http://localhost') | ||
.assert.elementPresent('#weblogin') | ||
.assert.elementPresent('#badElement'); | ||
}); | ||
|
||
it('demoTest2', function (client) { | ||
client.globals.calls++; | ||
|
||
client.end = function() { | ||
client.assert.fail('End should not be called.') | ||
}; | ||
|
||
client.url('http://localhost') | ||
.assert.elementPresent('#weblogin') | ||
.assert.elementPresent('#badElement'); | ||
}); | ||
|
||
after(function(client, done) { | ||
client.end = endFn; | ||
done(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters