From fb2cc9428f5c6b9dcf1052cb3fa0b3e5f0f6d382 Mon Sep 17 00:00:00 2001 From: Noel Light-Hilary Date: Sat, 3 Nov 2018 20:53:52 +0000 Subject: [PATCH] Fix test ambiguity when checking home page text --- e2e/src/app.e2e-spec.ts | 6 +++--- e2e/src/app.po.ts | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/e2e/src/app.e2e-spec.ts b/e2e/src/app.e2e-spec.ts index 335725a..a623f56 100644 --- a/e2e/src/app.e2e-spec.ts +++ b/e2e/src/app.e2e-spec.ts @@ -10,7 +10,7 @@ describe('new App', () => { }); it('should display the master password field label', () => { - expect(page.getParagraphText()).toContain('Master password'); + expect(page.getHomeText()).toContain('Master password'); }); it('should generate the right password for the default settings', () => { @@ -64,7 +64,7 @@ describe('new App', () => { // Check for correct output for "my.example.com" with letters charset, 25 length, SHA1. expect(page.getOutputPassword()).toEqual('PSZKuWvFAtVWNoIqfBsAHnEOr'); - expect(page.getParagraphText()).toContain(`If you didn't change this on purpose`); // non-domain_only warning + expect(page.getHomeText()).toContain(`If you didn't change this on purpose`); // non-domain_only warning }); it('should update output password with new settings automatically', () => { @@ -81,6 +81,6 @@ describe('new App', () => { page.navigateToTab('home'); // Check for correct output for "example.com" with alphanumeric charset, 30 length, HMAC-SHA256. expect(page.getOutputPassword()).toEqual('rJeGcpSWpH36PMn706JrNR9vNzr9Wj'); - expect(page.getParagraphText()).not.toContain(`If you didn't change this on purpose`); // no non-domain_only warning + expect(page.getHomeText()).not.toContain(`If you didn't change this on purpose`); // no non-domain_only warning }); }); diff --git a/e2e/src/app.po.ts b/e2e/src/app.po.ts index 7e146d6..e5ba0a3 100644 --- a/e2e/src/app.po.ts +++ b/e2e/src/app.po.ts @@ -21,9 +21,9 @@ export class AppPage { browser.pause(500); // Travis builds had intermittent trouble on next step without a fixed pause } - public getParagraphText() { + public getHomeText() { browser.waitForAngular(); - return element(by.deepCss('app-root ion-content')).getText(); + return element(by.css('app-home')).getText(); } public populateIonicInput(elementName: string, value: (string|number)) {