fix(functional-tests): Await oauth prompt none error

Because:

* Error message was not awaited properly causing tests to error

This commit:

* Await error message without using class selector

Closes #FXA-9932
This commit is contained in:
Valerie Pomerleau 2024-06-21 10:06:07 -07:00
Родитель b1d6f78246
Коммит 7a428e31a5
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 33A451F0BB2180B4
2 изменённых файлов: 12 добавлений и 19 удалений

Просмотреть файл

@ -84,11 +84,6 @@ export class RelierPage extends BaseLayout {
return this.page.locator('.ready .prompt-none').click();
}
async promptNoneError() {
this.page.locator('.error');
return this.page.innerText('.error');
}
async clickSubscribe() {
await this.page
.getByRole('link', { name: 'Subscribe to Pro (USD)' })

Просмотреть файл

@ -33,7 +33,7 @@ test.describe('severity-1 #smoke', () => {
await relier.signInPromptNone();
//Verify error message
expect(await relier.promptNoneError()).toContain('User is not signed in');
await expect(page.getByText('User is not signed in')).toBeVisible();
});
test('fails RP that is not allowed', async ({
@ -55,9 +55,9 @@ test.describe('severity-1 #smoke', () => {
await relier.signInPromptNone();
//Verify error message
expect(await relier.promptNoneError()).toContain(
'prompt=none is not enabled for this client'
);
await expect(
page.getByText('prompt=none is not enabled for this client')
).toBeVisible();
});
test('fails if requesting keys', async ({
@ -86,9 +86,9 @@ test.describe('severity-1 #smoke', () => {
await relier.signInPromptNone();
//Verify error message
expect(await relier.promptNoneError()).toContain(
'prompt=none cannot be used when requesting keys'
);
await expect(
page.getByText('prompt=none cannot be used when requesting keys')
).toBeVisible();
});
test('fails if session is no longer valid', async ({
@ -119,7 +119,7 @@ test.describe('severity-1 #smoke', () => {
await relier.signInPromptNone();
//Verify error message
expect(await relier.promptNoneError()).toContain('User is not signed in');
await expect(page.getByText('User is not signed in')).toBeVisible();
});
test('fails if account is not verified', async ({
@ -147,9 +147,7 @@ test.describe('severity-1 #smoke', () => {
await relier.signInPromptNone();
//Verify error message
expect(await relier.promptNoneError()).toContain(
'Unverified user or session'
);
await expect(page.getByText('Unverified user or session')).toBeVisible();
});
});
@ -214,9 +212,9 @@ test.describe('severity-1 #smoke', () => {
await relier.signInPromptNone();
//Verify error message
expect(await relier.promptNoneError()).toContain(
'A different user is signed in'
);
await expect(
page.getByText('A different user is signed in')
).toBeVisible();
});
});
});