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
1. Mark the first todo item as completed
2. Refresh the page
3. Verify that the same todo items are displayed
4. 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 131 @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')
})