From 12c3776b3ee1f3d2c556e60a65d28ebdfb3672c4 Mon Sep 17 00:00:00 2001 From: amarilda611 Date: Sun, 13 Jul 2025 23:35:12 +0200 Subject: [PATCH 1/3] Update demo-todo-app.spec.ts --- tests/demo-todo-app.spec.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/demo-todo-app.spec.ts b/tests/demo-todo-app.spec.ts index 4724ce95..965b0f3f 100644 --- a/tests/demo-todo-app.spec.ts +++ b/tests/demo-todo-app.spec.ts @@ -57,7 +57,10 @@ test.describe('New Todo', () => { // create a todo count locator const todoCount = page.getByTestId('todo-count') - + + // This is a purely cosmetic change to trigger a workflow run. + // You can remove this comment after verifying the auto-refresh. + // Check test using different methods. await expect(page.getByText('3 items left')).toBeVisible(); await expect(todoCount).toHaveText('3 items left'); @@ -351,7 +354,7 @@ test.describe('Routing', () => { }); test('should respect the back button', async ({ page }) => { - const todoItem = page.getByTestId('todo-item'); + const todoItem = page.getByTestId('todo-item'); await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); await checkNumberOfCompletedTodosInLocalStorage(page, 1); @@ -435,4 +438,4 @@ async function checkTodosInLocalStorage(page: Page, title: string) { return await page.waitForFunction(t => { return JSON.parse(localStorage['react-todos']).map((todo: any) => todo.title).includes(t); }, title); -} \ No newline at end of file +} From a3b8722bf35cf9012495e5dc68c7d3247ea310c8 Mon Sep 17 00:00:00 2001 From: amarilda611 Date: Tue, 15 Jul 2025 16:02:58 +0200 Subject: [PATCH 2/3] Update demo-todo-app.spec.ts --- tests/demo-todo-app.spec.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/demo-todo-app.spec.ts b/tests/demo-todo-app.spec.ts index 965b0f3f..cbc87c4c 100644 --- a/tests/demo-todo-app.spec.ts +++ b/tests/demo-todo-app.spec.ts @@ -1,3 +1,4 @@ +//try to see if code runs without any protection rule import { test, expect, type Page } from '@playwright/test'; test.beforeEach(async ({ page }) => { From 5fcd4f2c9310041b769c3df908a12fbf4cf0e7e7 Mon Sep 17 00:00:00 2001 From: amarilda611 Date: Tue, 15 Jul 2025 16:30:23 +0200 Subject: [PATCH 3/3] Update demo-todo-app.spec.ts Adding new changes to ensure the auto refresh of the PR. --- tests/demo-todo-app.spec.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/demo-todo-app.spec.ts b/tests/demo-todo-app.spec.ts index cbc87c4c..0c5bc646 100644 --- a/tests/demo-todo-app.spec.ts +++ b/tests/demo-todo-app.spec.ts @@ -1,4 +1,3 @@ -//try to see if code runs without any protection rule import { test, expect, type Page } from '@playwright/test'; test.beforeEach(async ({ page }) => { @@ -14,6 +13,9 @@ const TODO_ITEMS = [ test.describe('New Todo', () => { test('should allow me to add todo items', async ({ page }) => { + // This was your first visual assertion + // await expect(page).toHaveScreenshot('initial-empty-state.png'); // Capture initial state + // create a new todo locator const newTodo = page.getByPlaceholder('What needs to be done?'); @@ -91,6 +93,9 @@ test.describe('Mark all as completed', () => { // Ensure all todos have 'completed' class. await expect(page.getByTestId('todo-item')).toHaveClass(['completed', 'completed', 'completed']); await checkNumberOfCompletedTodosInLocalStorage(page, 3); + + // ⭐ ADDED THIS LINE HERE ⭐ + await expect(page).toHaveScreenshot('all-items-completed.png'); // Capture state after marking all as complete }); test('should allow me to clear the complete state of all items', async ({ page }) => { @@ -369,7 +374,7 @@ test.describe('Routing', () => { await page.getByRole('link', { name: 'Active' }).click(); }); - await test.step('Showing completed items', async () => { + await test.step('Showing completed items', async ({ page }) => { // This was the previous change await page.getByRole('link', { name: 'Completed' }).click(); });