-
Notifications
You must be signed in to change notification settings - Fork 1
Update demo-todo-app.spec.ts (pbi-6.3 - ensure PR auto refresh) #109
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶 Code-Reviews-of-GUI-Tests/tests/demo-todo-app.spec.ts Lines 101 to 102 in 5fcd4f2
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶 Code-Reviews-of-GUI-Tests/tests/demo-todo-app.spec.ts Lines 373 to 374 in 5fcd4f2
|
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,6 +13,9 @@ | |||||||||||||||
|
|
||||||||||||||||
| test.describe('New Todo', () => { | ||||||||||||||||
| test('should allow me to add todo items', async ({ page }) => { | ||||||||||||||||
|
Comment on lines
14
to
15
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||
| // 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?'); | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -56,8 +59,11 @@ | |||||||||||||||
| await createDefaultTodos(page); | ||||||||||||||||
|
|
||||||||||||||||
| // create a todo count locator | ||||||||||||||||
| const todoCount = page.getByTestId('todo-count') | ||||||||||||||||
|
Check warning on line 62 in tests/demo-todo-app.spec.ts
|
||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
|
Comment on lines
62
to
+63
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||
| // 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'); | ||||||||||||||||
|
|
@@ -87,6 +93,9 @@ | |||||||||||||||
| // Ensure all todos have 'completed' class. | ||||||||||||||||
| await expect(page.getByTestId('todo-item')).toHaveClass(['completed', 'completed', 'completed']); | ||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||
| await checkNumberOfCompletedTodosInLocalStorage(page, 3); | ||||||||||||||||
|
|
||||||||||||||||
| // ⭐ ADDED THIS LINE HERE ⭐ | ||||||||||||||||
| await expect(page).toHaveScreenshot('all-items-completed.png'); // Capture state after marking all as complete | ||||||||||||||||
|
Check warning on line 98 in tests/demo-todo-app.spec.ts
|
||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||
| }); | ||||||||||||||||
|
|
||||||||||||||||
| test('should allow me to clear the complete state of all items', async ({ page }) => { | ||||||||||||||||
|
|
@@ -350,8 +359,8 @@ | |||||||||||||||
| await expect(todoItem).toHaveText([TODO_ITEMS[0], TODO_ITEMS[2]]); | ||||||||||||||||
| }); | ||||||||||||||||
|
|
||||||||||||||||
| test('should respect the back button', async ({ page }) => { | ||||||||||||||||
|
Check warning on line 362 in tests/demo-todo-app.spec.ts
|
||||||||||||||||
| const todoItem = page.getByTestId('todo-item'); | ||||||||||||||||
| const todoItem = page.getByTestId('todo-item'); | ||||||||||||||||
| await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); | ||||||||||||||||
|
Comment on lines
362
to
364
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
| await checkNumberOfCompletedTodosInLocalStorage(page, 1); | ||||||||||||||||
|
|
@@ -365,7 +374,7 @@ | |||||||||||||||
| 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 | ||||||||||||||||
|
Check warning on line 377 in tests/demo-todo-app.spec.ts
|
||||||||||||||||
| await page.getByRole('link', { name: 'Completed' }).click(); | ||||||||||||||||
|
Comment on lines
+377
to
378
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||
| }); | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -435,4 +444,4 @@ | |||||||||||||||
| return await page.waitForFunction(t => { | ||||||||||||||||
| return JSON.parse(localStorage['react-todos']).map((todo: any) => todo.title).includes(t); | ||||||||||||||||
|
Comment on lines
444
to
445
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [prettier] reported by reviewdog 🐶
Suggested change
|
||||||||||||||||
| }, title); | ||||||||||||||||
| } | ||||||||||||||||
| } | ||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[prettier] reported by reviewdog 🐶
Code-Reviews-of-GUI-Tests/tests/demo-todo-app.spec.ts
Lines 68 to 70 in 5fcd4f2