Skip to content

Commit

Permalink
Fix test ambiguity when checking home page text
Browse files Browse the repository at this point in the history
  • Loading branch information
NoelLH committed Nov 3, 2018
1 parent a4195fc commit fb2cc94
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions e2e/src/app.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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', () => {
Expand All @@ -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
});
});
4 changes: 2 additions & 2 deletions e2e/src/app.po.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit fb2cc94

Please sign in to comment.