Skip to content

Commit

Permalink
test: update E2E tests to support protractor with native promises
Browse files Browse the repository at this point in the history
  • Loading branch information
clydin committed Oct 2, 2020
1 parent 8087404 commit c5d2b4a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export default async function () {
page = new AppPage();
});
it('should display text from library component', () => {
page.navigateTo();
expect(element(by.css('lib-my-lib p')).getText()).toEqual('my-lib works!');
it('should display text from library component', async () => {
await page.navigateTo();
expect(await element(by.css('lib-my-lib p')).getText()).toEqual('my-lib works!');
});
afterEach(async () => {
Expand Down
18 changes: 9 additions & 9 deletions tests/legacy-cli/e2e/tests/i18n/legacy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export async function setupI18nConfig(useLocalize = true, format: keyof typeof f
import { browser, logging, element, by } from 'protractor';
describe('workspace-project App', () => {
const getParagraph = (name: string) => element(by.css('app-root p#' + name)).getText();
const getParagraph = async (name: string) => element(by.css('app-root p#' + name)).getText();
beforeEach(() => browser.get(browser.baseUrl));
afterEach(async () => {
// Assert that there are no errors emitted from the browser
Expand All @@ -135,17 +135,17 @@ export async function setupI18nConfig(useLocalize = true, format: keyof typeof f
} as logging.Entry));
});
it('should display welcome message', () =>
expect(getParagraph('hello')).toEqual('${translation.hello}'));
it('should display welcome message', async () =>
expect(await getParagraph('hello')).toEqual('${translation.hello}'));
it('should display locale', () =>
expect(getParagraph('locale')).toEqual('${lang}'));
it('should display locale', async () =>
expect(await getParagraph('locale')).toEqual('${lang}'));
it('should display localized date', () =>
expect(getParagraph('date')).toEqual('${translation.date}'));
it('should display localized date', async () =>
expect(await getParagraph('date')).toEqual('${translation.date}'));
it('should display pluralized message', () =>
expect(getParagraph('plural')).toEqual('${translation.plural}'));
it('should display pluralized message', async () =>
expect(await getParagraph('plural')).toEqual('${translation.plural}'));
});
`);
}
Expand Down

0 comments on commit c5d2b4a

Please sign in to comment.