Skip to content

Commit 0cbd6d8

Browse files
dmlemeshkoCAWilson94
authored andcommitted
[chore] update playwright version + ownership (elastic#202535)
## Summary Since the new Kibana test framework has a strong dependency on `@playwright/test`, moving it under appex-qa ownership I had to update and explicitly specify types when extending the pre-existing fixtures as there was a bug fix enforcing it microsoft/playwright#32066
1 parent f0611f8 commit 0cbd6d8

File tree

5 files changed

+50
-38
lines changed

5 files changed

+50
-38
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1515,7 +1515,7 @@
15151515
"@mswjs/http-middleware": "^0.10.1",
15161516
"@octokit/rest": "^17.11.2",
15171517
"@parcel/watcher": "^2.1.0",
1518-
"@playwright/test": "=1.46.0",
1518+
"@playwright/test": "1.49.0",
15191519
"@redocly/cli": "^1.25.14",
15201520
"@statoscope/webpack-plugin": "^5.28.2",
15211521
"@storybook/addon-a11y": "^6.5.16",
@@ -1803,8 +1803,8 @@
18031803
"pirates": "^4.0.1",
18041804
"piscina": "^3.2.0",
18051805
"pixelmatch": "^5.3.0",
1806-
"playwright": "=1.46.0",
1807-
"playwright-chromium": "=1.46.0",
1806+
"playwright": "1.49.0",
1807+
"playwright-chromium": "1.49.0",
18081808
"pngjs": "^7.0.0",
18091809
"postcss": "^8.4.31",
18101810
"postcss-loader": "^4.2.0",

packages/kbn-scout/src/playwright/fixtures/test/page.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
import { Page, test as base } from '@playwright/test';
1111
import { subj } from '@kbn/test-subj-selector';
12-
import { ScoutPage, KibanaUrl } from '../types';
12+
import { ScoutPage, KibanaUrl, ScoutTestFixtures, ScoutWorkerFixtures } from '../types';
1313

1414
/**
1515
* Instead of defining each method individually, we use a list of method names and loop through them, creating methods dynamically.
@@ -95,17 +95,20 @@ function extendPageWithTestSubject(page: Page): ScoutPage['testSubj'] {
9595
* await page.gotoApp('discover);
9696
* ```
9797
*/
98-
export const scoutPageFixture = base.extend<{ page: ScoutPage; kbnUrl: KibanaUrl }>({
99-
page: async ({ page, kbnUrl }, use) => {
98+
export const scoutPageFixture = base.extend<ScoutTestFixtures, ScoutWorkerFixtures>({
99+
page: async (
100+
{ page, kbnUrl }: { page: Page; kbnUrl: KibanaUrl },
101+
use: (extendedPage: ScoutPage) => Promise<void>
102+
) => {
103+
const extendedPage = page as ScoutPage;
100104
// Extend page with '@kbn/test-subj-selector' support
101-
page.testSubj = extendPageWithTestSubject(page);
102-
105+
extendedPage.testSubj = extendPageWithTestSubject(page);
103106
// Method to navigate to specific Kibana apps
104-
page.gotoApp = (appName: string) => page.goto(kbnUrl.app(appName));
105-
106-
page.waitForLoadingIndicatorHidden = () =>
107-
page.testSubj.waitForSelector('globalLoadingIndicator-hidden', { state: 'attached' });
107+
extendedPage.gotoApp = (appName: string) => page.goto(kbnUrl.app(appName));
108+
// Method to wait for global loading indicator to be hidden
109+
extendedPage.waitForLoadingIndicatorHidden = () =>
110+
extendedPage.testSubj.waitForSelector('globalLoadingIndicator-hidden', { state: 'attached' });
108111

109-
await use(page);
112+
await use(extendedPage);
110113
},
111114
});

renovate.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@
144144
"nyc",
145145
"oboe",
146146
"pixelmatch",
147+
"@playwright/test",
147148
"playwright",
149+
"playwright-chromium",
148150
"pngjs",
149151
"sharp",
150152
"superagent",
@@ -1327,9 +1329,7 @@
13271329
{
13281330
"groupName": "Security Engineering Productivity",
13291331
"matchDepNames": [
1330-
"dotenv",
1331-
"playwright-chromium",
1332-
"@playwright/test"
1332+
"dotenv"
13331333
],
13341334
"reviewers": [
13351335
"team:security-engineering-productivity"

x-pack/plugins/discover_enhanced/ui_tests/fixtures/index.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,16 @@ export interface ExtendedScoutTestFixtures extends ScoutTestFixtures {
2121
}
2222

2323
export const test = base.extend<ExtendedScoutTestFixtures, ScoutWorkerFixtures>({
24-
pageObjects: async ({ pageObjects, page }, use) => {
24+
pageObjects: async (
25+
{
26+
pageObjects,
27+
page,
28+
}: {
29+
pageObjects: ExtendedScoutTestFixtures['pageObjects'];
30+
page: ExtendedScoutTestFixtures['page'];
31+
},
32+
use: (pageObjects: ExtendedScoutTestFixtures['pageObjects']) => Promise<void>
33+
) => {
2534
const extendedPageObjects = {
2635
...pageObjects,
2736
demo: createLazyPageObject(DemoPage, page),

yarn.lock

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8986,12 +8986,12 @@
89868986
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
89878987
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==
89888988

8989-
"@playwright/test@=1.46.0":
8990-
version "1.46.0"
8991-
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.46.0.tgz#ccea6d22c40ee7fa567e4192fafbdf2a907e2714"
8992-
integrity sha512-/QYft5VArOrGRP5pgkrfKksqsKA6CEFyGQ/gjNe6q0y4tZ1aaPfq4gIjudr1s3D+pXyrPRdsy4opKDrjBabE5w==
8989+
"@playwright/test@1.49.0":
8990+
version "1.49.0"
8991+
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.49.0.tgz#74227385b58317ee076b86b56d0e1e1b25cff01e"
8992+
integrity sha512-DMulbwQURa8rNIQrf94+jPJQ4FmOVdpE5ZppRNvWVjvhC+6sOeo28r8MgIpQRYouXRtt/FCCXU7zn20jnHR4Qw==
89938993
dependencies:
8994-
playwright "1.46.0"
8994+
playwright "1.49.0"
89958995

89968996
"@pmmmwh/react-refresh-webpack-plugin@^0.5.3":
89978997
version "0.5.7"
@@ -26212,36 +26212,36 @@ platform@^1.3.0:
2621226212
resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.5.tgz#fb6958c696e07e2918d2eeda0f0bc9448d733444"
2621326213
integrity sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q==
2621426214

26215+
26216+
version "1.49.0"
26217+
resolved "https://registry.yarnpkg.com/playwright-chromium/-/playwright-chromium-1.49.0.tgz#0661428204396dbf5445eb04536d43a5f91bca59"
26218+
integrity sha512-xU+nOHawNFKfJsHTTGyWqSJ5nRGGHQq1wTsc49H9rM+hDNnoKZi+3m12mGoLpqvJP7vRjZQ3uvU9/UJZbrJ1AA==
26219+
dependencies:
26220+
playwright-core "1.49.0"
26221+
2621526222
playwright-chromium@=1.45.1:
2621626223
version "1.45.1"
2621726224
resolved "https://registry.yarnpkg.com/playwright-chromium/-/playwright-chromium-1.45.1.tgz#a20b513edbc0435b2e06a303aac61001f44bf094"
2621826225
integrity sha512-BlYo+kuMg4Jo40Nems2GGVMWdKI2GeHL85D7pkwEW3aq6iEDW3XL7udmoNLOIfluSCKzVRJMB0ta1mt67B3tGA==
2621926226
dependencies:
2622026227
playwright-core "1.45.1"
2622126228

26222-
playwright-chromium@=1.46.0:
26223-
version "1.46.0"
26224-
resolved "https://registry.yarnpkg.com/playwright-chromium/-/playwright-chromium-1.46.0.tgz#f24228fec92b380ccc8f5f365b897e9d88b612f6"
26225-
integrity sha512-UTHYZsr49XFYRQkpCfaHxL63vfu6uThxR1DrNwnU6qik/OworFcugTOJMWFMoop3QP+ThU8laAMumauLdLZXCQ==
26226-
dependencies:
26227-
playwright-core "1.46.0"
26228-
2622926229
[email protected], playwright-core@=1.45.1:
2623026230
version "1.45.1"
2623126231
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.45.1.tgz#549a2701556b58245cc75263f9fc2795c1158dc1"
2623226232
integrity sha512-LF4CUUtrUu2TCpDw4mcrAIuYrEjVDfT1cHbJMfwnE2+1b8PZcFzPNgvZCvq2JfQ4aTjRCCHw5EJ2tmr2NSzdPg==
2623326233

26234-
playwright-core@1.46.0:
26235-
version "1.46.0"
26236-
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.46.0.tgz#2336ac453a943abf0dc95a76c117f9d3ebd390eb"
26237-
integrity sha512-9Y/d5UIwuJk8t3+lhmMSAJyNP1BUC/DqP3cQJDQQL/oWqAiuPTLgy7Q5dzglmTLwcBRdetzgNM/gni7ckfTr6A==
26234+
playwright-core@1.49.0:
26235+
version "1.49.0"
26236+
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.49.0.tgz#8e69ffed3f41855b854982f3632f2922c890afcb"
26237+
integrity sha512-R+3KKTQF3npy5GTiKH/T+kdhoJfJojjHESR1YEWhYuEKRVfVaxH3+4+GvXE5xyCngCxhxnykk0Vlah9v8fs3jA==
2623826238

26239-
playwright@1.46.0, playwright@=1.46.0:
26240-
version "1.46.0"
26241-
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.46.0.tgz#c7ff490deae41fc1e814bf2cb62109dd9351164d"
26242-
integrity sha512-XYJ5WvfefWONh1uPAUAi0H2xXV5S3vrtcnXe6uAOgdGi3aSpqOSXX08IAjXW34xitfuOJsvXU5anXZxPSEQiJw==
26239+
playwright@1.49.0:
26240+
version "1.49.0"
26241+
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.49.0.tgz#df6b9e05423377a99658202844a294a8afb95d0a"
26242+
integrity sha512-eKpmys0UFDnfNb3vfsf8Vx2LEOtflgRebl0Im2eQQnYMA4Aqd+Zw8bEOB+7ZKvN76901mRnqdsiOGKxzVTbi7A==
2624326243
dependencies:
26244-
playwright-core "1.46.0"
26244+
playwright-core "1.49.0"
2624526245
optionalDependencies:
2624626246
fsevents "2.3.2"
2624726247

0 commit comments

Comments
 (0)