Skip to content

Commit

Permalink
chore: upgrade puppeteer to v19 (#2478)
Browse files Browse the repository at this point in the history
* chore: upgrade puppeteer to v19

* chore: update lockfile

* fix: selectors
  • Loading branch information
emmenko committed Apr 5, 2023
1 parent b9f80bf commit f59c868
Show file tree
Hide file tree
Showing 64 changed files with 269 additions and 404 deletions.
2 changes: 1 addition & 1 deletion design-system/src/theme-provider.visualspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getDocument, queries } from 'pptr-testing-library';
describe('ThemeProvider', () => {
it('Default', async () => {
await page.goto(`${globalThis.HOST}/theme-provider`);
await expect(page).toMatch('use global default theme');
await page.waitForSelector('text/use global default theme');
await percySnapshot(page, 'ThemeProvider');
});
});
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@
"@manypkg/cli": "0.20.0",
"@manypkg/get-packages": "1.1.3",
"@percy/cli": "1.21.0",
"@percy/puppeteer": "2.0.0",
"@percy/puppeteer": "2.0.2",
"@preconstruct/cli": "2.3.0",
"@stylelint/postcss-css-in-js": "^0.38.0",
"@svgr/cli": "6.5.1",
Expand Down Expand Up @@ -111,7 +111,7 @@
"jest": "29.5.0",
"jest-environment-jsdom": "29.5.0",
"jest-localstorage-mock": "2.4.26",
"jest-puppeteer": "6.2.0",
"jest-puppeteer": "8.0.6",
"jest-runner-eslint": "1.2.0",
"jest-runner-stylelint": "2.3.7",
"jest-silent-reporter": "0.5.0",
Expand All @@ -128,7 +128,7 @@
"postcss-value-parser": "4.2.0",
"pptr-testing-library": "0.7.0",
"prettier": "2.8.6",
"puppeteer": "15.5.0",
"puppeteer": "19.8.3",
"qs": "6.11.1",
"rcfile": "1.0.3",
"react": "17.0.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/components/avatar/src/avatar.visualspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Avatar', () => {
});

