Permalink
Browse files

fix(reporting): Every interaction shows up in the report

  • Loading branch information...
jan-molak committed Sep 11, 2016
1 parent 706bbb4 commit 961cdf197928c58930c7a27b91833a675672d6b6
@@ -1,3 +1,4 @@
import { step } from '../../../serenity/recording/step_annotation';
import { Interaction, PerformsTasks, UsesAbilities } from '../../../serenity/screenplay';
import { BrowseTheWeb } from '../abilities/browse_the_web';
import { Target } from '../ui/target';
@@ -8,6 +9,7 @@ export class Click implements Interaction {
return new Click(target);
}
@step('{0} clicks on #target')
performAs(actor: PerformsTasks & UsesAbilities): PromiseLike<void> {
return BrowseTheWeb.as(actor).locate(this.target).click();
}
@@ -1,3 +1,4 @@
import { step } from '../../../serenity/recording/step_annotation';
import { Interaction, PerformsTasks, UsesAbilities } from '../../../serenity/screenplay';
import { BrowseTheWeb } from '../abilities/browse_the_web';
import { Target } from '../ui/target';
@@ -35,6 +36,8 @@ export class Enter implements Interaction {
}
class EnterValue implements Interaction {
@step('{0} enters "#value" into #target')
performAs(actor: PerformsTasks & UsesAbilities): PromiseLike<void> {
return BrowseTheWeb.as(actor).locate(this.target).sendKeys(this.value);
}
@@ -1,3 +1,4 @@
import { step } from '../../../serenity/recording/step_annotation';
import { Interaction, PerformsTasks, UsesAbilities } from '../../../serenity/screenplay';
import { keyNameOf } from '../../keys';
import { BrowseTheWeb } from '../abilities';
@@ -17,6 +18,7 @@ export class Hit {
class HitKeyIntoTarget implements Interaction {
@step('Hits the #keyname key')
performAs(actor: PerformsTasks & UsesAbilities): PromiseLike<void> {
return BrowseTheWeb.as(actor).locate(this.target).sendKeys(this.key);
}
@@ -1,3 +1,4 @@
import { step } from '../../../serenity/recording/step_annotation';
import { Interaction, PerformsTasks, UsesAbilities } from '../../../serenity/screenplay';
import { BrowseTheWeb } from '../abilities/browse_the_web';
@@ -7,6 +8,7 @@ export class Open implements Interaction {
return new Open(website);
}
@step('{0} opens the browser at "#targetWebsite"')
performAs(actor: PerformsTasks & UsesAbilities): PromiseLike<void> {
return BrowseTheWeb.as(actor).get(this.targetWebsite);
}
@@ -1,3 +1,4 @@
import { step } from '../../../serenity/recording/step_annotation';
import { Interaction, PerformsTasks, UsesAbilities } from '../../../serenity/screenplay';
import { BrowseTheWeb } from '../abilities/browse_the_web';
@@ -12,6 +13,7 @@ export class ResizeBrowserWindow {
}
class MaximiseBrowserWindow implements Interaction {
@step('{0} maximises the browser window')
performAs(actor: PerformsTasks & UsesAbilities): PromiseLike<void> {
return BrowseTheWeb.as(actor).manage().window().maximize();
}
@@ -21,6 +23,7 @@ class SetBrowserWindowSize implements Interaction {
constructor(private width: number, private height: number) {
}
@step('{0} sets the size of the browser window to #width x #height')
performAs(actor: PerformsTasks & UsesAbilities): PromiseLike<void> {
return BrowseTheWeb.as(actor).manage().window().setSize(this.width, this.height);
}

0 comments on commit 961cdf1

Please sign in to comment.