Description
<!-- ai/agent generated description -->
### Preconditions
* Navigate to the Todos page
* Pre-populate the todo list with existing items (foo, bar, baz, and boom, where boom is completed)
### Steps
* Mark the first todo item as completed
* Refresh the page
* Verify that the same todo items are displayed
* Verify that the first todo item is still marked as completed
### Expected Result
* The todo list remains the same after page refresh
* The first todo item is still marked as completed
Code
Before(async ({ I, TodosPage }) => {
I.say('Given I have some todos')
I.clearCookie()
TodosPage.goto()
TodosPage.enterTodos([
{title: 'foo', completed: false},
{title: 'bar', completed: false},
{title: 'baz', completed: false},
{title: 'boom', completed: true},
])
TodosPage.refresh()
I.saveScreenshot('initial-todos.png')
})
Scenario('Todos survive a page refresh 88 @step-06', async ({ I, TodosPage }) => {
I.say('And I marked the first as completed')
await TodosPage.markNthAsCompleted(1)
I.say('When I refresh the page')
TodosPage.refresh()
I.say('Then I still see the same todos')
TodosPage.seeNumberOfTodos(4)
await TodosPage.seeNthTodoEquals(1, 'foo')
I.saveScreenshot('todos-survive-page-refresh.png')
})