{
await pathInput.fill(testPath)
await files.dialogInput(page, 'name').fill(testFilename)
- // Click Import button
- const importDialogButton = page.getByRole('button', { name: 'Import' })
+ // Click Import button in the dialog
+ const importDialogButton = modal.container(page).getByRole('button', { name: 'Import' })
await expect(importDialogButton).toBeVisible()
await importDialogButton.click()
@@ -192,7 +192,7 @@ test.describe('Files screen', () => {
await pathInput.fill(nonExistentPath)
// Click Import button to submit
- const importDialogButton = page.getByRole('button', { name: 'Import' })
+ const importDialogButton = modal.container(page).getByRole('button', { name: 'Import' })
await expect(importDialogButton).toBeVisible()
await importDialogButton.click()
@@ -234,7 +234,7 @@ test.describe('Files screen', () => {
await files.importButton(page).click()
await files.addByPathOption(page).click()
await files.dialogInput(page, 'path').fill(invalidPath)
- await page.getByRole('button', { name: 'Import' }).click()
+ await modal.container(page).getByRole('button', { name: 'Import' }).click()
// Wait for error notification
const notification = page.locator('.fileImportStatus')
diff --git a/test/e2e/ipns.test.js b/test/e2e/ipns.test.js
index b4df09f8a..66e27fac9 100644
--- a/test/e2e/ipns.test.js
+++ b/test/e2e/ipns.test.js
@@ -110,6 +110,12 @@ test.describe('IPNS publishing', () => {
await files.dialogInput(page, 'name').fill(testFilename)
await page.keyboard.press('Enter')
+ // Wait for the dialog to close before proceeding
+ await expect(pathInput).not.toBeVisible({ timeout: 10000 })
+
+ // Also wait for the modal overlay to be completely gone
+ await page.locator('[aria-label="Close modal"]').waitFor({ state: 'hidden', timeout: 5000 }).catch(() => {})
+
// expect file with matching filename to be added to the file list
const fileRow = page.getByTestId('file-row').filter({ hasText: testFilename })
await expect(fileRow).toBeVisible()