Permalink
Browse files

fix(interactions): `See` is no longer reported by default, as that po…

…lluted the report and triggered unnecessary screenshots.

To report an assertions being performed, wrap `See` into a @step-annotated task.
Also, the static method changed from `See.that` to `See.if` as it reads better and is more grammatically correct.
  • Loading branch information...
jan-molak committed Feb 10, 2017
1 parent 5a72b8c commit 3b7efb8151faf8ed70a2237e226f1d6b6ed355be
Showing with 3 additions and 7 deletions.
  1. +2 −2 spec/api/screenplay/tasks/see.spec.ts
  2. +1 −5 src/serenity/screenplay/tasks/see.ts
@@ -18,7 +18,7 @@ describe('Tasks', () => {
let actor = Actor.named('James');
let promise = See.
that(new SomeResult(), r => expect(r).to.eventually.equal('some value')).
if(new SomeResult(), r => expect(r).to.eventually.equal('some value')).
performAs(actor);
return expect(promise).to.be.eventually.fulfilled;
@@ -28,7 +28,7 @@ describe('Tasks', () => {
let actor = Actor.named('James');
let promise = See.
that(new SomeResult(), r => expect(r).to.eventually.equal('other value')).
if(new SomeResult(), r => expect(r).to.eventually.equal('other value')).
performAs(actor);
return expect(promise).to.be.eventually.rejectedWith(AssertionError, 'expected \'some value\' to equal \'other value\'');
@@ -1,13 +1,9 @@
import { AnswersQuestions, Performable, Question } from '..';
import { step } from '../../recording/step_annotation';
import { Assertion } from '../expectations';
export class See<S> implements Performable {
static that<T>(question: Question<T>, assertion: Assertion<T>) {
return new See<T>(question, assertion);
}
static if = <T>(question: Question<T>, assertion: Assertion<T>) => new See<T>(question, assertion);
@step('{0} looks at #question')
performAs(actor: AnswersQuestions): PromiseLike<void> {
return this.assert(actor.toSee(this.question));
}

0 comments on commit 3b7efb8

Please sign in to comment.