Persist Todos 127 Sc834a066→

0 1 0
first smoke tag_A user_flow

Tests (1)

A

Todos survive a page refresh 127 T518949d6→

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
* 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 127 @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')
})