-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathexampleFailingTests.spec.js
36 lines (27 loc) · 1.3 KB
/
exampleFailingTests.spec.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
var scenarioo = require('../../lib');
/**
* Just an example with a failing test to also check that in the scenarioo documentation you can see when a scenario is failing.
*/
describe('Example Use Case failing', function exampleFailingUseCase() {
beforeAll(function () {
// setting useCase context properties must be done in a beforeAll block because of the way jasmine
// executes the tests.
scenarioo.getUseCaseContext().setDescription('An optional description for a failing use case');
});
/**
* This is needed in any case (!!) to ensure that the last step (whatever is configured to be saved as last step)
* is properly written before the spec execution ends.
*/
afterEach(scenarioo.saveLastStep);
it('Example Scenario failing', function exampleFailingScenario() {
scenarioo.getScenarioContext().setDescription('An optional description for a failing scenario');
scenarioo.getScenarioContext().addLabels('error'); // you can add a single label
scenarioo.getScenarioContext().addLabels(['red', 'blue']); // you can add multiple labels
browser.get('/index.html');
scenarioo.saveStep('start', {
labels: ['example-step-label-1', 'example-step-label-2']
});
element(by.css('li#item_is_not_present')).click();
scenarioo.saveStep('one is displayed');
});
});