-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f7003ba
commit b89bea4
Showing
6 changed files
with
49 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { addAndRemoveTasks } from './test-helpers'; | ||
|
||
const taskCount = parseFloat(process.env.TASK_COUNT || 500); | ||
|
||
test('non-reactive', async ({ page }) => { | ||
await addAndRemoveTasks({ page, reactive: false, taskCount}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { addAndRemoveTasks } from './test-helpers'; | ||
|
||
const taskCount = parseFloat(process.env.TASK_COUNT || 500); | ||
|
||
test('reactive', async ({ page }) => { | ||
await addAndRemoveTasks({ page, reactive: true, taskCount }); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
export const addAndRemoveTasks = async ({ page, reactive, taskCount }) => { | ||
await page.goto('http://localhost:3000/'); | ||
await page.getByLabel(reactive ? 'Reactive' : 'No Reactive', { exact: true }).check(); | ||
|
||
await page.getByRole('button', { name: 'Remove all tasks' }).click(); | ||
|
||
const tasks = Array.from({ length: taskCount }); | ||
let addedNum = 1; | ||
for await (const _addTask of tasks) { | ||
await page.getByRole('button', { name: 'Add task' }).click(); | ||
await page.waitForSelector(`text="New Task ${addedNum}"`, { state: 'visible' }); | ||
addedNum += 1; | ||
} | ||
let removedNum = 1; | ||
for await (const _removeTask of tasks) { | ||
await page.getByRole('button', { name: 'Remove task' }).click(); | ||
await page.waitForSelector(`text="New Task ${removedNum}"`, { state: 'detached' }); | ||
removedNum += 1; | ||
} | ||
|
||
await page.getByRole('button', { name: 'Remove all tasks' }).click(); | ||
}; |