Skip to content

Commit 339d287

Browse files
authored
Update e2e tests to work with Angular 19 (#3380)
1 parent 2cde999 commit 339d287

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/SIL.XForge.Scripture/ClientApp/e2e/e2e-utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,9 @@ export async function deleteProject(page: Page, shortName: string): Promise<void
256256
const paragraph = await page.getByText('This action cannot be undone');
257257
const projectName = (await paragraph.textContent())?.match(/delete the (.*) project/)?.[1];
258258
if (projectName == null) throw new Error('Project name not found');
259-
await page.getByRole('textbox', { name: 'Project name' }).fill(projectName);
260-
await page.getByRole('button', { name: 'Delete this project' }).click();
259+
const dialogContainer = await page.locator('mat-dialog-container');
260+
await dialogContainer.getByRole('textbox', { name: 'Project name' }).fill(projectName);
261+
await dialogContainer.getByRole('button', { name: 'Delete this project' }).click();
261262

262263
// Wait for the project to be fully deleted and user redirected to my projects page
263264
await page.waitForURL(url => /\/projects\/?$/.test(url.pathname));

src/SIL.XForge.Scripture/ClientApp/e2e/workflows/community-checking.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export async function communityChecking(
8787
await expect(
8888
page.getByRole('heading', { name: 'Are you sure you want to archive all the questions in John?' })
8989
).toBeVisible();
90-
await user.click(page.getByRole('button', { name: 'Archive' }));
90+
await user.click(page.locator('mat-dialog-container').getByRole('button', { name: 'Archive' }));
9191

9292
await user.click(page.getByRole('button', { name: 'Import' }));
9393
const fileChooserPromise = page.waitForEvent('filechooser');

src/SIL.XForge.Scripture/ClientApp/e2e/workflows/edit-translation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ export async function editTranslation(
7979
await expect(deletedSegments[0]).toBe(initialSegmentText);
8080

8181
await user.click(page.getByRole('button', { name: 'Restore this version' }));
82-
await user.click(page.getByRole('button', { name: 'Restore' }));
82+
await user.click(page.getByRole('button', { name: 'Restore', exact: true }));
8383

8484
// Go back to the editor tab
8585
await goToProjectTab(page, user, 'target', DEFAULT_PROJECT_SHORTNAME);

0 commit comments

Comments
 (0)