Skip to content

Commit

Permalink
minor: tweak image upload cancel e2e for less flake (#2440)
Browse files Browse the repository at this point in the history
tweak image upload cancel e2e for less flake
  • Loading branch information
david-crespo authored Sep 12, 2024
1 parent b4e2626 commit 63c604b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/e2e/image-upload.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,19 @@ test.describe('Image upload', () => {

await page.click('role=button[name="Upload image"]')

const progressModal = page.getByRole('dialog', { name: 'Image upload progress' })
await expect(progressModal).toBeVisible()

// wait to be in the middle of upload
const uploadStep = page
.locator('div[data-status]')
.getByTestId('upload-step')
.filter({ hasText: 'Upload image file' })
.first()
await expect(uploadStep).toHaveAttribute('data-status', 'running')

// form is disabled and semi-hidden
// await expectNotVisible(page, ['role=textbox[name="Name"]'])

const progressModal = page.getByRole('dialog', { name: 'Image upload progress' })

page.on('dialog', (dialog) => dialog.accept()) // click yes on the are you sure prompt
await progressModal.getByRole('button', { name: 'Cancel' }).click()

Expand Down

0 comments on commit 63c604b

Please sign in to comment.