Skip to content

Commit 5ec02f3

Browse files
makeliciousZangetsu101
authored andcommitted
fix: add test case for refresh
1 parent f633718 commit 5ec02f3

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

e2e/testcases/form-state/form-state.spec.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,4 +180,40 @@ test.describe('Form state', () => {
180180
await expect(page.getByTestId('text__firstname')).not.toBeVisible()
181181
})
182182
})
183+
184+
test.describe
185+
.serial('Declaration form is populated after refresh', async () => {
186+
let page: Page
187+
188+
test.beforeAll(async ({ browser }) => {
189+
page = await browser.newPage()
190+
})
191+
192+
test.afterAll(async () => {
193+
await page.close()
194+
})
195+
196+
test('Login', async () => {
197+
await login(page)
198+
})
199+
test('Move to birth form', async () => {
200+
await page.click('#header-new-event')
201+
await page.getByLabel('Birth').click()
202+
await page.getByRole('button', { name: 'Continue' }).click()
203+
await page.getByRole('button', { name: 'Continue' }).click()
204+
})
205+
206+
test('Input child fields', async () => {
207+
const firstname = 'foo'
208+
const surname = 'bar'
209+
await page.locator('#firstname').fill(firstname)
210+
await page.locator('#surname').fill(surname)
211+
})
212+
213+
test('refresh the page and verify fields are populated', async () => {
214+
await page.reload()
215+
await expect(page.locator('#firstname')).toHaveValue('foo')
216+
await expect(page.locator('#surname')).toHaveValue('bar')
217+
})
218+
})
183219
})

0 commit comments

Comments
 (0)