Skip to content

Commit

Permalink
[chore] update playwright version + ownership (elastic#202535)
Browse files Browse the repository at this point in the history
## 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
  • Loading branch information
dmlemeshko authored and CAWilson94 committed Dec 9, 2024
1 parent 50717d8 commit 68d650c
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 38 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@
"@mswjs/http-middleware": "^0.10.1",
"@octokit/rest": "^17.11.2",
"@parcel/watcher": "^2.1.0",
"@playwright/test": "=1.46.0",
"@playwright/test": "1.49.0",
"@redocly/cli": "^1.25.14",
"@statoscope/webpack-plugin": "^5.28.2",
"@storybook/addon-a11y": "^6.5.16",
Expand Down Expand Up @@ -1803,8 +1803,8 @@
"pirates": "^4.0.1",
"piscina": "^3.2.0",
"pixelmatch": "^5.3.0",
"playwright": "=1.46.0",
"playwright-chromium": "=1.46.0",
"playwright": "1.49.0",
"playwright-chromium": "1.49.0",
"pngjs": "^7.0.0",
"postcss": "^8.4.31",
"postcss-loader": "^4.2.0",
Expand Down
23 changes: 13 additions & 10 deletions packages/kbn-scout/src/playwright/fixtures/test/page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

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

/**
* Instead of defining each method individually, we use a list of method names and loop through them, creating methods dynamically.
Expand Down Expand Up @@ -95,17 +95,20 @@ function extendPageWithTestSubject(page: Page): ScoutPage['testSubj'] {
* await page.gotoApp('discover);
* ```
*/
export const scoutPageFixture = base.extend<{ page: ScoutPage; kbnUrl: KibanaUrl }>({
page: async ({ page, kbnUrl }, use) => {
export const scoutPageFixture = base.extend<ScoutTestFixtures, ScoutWorkerFixtures>({
page: async (
{ page, kbnUrl }: { page: Page; kbnUrl: KibanaUrl },
use: (extendedPage: ScoutPage) => Promise<void>
) => {
const extendedPage = page as ScoutPage;
// Extend page with '@kbn/test-subj-selector' support
page.testSubj = extendPageWithTestSubject(page);

extendedPage.testSubj = extendPageWithTestSubject(page);
// Method to navigate to specific Kibana apps
page.gotoApp = (appName: string) => page.goto(kbnUrl.app(appName));

page.waitForLoadingIndicatorHidden = () =>
page.testSubj.waitForSelector('globalLoadingIndicator-hidden', { state: 'attached' });
extendedPage.gotoApp = (appName: string) => page.goto(kbnUrl.app(appName));
// Method to wait for global loading indicator to be hidden
extendedPage.waitForLoadingIndicatorHidden = () =>
extendedPage.testSubj.waitForSelector('globalLoadingIndicator-hidden', { state: 'attached' });

await use(page);
await use(extendedPage);
},
});
6 changes: 3 additions & 3 deletions renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,9 @@
"nyc",
"oboe",
"pixelmatch",
"@playwright/test",
"playwright",
"playwright-chromium",
"pngjs",
"sharp",
"superagent",
Expand Down Expand Up @@ -1327,9 +1329,7 @@
{
"groupName": "Security Engineering Productivity",
"matchDepNames": [
"dotenv",
"playwright-chromium",
"@playwright/test"
"dotenv"
],
"reviewers": [
"team:security-engineering-productivity"
Expand Down
11 changes: 10 additions & 1 deletion x-pack/plugins/discover_enhanced/ui_tests/fixtures/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@ export interface ExtendedScoutTestFixtures extends ScoutTestFixtures {
}

export const test = base.extend<ExtendedScoutTestFixtures, ScoutWorkerFixtures>({
pageObjects: async ({ pageObjects, page }, use) => {
pageObjects: async (
{
pageObjects,
page,
}: {
pageObjects: ExtendedScoutTestFixtures['pageObjects'];
page: ExtendedScoutTestFixtures['page'];
},
use: (pageObjects: ExtendedScoutTestFixtures['pageObjects']) => Promise<void>
) => {
const extendedPageObjects = {
...pageObjects,
demo: createLazyPageObject(DemoPage, page),
Expand Down
42 changes: 21 additions & 21 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8986,12 +8986,12 @@
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==

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

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

[email protected]:
version "1.49.0"
resolved "https://registry.yarnpkg.com/playwright-chromium/-/playwright-chromium-1.49.0.tgz#0661428204396dbf5445eb04536d43a5f91bca59"
integrity sha512-xU+nOHawNFKfJsHTTGyWqSJ5nRGGHQq1wTsc49H9rM+hDNnoKZi+3m12mGoLpqvJP7vRjZQ3uvU9/UJZbrJ1AA==
dependencies:
playwright-core "1.49.0"

playwright-chromium@=1.45.1:
version "1.45.1"
resolved "https://registry.yarnpkg.com/playwright-chromium/-/playwright-chromium-1.45.1.tgz#a20b513edbc0435b2e06a303aac61001f44bf094"
integrity sha512-BlYo+kuMg4Jo40Nems2GGVMWdKI2GeHL85D7pkwEW3aq6iEDW3XL7udmoNLOIfluSCKzVRJMB0ta1mt67B3tGA==
dependencies:
playwright-core "1.45.1"

playwright-chromium@=1.46.0:
version "1.46.0"
resolved "https://registry.yarnpkg.com/playwright-chromium/-/playwright-chromium-1.46.0.tgz#f24228fec92b380ccc8f5f365b897e9d88b612f6"
integrity sha512-UTHYZsr49XFYRQkpCfaHxL63vfu6uThxR1DrNwnU6qik/OworFcugTOJMWFMoop3QP+ThU8laAMumauLdLZXCQ==
dependencies:
playwright-core "1.46.0"

[email protected], playwright-core@=1.45.1:
version "1.45.1"
resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.45.1.tgz#549a2701556b58245cc75263f9fc2795c1158dc1"
integrity sha512-LF4CUUtrUu2TCpDw4mcrAIuYrEjVDfT1cHbJMfwnE2+1b8PZcFzPNgvZCvq2JfQ4aTjRCCHw5EJ2tmr2NSzdPg==

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

playwright@1.46.0, playwright@=1.46.0:
version "1.46.0"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.46.0.tgz#c7ff490deae41fc1e814bf2cb62109dd9351164d"
integrity sha512-XYJ5WvfefWONh1uPAUAi0H2xXV5S3vrtcnXe6uAOgdGi3aSpqOSXX08IAjXW34xitfuOJsvXU5anXZxPSEQiJw==
playwright@1.49.0:
version "1.49.0"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.49.0.tgz#df6b9e05423377a99658202844a294a8afb95d0a"
integrity sha512-eKpmys0UFDnfNb3vfsf8Vx2LEOtflgRebl0Im2eQQnYMA4Aqd+Zw8bEOB+7ZKvN76901mRnqdsiOGKxzVTbi7A==
dependencies:
playwright-core "1.46.0"
playwright-core "1.49.0"
optionalDependencies:
fsevents "2.3.2"

Expand Down

0 comments on commit 68d650c

Please sign in to comment.