import {UseAngular} from '@serenity-js/protractor/lib/screenplay/interactions'
public class | source

UseAngular

Instructs the Actor to enable or disable automated synchronisation between Protractor and Angular.

Useful when a test scenario needs to interact with both Angular-based and non-Angular web apps (i.e. use an external sign on form).

More examples in Cross-application testing with Serenity/JS.

Please note if your tests interact with a non-Angular app you can disable synchronisation altogether in protractor.conf.js.

Extends:

Interaction → UseAngular

Examples:

Disabling synchronisation temporarily
 import { actorCalled } from '@serenity-js/core';
 import { BrowseTheWeb, UseAngular, Navigate } from '@serenity-js/protractor';
 import { protractor } from 'protractor';

 actorCalled('Angie')
     .whoCan(BrowseTheWeb.using(protractor.browser))
     .attemptsTo(
         UseAngular.disableSynchronisation(),
         Navigate.to('https://mycompany.com/login'),
         // navigate to a non-Angular app, perform some activities...

         UseAngular.disableSynchronisation(),
         Navigate.to('https://myapp.com'),
         // navigate to an Angular app, perform some more activities...
     );
Disabling synchronisation in protractor.conf.js
 exports.config = {
     onPrepare: function () {
         return browser.waitForAngularEnabled(false);
     },
     // ... other config
 };

Tests:

Static Method Summary

Static Public Methods
public static

Instructs the Actor to disable synchronisation between Protractor and Angular.

public static

Instructs the Actor to enable synchronisation between Protractor and Angular.

Static Public Methods

public static disableSynchronisation(): Interaction source

Instructs the Actor to disable synchronisation between Protractor and Angular.

Returns:

Interaction

public static enableSynchronisation(): Interaction source

Instructs the Actor to enable synchronisation between Protractor and Angular.

Returns:

Interaction