Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

Commit 5fcd4f2

Browse files
authored
Update demo-todo-app.spec.ts
Adding new changes to ensure the auto refresh of the PR.
1 parent a3b8722 commit 5fcd4f2

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

tests/demo-todo-app.spec.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
//try to see if code runs without any protection rule
21
import { test, expect, type Page } from '@playwright/test';
32

43
test.beforeEach(async ({ page }) => {
@@ -14,6 +13,9 @@ const TODO_ITEMS = [
1413

1514
test.describe('New Todo', () => {
1615
test('should allow me to add todo items', async ({ page }) => {
16+
// This was your first visual assertion
17+
// await expect(page).toHaveScreenshot('initial-empty-state.png'); // Capture initial state
18+
1719
// create a new todo locator
1820
const newTodo = page.getByPlaceholder('What needs to be done?');
1921

@@ -91,6 +93,9 @@ test.describe('Mark all as completed', () => {
9193
// Ensure all todos have 'completed' class.
9294
await expect(page.getByTestId('todo-item')).toHaveClass(['completed', 'completed', 'completed']);
9395
await checkNumberOfCompletedTodosInLocalStorage(page, 3);
96+
97+
// ⭐ ADDED THIS LINE HERE ⭐
98+
await expect(page).toHaveScreenshot('all-items-completed.png'); // Capture state after marking all as complete
9499
});
95100

96101
test('should allow me to clear the complete state of all items', async ({ page }) => {
@@ -369,7 +374,7 @@ test.describe('Routing', () => {
369374
await page.getByRole('link', { name: 'Active' }).click();
370375
});
371376

372-
await test.step('Showing completed items', async () => {
377+
await test.step('Showing completed items', async ({ page }) => { // This was the previous change
373378
await page.getByRole('link', { name: 'Completed' }).click();
374379
});
375380

0 commit comments

Comments
 (0)