it('Default', async () => {
await expect(page).toMatch('when gravatar hash is known');
await page.waitForSelector('text/when gravatar hash is known');
await percySnapshot(page, 'Avatar');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('FlatButton', () => {
});

it('Default', async () => {
await expect(page).toMatch('A label text');
await page.waitForSelector('text/A label text');
await percySnapshot(page, 'FlatButton');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('IconButton', () => {
});

it('Default', async () => {
await expect(page).toMatch('A label text');
await page.waitForSelector('text/A label text');
await percySnapshot(page, 'IconButton');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('PrimaryButton', () => {
});

it('Default', async () => {
await expect(page).toMatch('A label text');
await page.waitForSelector('text/A label text');
await percySnapshot(page, 'PrimaryButton');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('SecondaryIconButton', () => {
});

it('Default', async () => {
await expect(page).toMatch('A label text');
await page.waitForSelector('text/A label text');
await percySnapshot(page, 'SecondaryIconButton');
});
});
2 changes: 1 addition & 1 deletion packages/components/card/src/card.visualspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Card', () => {
});

it('Default', async () => {
await expect(page).toMatch(/InsetScale/);
await page.waitForSelector('text/InsetScale');
await percySnapshot(page, 'Card');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('CollapsiblePanel', () => {
});

it('Default', async () => {
await expect(page).toMatch('condensed');
await page.waitForSelector('text/condensed');
await percySnapshot(page, 'CollapsiblePanel');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Constraints.Horizontal', () => {
});

it('Default', async () => {
await expect(page).toMatch('when max is 1');
await page.waitForSelector('text/when max is 1');
await percySnapshot(page, 'Constraints.Horizontal');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('DataTable', () => {
});

it('Default', async () => {
await expect(page).toMatch('default');
await page.waitForSelector('text/default');
await percySnapshot(page, 'DataTable');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('FieldLabel', () => {
});

it('Default', async () => {
await expect(page).toMatch('Hello');
await page.waitForSelector('text/Hello');
await percySnapshot(page, 'FieldLabel');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('CreatableSelectField', () => {
});

it('Default', async () => {
await expect(page).toMatch('State');
await page.waitForSelector('text/State');
await percySnapshot(page, 'CreatableSelectField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('DateField', () => {
});

it('DateField', async () => {
await expect(page).toMatch('Release Date');
await page.waitForSelector('text/Release Date');
await percySnapshot(page, 'DateField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('DateRangeField', () => {
});

it('Default', async () => {
await expect(page).toMatch('Discounted days');
await page.waitForSelector('text/Discounted days');
await percySnapshot(page, 'DateRangeField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('DateTimeField', () => {
});

it('Default', async () => {
await expect(page).toMatch('Release Date');
await page.waitForSelector('text/Release Date');
await percySnapshot(page, 'DateTimeField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('LocalizedMultilineTextField', () => {
});

it('Default', async () => {
await expect(page).toMatch('Welcome Text');
await page.waitForSelector('text/Welcome Text');
await percySnapshot(page, 'LocalizedMultilineTextField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('LocalizedTextField', () => {
});

it('Default', async () => {
await expect(page).toMatch('Welcome Text');
await page.waitForSelector('text/Welcome Text');
await percySnapshot(page, 'LocalizedTextField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('MoneyField', () => {
});

it('Default', async () => {
await expect(page).toMatch('Price');
await page.waitForSelector('text/Price');
await percySnapshot(page, 'MoneyField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('MultilineTextField', () => {
});

it('MultilineTextField', async () => {
await expect(page).toMatch('Welcome Text');
await page.waitForSelector('text/Welcome Text');
await percySnapshot(page, 'MultilineTextField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('NumberField', () => {
});

it('Default', async () => {
await expect(page).toMatch('Age');
await page.waitForSelector('text/Age');
await percySnapshot(page, 'NumberField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('PasswordField', () => {
});

it('Default', async () => {
await expect(page).toMatch('Welcome Text');
await page.waitForSelector('text/Welcome Text');
await percySnapshot(page, 'PasswordField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('RadioField', () => {
});

it('Default', async () => {
await expect(page).toMatch('Welcome Text');
await page.waitForSelector('text/Welcome Text');
await percySnapshot(page, 'RadioField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('SelectField', () => {
});

it('Default', async () => {
await expect(page).toMatch('State');
await page.waitForSelector('text/State');
await percySnapshot(page, 'SelectField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('TextField', () => {
});

it('Default', async () => {
await expect(page).toMatch('Welcome Text');
await page.waitForSelector('text/Welcome Text');
await percySnapshot(page, 'TextField');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('TimeField', () => {
});

it('Default', async () => {
await expect(page).toMatch('Release Time');
await page.waitForSelector('text/Release Time');
await percySnapshot(page, 'TimeField');
});
});
2 changes: 1 addition & 1 deletion packages/components/grid/src/grid.visualspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('Grid', () => {
});

it('Default', async () => {
await expect(page).toMatch('1');
await page.waitForSelector('text/1');
await percySnapshot(page, 'Grid');
});
});
4 changes: 2 additions & 2 deletions packages/components/icons/src/icons.visualspec.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ describe('Icons', () => {
colors.map((color) =>
it(`Color ${color}`, async () => {
await page.goto(`${globalThis.HOST}/icons/${color}`);
await expect(page).toMatch(color);
await page.waitForSelector(`text/${color}`);
await snapshot(page, `Icons - Color: ${color}`);
})
);
});
it('Inline SVG', async () => {
await page.goto(`${globalThis.HOST}/icons/inline-svg`);
await expect(page).toMatch('Inline SVG');
await page.waitForSelector('text/Inline SVG');
await percySnapshot(page, `Icons - Inline SVG`);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getDocument, queries } from 'pptr-testing-library';
describe('AsyncCreatableSelectInput', () => {
it('Default', async () => {
await page.goto(`${globalThis.HOST}/async-creatable-select-input`);
await expect(page).toMatch('minimal');
await page.waitForSelector('text/minimal');
await percySnapshot(page, 'AsyncCreatableSelectInput');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getDocument, queries } from 'pptr-testing-library';
describe('AsyncSelectInput', () => {
it('Default', async () => {
await page.goto(`${globalThis.HOST}/async-select-input`);
await expect(page).toMatch('minimal');
await page.waitForSelector('text/minimal');
await percySnapshot(page, 'AsyncSelectInput');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('CheckboxInput', () => {
});

it('CheckboxInput', async () => {
await expect(page).toMatch('when default');
await page.waitForSelector('text/when default');
await percySnapshot(page, 'Checkbox');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import percySnapshot from '@percy/puppeteer';
describe('CreatableSelectInput', () => {
it('CreatableSelectInput', async () => {
await page.goto(`${globalThis.HOST}/creatable-select-input`);
await expect(page).toMatch('minimal');
await page.waitForSelector('text/minimal');
await percySnapshot(page, 'CreatableSelectInput');
});

it('Open', async () => {
await page.goto(`${globalThis.HOST}/creatable-select-input-open`);
await page.click('#creatable-select-input');
await expect(page).toMatch('One');
await page.waitForSelector('text/One');
// TODO: uncomment when issue with Percy is resolved
// await percySnapshot(page, 'CreatableSelectInput - open');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import { getDocument, queries } from 'pptr-testing-library';
describe('DateInput', () => {
it('Default', async () => {
await page.goto(`${globalThis.HOST}/date-input`);
await expect(page).toMatch('minimal');
await page.waitForSelector('text/minimal');
await percySnapshot(page, 'DateInput');
});
it('Open', async () => {
await page.goto(`${globalThis.HOST}/date-input-open`);
await page.click('#date-input');
await expect(page).toMatch('November');
await page.waitForSelector('text/November');
// TODO: uncomment when issue with Percy is resolved
// await percySnapshot(page, 'DateInput - open');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import percySnapshot from '@percy/puppeteer';
describe('DateTimeInput', () => {
it('Default', async () => {
await page.goto(`${globalThis.HOST}/date-time-input`);
await expect(page).toMatch('minimal');
await page.waitForSelector('text/minimal');
await percySnapshot(page, 'DateTimeInput');
});
it('Open', async () => {
await page.goto(`${globalThis.HOST}/date-time-input-open`);
await page.click('#date-time-input');
await expect(page).toMatch('November');
await page.waitForSelector('text/November');
// TODO: uncomment when issue with Percy is resolved
// await percySnapshot(page, 'DateTimeInput - open');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('LocalizedMultilineTextInput', () => {
});

it('Default', async () => {
await expect(page).toMatch('minimal');
await page.waitForSelector('text/minimal');
await percySnapshot(page, 'LocalizedMultilineTextInput');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ describe('LocalizedRichTextInput', () => {

it('Default', async () => {
await page.goto(`${globalThis.HOST}/localized-rich-text-input`);
await expect(page).toMatch('minimal');
await page.waitForSelector('text/minimal');
await percySnapshot(page, 'LocalizedRichTextInput');
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('LocalizedTextInput', () => {
});

it('Default', async () => {
await expect(page).toMatch('hello world');
await page.waitForSelector('text/hello world');
await percySnapshot(page, 'LocalizedTextInput');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('MoneyInput', () => {
});

it('Default', async () => {
await expect(page).toMatch('minimal');
await page.waitForSelector('text/minimal');
await percySnapshot(page, 'MoneyInput');
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe('MultilineTextInput', () => {
});

it('Default', async () => {
await expect(page).toMatch('minimal');
await page.waitForSelector('text/minimal');
await percySnapshot(page, 'MultilineTextInput');
});
});
Loading

1 comment on commit f59c868

@vercel
Copy link

@vercel vercel bot commented on f59c868 Apr 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.