Skip to content

Commit

Permalink
test: upgrade playwright
Browse files Browse the repository at this point in the history
  • Loading branch information
asmyshlyaev177 committed Nov 2, 2024
1 parent 5b920cf commit 8b81967
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@
"@babel/preset-typescript": "^7.24.7",
"@commitlint/cli": "^19.0.3",
"@commitlint/config-conventional": "^19.0.3",
"@playwright/test": "^1.45.3",
"@playwright/test": "^1.48.2",
"@rollup/plugin-node-resolve": "^15.3.0",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^12.1.0",
Expand Down Expand Up @@ -386,7 +386,7 @@
"jest-environment-jsdom": "^29.7.0",
"lint-staged": "^15.2.9",
"only-allow": "^1.2.1",
"playwright": "^1.45.3",
"playwright": "^1.48.2",
"prettier": "^3.2.5",
"prettier-plugin-tailwindcss": "^0.6.8",
"release-it": "^17.6.0",
Expand Down
7 changes: 4 additions & 3 deletions tests/useUrlState/main.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ const urls = [
'http://localhost:5181',
];

const delay = 1

test.describe('main tests', () => {
const expectedUrl =
'?name=%27My+Name%27&age=33&agree+to+terms=true&tags=%5B%7B%27id%27%3A%271%27%2C%27value%27%3A%7B%27text%27%3A%27React.js%27%2C%27time%27%3A%272024-07-17T04%3A53%3A17.000Z%27%7D%7D%5D';
Expand Down Expand Up @@ -43,7 +45,6 @@ test.describe('main tests', () => {
await page.goto(url);
await page.waitForSelector('button[name="Reload page"]');

const delay = 5

const text1 = 'One two three four'

Expand Down Expand Up @@ -84,11 +85,11 @@ test.describe('main tests', () => {
await page.getByLabel('name').focus();
await page
.getByLabel('name')
.pressSequentially(values.name, { delay: 150 });
.pressSequentially(values.name, { delay });
await page.getByLabel('age').focus();
await page
.getByLabel('age')
.pressSequentially(values.age, { delay: 150 });
.pressSequentially(values.age, { delay });
await page.getByRole('checkbox', { name: 'agree to terms' }).click();
await page.waitForTimeout(400);
await page.getByText('React.js').click();
Expand Down
10 changes: 6 additions & 4 deletions tests/useUrlState/updateUrl.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,16 @@ const urls = [
'http://localhost:5181',
];

const delay = 1

for (const url of urls) {
test(`reset ${url}`, async ({ page }) => {

await page.goto(url);
await page.waitForSelector('button[name="Reload page"]');

await page.getByLabel('name').focus();
await page.getByLabel('name').pressSequentially('My Name', { delay: 5 });
await page.getByLabel('name').pressSequentially('My Name', { delay });
await page.getByText('React.js').click();

const expectedText = `{
Expand Down Expand Up @@ -65,7 +67,7 @@ test.describe('update', () => {
await page.getByLabel('name').focus();
await page
.getByLabel('name')
.pressSequentially('My Name', { delay: 5 });
.pressSequentially('My Name', { delay });
await page.getByText('React.js').click();

const expectedText = `{
Expand Down Expand Up @@ -125,7 +127,7 @@ test.describe('update', () => {
await page.getByLabel('name').focus();
await page
.getByLabel('name')
.pressSequentially('My Name', { delay: 5 });
.pressSequentially('My Name', { delay });
await page.getByText('TailwindCSS').click();

const expectedText = `{
Expand Down Expand Up @@ -165,7 +167,7 @@ test.describe('update', () => {
await page.getByLabel('name').focus();
await page
.getByLabel('name')
.pressSequentially('My Name', { delay: 5 });
.pressSequentially('My Name', { delay });

const expectedText = `{
"name": "My Name",
Expand Down

0 comments on commit 8b81967

Please sign in to comment.