Persist Todos 66 Sa3ec9e01→

0 1 0
first smoke tag_A user_flow

Tests (1)

A

Todos survive a page refresh 66 Tff655495→

Tags
first smoke step-06 tag_A user_flow
Description
<!-- ai/agent generated description -->
### Preconditions
* Navigate to the Todos page
* Clear cookies
* Pre-populate the Todo list with four 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 four 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 66 @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')
})