diff --git a/package.json b/package.json index f6c3330adad25..eb82728877813 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/packages/kbn-scout/src/playwright/fixtures/test/page.ts b/packages/kbn-scout/src/playwright/fixtures/test/page.ts index b41b8a92f2701..4cab61e4ffec5 100644 --- a/packages/kbn-scout/src/playwright/fixtures/test/page.ts +++ b/packages/kbn-scout/src/playwright/fixtures/test/page.ts @@ -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. @@ -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({ + page: async ( + { page, kbnUrl }: { page: Page; kbnUrl: KibanaUrl }, + use: (extendedPage: ScoutPage) => Promise + ) => { + 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); }, }); diff --git a/renovate.json b/renovate.json index c9ccd3969e3d6..b010d5465dc33 100644 --- a/renovate.json +++ b/renovate.json @@ -144,7 +144,9 @@ "nyc", "oboe", "pixelmatch", + "@playwright/test", "playwright", + "playwright-chromium", "pngjs", "sharp", "superagent", @@ -1327,9 +1329,7 @@ { "groupName": "Security Engineering Productivity", "matchDepNames": [ - "dotenv", - "playwright-chromium", - "@playwright/test" + "dotenv" ], "reviewers": [ "team:security-engineering-productivity" diff --git a/x-pack/plugins/discover_enhanced/ui_tests/fixtures/index.ts b/x-pack/plugins/discover_enhanced/ui_tests/fixtures/index.ts index 4cff802b3b89f..cf12a98368b90 100644 --- a/x-pack/plugins/discover_enhanced/ui_tests/fixtures/index.ts +++ b/x-pack/plugins/discover_enhanced/ui_tests/fixtures/index.ts @@ -21,7 +21,16 @@ export interface ExtendedScoutTestFixtures extends ScoutTestFixtures { } export const test = base.extend({ - pageObjects: async ({ pageObjects, page }, use) => { + pageObjects: async ( + { + pageObjects, + page, + }: { + pageObjects: ExtendedScoutTestFixtures['pageObjects']; + page: ExtendedScoutTestFixtures['page']; + }, + use: (pageObjects: ExtendedScoutTestFixtures['pageObjects']) => Promise + ) => { const extendedPageObjects = { ...pageObjects, demo: createLazyPageObject(DemoPage, page), diff --git a/yarn.lock b/yarn.lock index 90429bc21f489..70875c1d31374 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -26212,6 +26212,13 @@ platform@^1.3.0: resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.5.tgz#fb6958c696e07e2918d2eeda0f0bc9448d733444" integrity sha512-TuvHS8AOIZNAlE77WUDiR4rySV/VMptyMfcfeoMgs4P8apaZM3JrnbzBiixKUv+XR6i+BXrQh8WAnjaSPFO65Q== +playwright-chromium@1.49.0: + 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" @@ -26219,29 +26226,22 @@ playwright-chromium@=1.45.1: 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" - playwright-core@1.45.1, 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"