diff --git a/generators/app/templates/e2e/_protractor.conf.js b/generators/app/templates/e2e/_protractor.conf.js index 664d912e..38211db0 100644 --- a/generators/app/templates/e2e/_protractor.conf.js +++ b/generators/app/templates/e2e/_protractor.conf.js @@ -4,6 +4,7 @@ const { SpecReporter } = require('jasmine-spec-reporter'); exports.config = { + SELENIUM_PROMISE_MANAGER: false, allScriptsTimeout: 11000, specs: [ './src/**/*.e2e-spec.ts' diff --git a/generators/app/templates/e2e/src/_app.e2e-spec.ts b/generators/app/templates/e2e/src/_app.e2e-spec.ts index 106ae647..984ba076 100644 --- a/generators/app/templates/e2e/src/_app.e2e-spec.ts +++ b/generators/app/templates/e2e/src/_app.e2e-spec.ts @@ -12,32 +12,32 @@ describe('when the app loads', () => { const app = new AppSharedPage(); const shell = new ShellPage(); - beforeAll(() => { - app.navigateAndSetLanguage(); + beforeAll(async () => { + await app.navigateAndSetLanguage(); }); <% if (props.auth) { -%> - it('should display the login page', () => { - expect(browser.getCurrentUrl()).toContain('/login'); + it('should display the login page', async () => { + expect(await browser.getCurrentUrl()).toContain('/login'); }); <% } else { -%> - it('should display the shell page', () => { - expect(browser.getCurrentUrl()).toContain('/'); + it('should display the shell page', async () => { + expect(await browser.getCurrentUrl()).toContain('/'); }); <% } -%> <% if (props.auth) { -%> describe('and the user logs in', () => { - beforeAll(() => { - login.login(); + beforeAll(async () => { + await login.login(); }); <% } else { -%> describe('and the page loads', () => { <% } -%> - it('should display the hello message', () => { - expect(shell.getParagraphText()).toEqual('Hello world !'); + it('should display the hello message', async () => { + expect(await shell.getParagraphText()).toEqual('Hello world !'); }); }); }); diff --git a/generators/app/templates/e2e/src/page-objects/__auth._login.po.ts b/generators/app/templates/e2e/src/page-objects/__auth._login.po.ts index e097b8e8..08064830 100644 --- a/generators/app/templates/e2e/src/page-objects/__auth._login.po.ts +++ b/generators/app/templates/e2e/src/page-objects/__auth._login.po.ts @@ -20,9 +20,9 @@ export class LoginPage { constructor() { } - login() { - this.usernameField.sendKeys('test'); - this.passwordField.sendKeys('123'); - this.loginButton.click(); + async login() { + await this.usernameField.sendKeys('test'); + await this.passwordField.sendKeys('123'); + await this.loginButton.click(); } } diff --git a/generators/app/templates/e2e/src/page-objects/_app-shared.po.ts b/generators/app/templates/e2e/src/page-objects/_app-shared.po.ts index 5cf756dc..ae9a1c08 100644 --- a/generators/app/templates/e2e/src/page-objects/_app-shared.po.ts +++ b/generators/app/templates/e2e/src/page-objects/_app-shared.po.ts @@ -9,13 +9,13 @@ export class AppSharedPage { constructor() { } - navigateAndSetLanguage() { + async navigateAndSetLanguage() { // Forces default language - this.navigateTo(); - browser.executeScript(() => localStorage.setItem('language', 'en-US')); + await this.navigateTo(); + await browser.executeScript(() => localStorage.setItem('language', 'en-US')); } - navigateTo() { - return browser.get('/'); + async navigateTo() { + await browser.get('/'); } } diff --git a/generators/app/templates/e2e/src/page-objects/_shell.po.ts b/generators/app/templates/e2e/src/page-objects/_shell.po.ts index 3d813d4e..02a4fadd 100644 --- a/generators/app/templates/e2e/src/page-objects/_shell.po.ts +++ b/generators/app/templates/e2e/src/page-objects/_shell.po.ts @@ -17,7 +17,7 @@ export class ShellPage { constructor() { } - getParagraphText() { - return this.welcomeText.getText(); + async getParagraphText() { + return await this.welcomeText.getText(); } }