Skip to content

Commit c5d2b4a

Browse files
committed
test: update E2E tests to support protractor with native promises
1 parent 8087404 commit c5d2b4a

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

tests/legacy-cli/e2e/tests/generate/library/library-consumption.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ export default async function () {
5252
page = new AppPage();
5353
});
5454
55-
it('should display text from library component', () => {
56-
page.navigateTo();
57-
expect(element(by.css('lib-my-lib p')).getText()).toEqual('my-lib works!');
55+
it('should display text from library component', async () => {
56+
await page.navigateTo();
57+
expect(await element(by.css('lib-my-lib p')).getText()).toEqual('my-lib works!');
5858
});
5959
6060
afterEach(async () => {

tests/legacy-cli/e2e/tests/i18n/legacy.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export async function setupI18nConfig(useLocalize = true, format: keyof typeof f
125125
import { browser, logging, element, by } from 'protractor';
126126
127127
describe('workspace-project App', () => {
128-
const getParagraph = (name: string) => element(by.css('app-root p#' + name)).getText();
128+
const getParagraph = async (name: string) => element(by.css('app-root p#' + name)).getText();
129129
beforeEach(() => browser.get(browser.baseUrl));
130130
afterEach(async () => {
131131
// Assert that there are no errors emitted from the browser
@@ -135,17 +135,17 @@ export async function setupI18nConfig(useLocalize = true, format: keyof typeof f
135135
} as logging.Entry));
136136
});
137137
138-
it('should display welcome message', () =>
139-
expect(getParagraph('hello')).toEqual('${translation.hello}'));
138+
it('should display welcome message', async () =>
139+
expect(await getParagraph('hello')).toEqual('${translation.hello}'));
140140
141-
it('should display locale', () =>
142-
expect(getParagraph('locale')).toEqual('${lang}'));
141+
it('should display locale', async () =>
142+
expect(await getParagraph('locale')).toEqual('${lang}'));
143143
144-
it('should display localized date', () =>
145-
expect(getParagraph('date')).toEqual('${translation.date}'));
144+
it('should display localized date', async () =>
145+
expect(await getParagraph('date')).toEqual('${translation.date}'));
146146
147-
it('should display pluralized message', () =>
148-
expect(getParagraph('plural')).toEqual('${translation.plural}'));
147+
it('should display pluralized message', async () =>
148+
expect(await getParagraph('plural')).toEqual('${translation.plural}'));
149149
});
150150
`);
151151
}

0 commit comments

Comments
 (0)