Skip to content

Commit

Permalink
add extra assert for instance create with additional disks test flake
Browse files Browse the repository at this point in the history
  • Loading branch information
david-crespo committed Dec 13, 2024
1 parent 79d610d commit aaf1154
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/e2e/instance-create.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,17 @@ test('create instance with additional disks', async ({ page }) => {
await page.getByRole('button', { name: 'Create new disk' }).click()

const createForm = page.getByRole('dialog', { name: 'Create disk' })
await expect(createForm).toBeVisible() // kill time to help size field flake?

// verify that an existing name can't be used
await createForm.getByRole('textbox', { name: 'Name', exact: true }).fill('disk-6')
await createForm.getByRole('textbox', { name: 'Size (GiB)' }).fill('5')

// this fill fails to happen sometimes, causing test flakes. the assert here
// should catch it slightly sooner
const sizeField = createForm.getByRole('textbox', { name: 'Size (GiB)' })
await sizeField.fill('5')
await expect(sizeField).toHaveValue('5')

await createForm.getByRole('button', { name: 'Create disk' }).click()
await expect(createForm.getByText('Name is already in use')).toBeVisible()

Expand Down

0 comments on commit aaf1154

Please sign in to comment.