Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
feat(interactions): useAngular.disableSynchronisation() and UseAngula…
…r.enableSynchronisation() inter affects: serenity-js It's now easier to toggle Angular synchronisation during the actor flow, which enables switching between angular and non-angular apps as part of the same scenario.
- Loading branch information
Showing
4 changed files
with
26 additions
and
6 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
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
@@ -8,4 +8,5 @@ export * from './hit'; | ||
export * from './open'; | ||
export * from './resize_browser_window'; | ||
export * from './select'; | ||
export * from './use_angular'; | ||
export * from './wait'; |
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
@@ -0,0 +1,16 @@ | ||
import { Interaction, UsesAbilities } from '../../../serenity/screenplay'; | ||
import { BrowseTheWeb } from '../abilities/browse_the_web'; | ||
|
||
export class UseAngular { | ||
static disableSynchronisation = (): Interaction => new EnableAngularSynchronisation(false); | ||
static enableSynchronisation = (): Interaction => new EnableAngularSynchronisation(true); | ||
} | ||
|
||
class EnableAngularSynchronisation implements Interaction { | ||
performAs(actor: UsesAbilities): PromiseLike<any> { | ||
return BrowseTheWeb.as(actor).enableAngularSynchronisation(this.enable); | ||
} | ||
|
||
constructor(private enable: boolean) { | ||
} | ||
} |