Skip to content

Commit d97310b

Browse files
authored
Try to make instance create e2e less flaky (#2593)
try to make instance create e2e less flaky
1 parent 8ba8a89 commit d97310b

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

test/e2e/instance-create.e2e.ts

+14-14
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import { floatingIp } from '@oxide/api-mocks'
99

1010
import {
11+
closeToast,
1112
expect,
1213
expectNotVisible,
1314
expectRowVisible,
@@ -99,14 +100,7 @@ test('can create an instance', async ({ page }) => {
99100

100101
await page.getByRole('button', { name: 'Create instance' }).click()
101102

102-
await expect(page).toHaveURL(`/projects/mock-project/instances/${instanceName}/storage`)
103-
104-
await expectVisible(page, [
105-
`h1:has-text("${instanceName}")`,
106-
'text=16 vCPUs',
107-
'text=64 GiB',
108-
'text=from space',
109-
])
103+
await closeToast(page)
110104

111105
// instance goes from creating to starting to running as we poll
112106
const pollingSpinner = page.getByLabel('Spinner')
@@ -116,6 +110,14 @@ test('can create an instance', async ({ page }) => {
116110
await expect(page.getByText('Running')).toBeVisible()
117111
await expect(pollingSpinner).toBeHidden()
118112

113+
// do this after state checks because sometimes it takes too long and we miss 'creating'
114+
await expect(page).toHaveURL(`/projects/mock-project/instances/${instanceName}/storage`)
115+
116+
await expect(page.getByRole('heading', { name: instanceName })).toBeVisible()
117+
await expect(page.getByText('16 vCPUs')).toBeVisible()
118+
await expect(page.getByText('64 GiB')).toBeVisible()
119+
await expect(page.getByText('from space')).toBeVisible()
120+
119121
// boot disk visible, no other disks attached
120122
await expect(
121123
page
@@ -194,12 +196,10 @@ test('can create an instance with custom hardware', async ({ page }) => {
194196

195197
await expect(page).toHaveURL(`/projects/mock-project/instances/${instanceName}/storage`)
196198

197-
await expectVisible(page, [
198-
`h1:has-text("${instanceName}")`,
199-
'text=29 vCPUs',
200-
'text=53 GiB',
201-
'text=from space',
202-
])
199+
await expect(page.getByRole('heading', { name: instanceName })).toBeVisible()
200+
await expect(page.getByText('29 vCPUs')).toBeVisible()
201+
await expect(page.getByText('53 GiB')).toBeVisible()
202+
await expect(page.getByText('from space')).toBeVisible()
203203
})
204204

205205
test('automatically updates disk size when larger image selected', async ({ page }) => {

0 commit comments

Comments
 (0)