Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

minor: tweak image upload cancel e2e for less flake #2440

Merged
merged 1 commit into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading