refactor(client): migrate C# modals (#54176)

This commit is contained in:
Huyen Nguyen
2024-04-03 20:01:50 +07:00
committed by GitHub
parent a39e74052c
commit 595dd5f653
11 changed files with 74 additions and 65 deletions
+14 -4
View File
@@ -15,6 +15,7 @@ test.beforeEach(async ({ page }) => {
name: translations.buttons['click-start-exam']
})
.click();
await page
.getByRole('button', {
name: translations.buttons['exit-exam']
@@ -27,19 +28,23 @@ test.describe('Exit exam Modal E2E Test Suite', () => {
page
}) => {
await expect(
page.getByText(translations.learn.exam['exit-header'])
page.getByRole('dialog', { name: translations.learn.exam['exit-header'] })
).toBeVisible();
await expect(page.getByText(translations.learn.exam.exit)).toBeVisible();
await expect(
page.getByRole('button', {
name: translations.learn.exam['exit-yes']
})
).toBeVisible();
await expect(
page.getByRole('button', {
name: translations.buttons.close
})
).toBeVisible();
await expect(
page.getByRole('button', {
name: translations.learn.exam['exit-no']
@@ -53,9 +58,11 @@ test.describe('Exit exam Modal E2E Test Suite', () => {
await page
.getByRole('button', { name: translations.learn.exam['exit-no'] })
.click();
await expect(
page.getByText(translations.learn.exam['exit-header'])
page.getByRole('dialog', { name: translations.learn.exam['exit-header'] })
).not.toBeVisible();
await expect(page).toHaveURL(examUrl);
});
@@ -65,8 +72,9 @@ test.describe('Exit exam Modal E2E Test Suite', () => {
await page
.getByRole('button', { name: translations.learn.exam['exit-yes'] })
.click();
await expect(
page.getByText(translations.learn.exam['exit-header'])
page.getByRole('dialog', { name: translations.learn.exam['exit-header'] })
).not.toBeVisible();
await expect(page).toHaveURL(cancelExamUrl);
@@ -80,9 +88,11 @@ test.describe('Exit exam Modal E2E Test Suite', () => {
name: translations.buttons.close
})
.click();
await expect(
page.getByText(translations.learn.exam['exit-header'])
page.getByRole('dialog', { name: translations.learn.exam['exit-header'] })
).not.toBeVisible();
await expect(page).toHaveURL(examUrl);
});
});