Skip to content

Commit 3c85009

Browse files
Pollepsjoepio
authored andcommitted
#243 Test selector fix
1 parent d3439d7 commit 3c85009

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

data-browser/tests/e2e.spec.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const publicReadRight =
3333
const contextMenu = '[data-test="context-menu"]';
3434
const addressBar = '[data-test="address-bar"]';
3535
const defaultDevServer = 'http://localhost:9883';
36+
const currentDialogOkButton = 'dialog[open] >> footer >> text=Ok';
3637
// Depends on server index throttle time, `commit_monitor.rs`
3738
const REBUILD_INDEX_TIME = 6000;
3839

@@ -120,7 +121,7 @@ test.describe('data-browser', async () => {
120121
await page.locator('[data-test="sidebar-new-resource"]').click();
121122
await page.locator('button:has-text("folder")').click();
122123
await page.locator('[placeholder="New Folder"]').fill('Not This Folder');
123-
await page.locator('text=Ok').nth(1).click();
124+
await page.locator(currentDialogOkButton).click();
124125

125126
// Create document called 'Avocado Salad'
126127
await page.locator('button:has-text("New Resource")').click();
@@ -135,7 +136,7 @@ test.describe('data-browser', async () => {
135136
// Create folder called 'This folder'
136137
await page.locator('button:has-text("folder")').click();
137138
await page.locator('[placeholder="New Folder"]').fill('This Folder');
138-
await page.locator('text=Ok').nth(1).click();
139+
await page.locator(currentDialogOkButton).click();
139140

140141
// Create document called 'Avocado Salad'
141142
await page.locator('button:has-text("New Resource")').click();
@@ -382,7 +383,7 @@ test.describe('data-browser', async () => {
382383
const input = page.locator('[placeholder="https\\:\\/\\/example\\.com"]');
383384
await input.click();
384385
await input.fill('https://example.com');
385-
await page.locator('dialog[open] >> footer >> text=Ok').click();
386+
await page.locator(currentDialogOkButton).click();
386387

387388
await expect(page.locator('text=This domain is ')).toBeVisible();
388389
});
@@ -398,7 +399,7 @@ test.describe('data-browser', async () => {
398399
const input = page.locator('[placeholder="New Folder"]');
399400
await input.click();
400401
await input.fill('RAM Downloads');
401-
await page.locator('dialog[open] >> footer >> text=Ok').click();
402+
await page.locator(currentDialogOkButton).click();
402403

403404
await expect(page.locator('h1:text("Ram Downloads")')).toBeVisible();
404405

0 commit comments

Comments
 (0)