Persist Todos 117 S2e6c7db7→

0 1 0
first smoke tag_A user_flow

Tests (1)

A

Todos survive a page refresh 117 T4e38110b→

Tags
first smoke step-06 tag_A user_flow
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 117 @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')
})