Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('indicates the operating system where the test was executed', () => {
given(reporter).isNotifiedOfFollowingEvents(
new SceneTagged(defaultCardScenario, new ContextTag('iphone')),
new SceneFinished(defaultCardScenario, new ExecutionSuccessful()),
new TestRunFinished(),
);
report = stageManager.notifyOf.firstCall.lastArg.artifact.map(_ => _);
expect(report.context).to.equal('iphone');
expect(report.tags).to.deep.include.members([{
name: 'iphone',
type: 'context',
}]);
});
it('ensures that the user-specified context takes precedence over browser context', () => {
given(reporter).isNotifiedOfFollowingEvents(
new SceneTagged(defaultCardScenario, new BrowserTag('safari')),
new SceneTagged(defaultCardScenario, new ContextTag('iphone')),
new SceneFinished(defaultCardScenario, new ExecutionSuccessful()),
new TestRunFinished(),
);
report = stageManager.notifyOf.firstCall.lastArg.artifact.map(_ => _);
expect(report.context).to.equal('iphone');
expect(report.tags).to.deep.include.members([{
name: 'safari',
type: 'browser',
}, {
name: 'iphone',
type: 'context',
}]);
it('belongs to a theme', () => {
given(reporter).isNotifiedOfFollowingEvents(
new SceneTagged(defaultCardScenario, new ThemeTag('Digital')),
new SceneTagged(defaultCardScenario, new CapabilityTag('E-Commerce')),
new SceneTagged(defaultCardScenario, new FeatureTag('Checkout')),
new SceneFinished(defaultCardScenario, new ExecutionSuccessful()),
new TestRunFinished(),
);
report = stageManager.notifyOf.firstCall.lastArg.artifact.map(_ => _);
expect(report.tags).to.deep.include.members([{
name: 'Digital',
type: 'theme',
}, {
name: 'Digital/E-Commerce',
type: 'capability',
}, {
name: 'Digital/E-Commerce/Checkout',
type: 'feature',
}]);
it('belongs to a capability', () => {
given(reporter).isNotifiedOfFollowingEvents(
new SceneTagged(defaultCardScenario, new CapabilityTag('E-Commerce')),
new SceneTagged(defaultCardScenario, new FeatureTag('Checkout')),
new SceneFinished(defaultCardScenario, new ExecutionSuccessful()),
new TestRunFinished(),
);
report = stageManager.notifyOf.firstCall.lastArg.artifact.map(_ => _);
expect(report.tags).to.deep.include.members([{
name: 'E-Commerce',
type: 'capability',
}, {
name: 'E-Commerce/Checkout',
type: 'feature',
}]);
expect(report.featureTag).to.deep.equal({
it('belongs to a theme', () => {
given(reporter).isNotifiedOfFollowingEvents(
new SceneTagged(defaultCardScenario, new ThemeTag('Digital')),
new SceneTagged(defaultCardScenario, new CapabilityTag('E-Commerce')),
new SceneTagged(defaultCardScenario, new FeatureTag('Checkout')),
new SceneFinished(defaultCardScenario, new ExecutionSuccessful()),
new TestRunFinished(),
);
report = stageManager.notifyOf.firstCall.lastArg.artifact.map(_ => _);
expect(report.tags).to.deep.include.members([{
name: 'Digital',
type: 'theme',
}, {
name: 'Digital/E-Commerce',
type: 'capability',
}, {
name: 'Digital/E-Commerce/Checkout',
type: 'feature',
it('can be tagged with an issue number', () => {
given(reporter).isNotifiedOfFollowingEvents(
new SceneTagged(defaultCardScenario, new IssueTag('ABC-1234')),
new SceneTagged(defaultCardScenario, new IssueTag('DEF-5678')),
new SceneFinished(defaultCardScenario, new ExecutionSuccessful()),
new TestRunFinished(),
);
report = stageManager.notifyOf.firstCall.lastArg.artifact.map(_ => _);
expect(report.tags).to.deep.include.members([{
name: 'ABC-1234',
type: 'issue',
}, {
name: 'DEF-5678',
type: 'issue',
}]);
expect(report.issues).to.deep.equal([
'ABC-1234',
it('can be optionally tagged map manual', () => {
given(reporter).isNotifiedOfFollowingEvents(
new SceneTagged(defaultCardScenario, new ManualTag()),
new SceneFinished(defaultCardScenario, new ExecutionSuccessful()),
new TestRunFinished(),
);
report = stageManager.notifyOf.firstCall.lastArg.artifact.map(_ => _);
expect(report.manual).to.equal(true);
expect(report.tags).to.deep.include.members([{
name: 'Manual',
type: 'External Tests',
}]);
});
});
it('can be tagged with an arbitrary tag', () => {
given(reporter).isNotifiedOfFollowingEvents(
new SceneTagged(defaultCardScenario, new ArbitraryTag('regression')),
new SceneFinished(defaultCardScenario, new ExecutionSuccessful()),
new TestRunFinished(),
);
report = stageManager.notifyOf.firstCall.lastArg.artifact.map(_ => _);
expect(report.tags).to.deep.include.members([{
name: 'regression',
type: 'tag',
}]);
});
});
it('ensures that the user-specified context takes precedence over browser context', () => {
given(reporter).isNotifiedOfFollowingEvents(
new SceneTagged(defaultCardScenario, new BrowserTag('safari')),
new SceneTagged(defaultCardScenario, new ContextTag('iphone')),
new SceneFinished(defaultCardScenario, new ExecutionSuccessful()),
new TestRunFinished(),
);
report = stageManager.notifyOf.firstCall.lastArg.artifact.map(_ => _);
expect(report.context).to.equal('iphone');
expect(report.tags).to.deep.include.members([{
name: 'safari',
type: 'browser',
}, {
name: 'iphone',
type: 'context',
}]);
});
...this.scenarioHierarchyTagsFor(feature).map(tag => new SceneTagged(details, tag)),
!! scenario.description && new SceneDescriptionDetected(scenario.description),