From 32f600788c9b29bf97340ffda3a6f260acb22173 Mon Sep 17 00:00:00 2001 From: Siarhei Yelin Date: Thu, 6 Jun 2024 14:30:31 +0300 Subject: [PATCH 1/3] Increase expect timeout for slow tests --- uui-e2e-tests/e2e.Dockerfile | 2 +- uui-e2e-tests/framework/types.ts | 2 ++ uui-e2e-tests/framework/utils/testBuilder.ts | 2 +- uui-e2e-tests/package.json | 2 +- uui-e2e-tests/playwright.config.ts | 1 + uui-e2e-tests/tests/screenshot.e2e.ts | 4 +-- yarn.lock | 37 ++++++++------------ 7 files changed, 23 insertions(+), 27 deletions(-) diff --git a/uui-e2e-tests/e2e.Dockerfile b/uui-e2e-tests/e2e.Dockerfile index ddbb422419..6b27969a30 100644 --- a/uui-e2e-tests/e2e.Dockerfile +++ b/uui-e2e-tests/e2e.Dockerfile @@ -1,5 +1,5 @@ # The version of the base image must be in sync with the version of "@playwright/test" NPM package -FROM mcr.microsoft.com/playwright:v1.44.0-jammy +FROM mcr.microsoft.com/playwright:v1.44.1-jammy WORKDIR /app diff --git a/uui-e2e-tests/framework/types.ts b/uui-e2e-tests/framework/types.ts index 6adee6c7cb..8f37214863 100644 --- a/uui-e2e-tests/framework/types.ts +++ b/uui-e2e-tests/framework/types.ts @@ -35,6 +35,8 @@ export type TMatrixMinimal = TObjValues> = TMatrixMinimal & { diff --git a/uui-e2e-tests/framework/utils/testBuilder.ts b/uui-e2e-tests/framework/utils/testBuilder.ts index 824bddf95d..2b4dd7d3e2 100644 --- a/uui-e2e-tests/framework/utils/testBuilder.ts +++ b/uui-e2e-tests/framework/utils/testBuilder.ts @@ -86,7 +86,7 @@ function createTestsForSingleComponentId(builderParams: { componentId: TComponen } async function assert() { const opts = await previewPage.getScreenshotOptions(); - await expect(previewPage.page).toHaveScreenshot(screenshotName, { ...opts }); + await expect(previewPage.page).toHaveScreenshot(screenshotName, { ...opts, ...(matrix.slow ? { timeout: 15000 } : {}) }); } }); }); diff --git a/uui-e2e-tests/package.json b/uui-e2e-tests/package.json index cdb5cd4df9..350d4054f7 100644 --- a/uui-e2e-tests/package.json +++ b/uui-e2e-tests/package.json @@ -21,7 +21,7 @@ "print-error": "ts-node scripts/cmd/cmdPrintError.ts" }, "dependencies": { - "@playwright/test": "1.44.0", + "@playwright/test": "1.44.1", "typescript": "4.9.3", "ts-node": "10.9.1", "cross-spawn": "7.0.3", diff --git a/uui-e2e-tests/playwright.config.ts b/uui-e2e-tests/playwright.config.ts index 8b623d175a..3b4aaaa7f6 100644 --- a/uui-e2e-tests/playwright.config.ts +++ b/uui-e2e-tests/playwright.config.ts @@ -35,6 +35,7 @@ const snapshotPathTemplate = '{testFileDir}/__screenshots__/{platform}/{projectN export const stylePath = `${parentDir}framework/fixtures/screenshot.css`; export default defineConfig({ + globalTimeout: 3_600_000, // = 1 hour (it should be sufficient to run all our tests) timeout, maxFailures, testMatch, diff --git a/uui-e2e-tests/tests/screenshot.e2e.ts b/uui-e2e-tests/tests/screenshot.e2e.ts index cafaa30082..d63a28f115 100644 --- a/uui-e2e-tests/tests/screenshot.e2e.ts +++ b/uui-e2e-tests/tests/screenshot.e2e.ts @@ -39,7 +39,7 @@ const { values } = Object; const builder = new TestBuilder(); // Skins tested: all builder - .add(tag, { previewId: values(TTagPreview), skins: SKINS.promo_loveship_electric }); + .add(tag, { previewId: values(TTagPreview), skins: SKINS.promo_loveship_electric, slow: true }); // Skins tested: all except "Electric" builder @@ -50,7 +50,7 @@ builder .add(dropdownContainer, { previewId: values(TDropdownContainerPreview), skins: SKINS.promo_loveship }) .add(iconButton, { previewId: values(TIconButtonPreview), skins: SKINS.promo_loveship }) .add(linkButton, { previewId: values(TLinkButtonPreview), skins: SKINS.promo_loveship }) - .add(text, { previewId: values(TTextPreview), skins: SKINS.promo_loveship }) + .add(text, { previewId: values(TTextPreview), skins: SKINS.promo_loveship, slow: true }) .add(notificationCard, { previewId: values(TNotificationCardPreview), skins: SKINS.promo_loveship }) .add(tooltip, { previewId: values(TTooltipPreview), skins: SKINS.promo_loveship }) .add(multiSwitch, { previewId: values(TMultiSwitchPreview), skins: SKINS.promo_loveship }); diff --git a/yarn.lock b/yarn.lock index c7c7127fcf..b880178863 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1192,14 +1192,7 @@ resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== -"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.16.3", "@babel/runtime@^7.2.0", "@babel/runtime@^7.20.13", "@babel/runtime@^7.23.2", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": - version "7.24.4" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.4.tgz#de795accd698007a66ba44add6cc86542aff1edd" - integrity sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA== - dependencies: - regenerator-runtime "^0.14.0" - -"@babel/runtime@^7.23.9": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.1.2", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.13", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.16.3", "@babel/runtime@^7.2.0", "@babel/runtime@^7.20.13", "@babel/runtime@^7.23.2", "@babel/runtime@^7.23.9", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": version "7.24.4" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.24.4.tgz#de795accd698007a66ba44add6cc86542aff1edd" integrity sha512-dkxf7+hn8mFBwKjs9bvBlArzLVxVbS8usaPUDd5p2a9JCL9tB8OaOVN1isD4+Xyk4ns89/xeOmbQvgdK7IIVdA== @@ -2990,12 +2983,12 @@ resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33" integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg== -"@playwright/test@1.44.0": - version "1.44.0" - resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.44.0.tgz#ac7a764b5ee6a80558bdc0fcbc525fcb81f83465" - integrity sha512-rNX5lbNidamSUorBhB4XZ9SQTjAqfe5M+p37Z8ic0jPFBMo5iCtQz1kRWkEMg+rYOKSlVycpQmpqjSFq7LXOfg== +"@playwright/test@1.44.1": + version "1.44.1" + resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.44.1.tgz#cc874ec31342479ad99838040e99b5f604299bcb" + integrity sha512-1hZ4TNvD5z9VuhNJ/walIjvMVvYkZKf71axoF/uiAqpntQJXpG64dlXhoDXE3OczPuTuvjf/M5KWFg5VAVUS3Q== dependencies: - playwright "1.44.0" + playwright "1.44.1" "@pmmmwh/react-refresh-webpack-plugin@^0.5.3": version "0.5.11" @@ -13498,17 +13491,17 @@ platform@^1.3.3: resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7" integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg== -playwright-core@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.44.0.tgz#316c4f0bca0551ffb88b6eb1c97bc0d2d861b0d5" - integrity sha512-ZTbkNpFfYcGWohvTTl+xewITm7EOuqIqex0c7dNZ+aXsbrLj0qI8XlGKfPpipjm0Wny/4Lt4CJsWJk1stVS5qQ== +playwright-core@1.44.1: + version "1.44.1" + resolved "https://registry.yarnpkg.com/playwright-core/-/playwright-core-1.44.1.tgz#53ec975503b763af6fc1a7aa995f34bc09ff447c" + integrity sha512-wh0JWtYTrhv1+OSsLPgFzGzt67Y7BE/ZS3jEqgGBlp2ppp1ZDj8c+9IARNW4dwf1poq5MgHreEM2KV/GuR4cFA== -playwright@1.44.0: - version "1.44.0" - resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.44.0.tgz#22894e9b69087f6beb639249323d80fe2b5087ff" - integrity sha512-F9b3GUCLQ3Nffrfb6dunPOkE5Mh68tR7zN32L4jCk4FjQamgesGay7/dAAe1WaMEGV04DkdJfcJzjoCKygUaRQ== +playwright@1.44.1: + version "1.44.1" + resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.44.1.tgz#5634369d777111c1eea9180430b7a184028e7892" + integrity sha512-qr/0UJ5CFAtloI3avF95Y0L1xQo6r3LQArLIg/z/PoGJ6xa+EwzrwO5lpNr/09STxdHuUoP2mvuELJS+hLdtgg== dependencies: - playwright-core "1.44.0" + playwright-core "1.44.1" optionalDependencies: fsevents "2.3.2" From 61143b61dadeacbd5e948fae6082acf672069c3e Mon Sep 17 00:00:00 2001 From: Siarhei Yelin Date: Thu, 6 Jun 2024 14:41:20 +0300 Subject: [PATCH 2/3] Increase expect timeout for slow tests --- uui-e2e-tests/playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uui-e2e-tests/playwright.config.ts b/uui-e2e-tests/playwright.config.ts index 3b4aaaa7f6..197eb78750 100644 --- a/uui-e2e-tests/playwright.config.ts +++ b/uui-e2e-tests/playwright.config.ts @@ -7,7 +7,7 @@ import { readUuiSpecificEnvVariables } from './scripts/envParamUtils'; const { isCi, isDocker, UUI_TEST_PARAM_PROJECT } = readUuiSpecificEnvVariables(); const { UUI_APP_BASE_URL, UUI_APP_BASE_URL_CI } = readEnvFile(); -const timeout = isCi ? 10000 : 10000; +const timeout = isCi ? 10000 : 15000; export const timeoutForFixture = isCi ? 20000 : 50000; const maxFailures = isCi ? 10 : undefined; const retries = isCi ? 1 : 0; From e94c99266d65c57e0ed9fbbad934f28bfa6e0012 Mon Sep 17 00:00:00 2001 From: Siarhei Yelin Date: Thu, 6 Jun 2024 14:48:18 +0300 Subject: [PATCH 3/3] Increase expect timeout for slow tests --- uui-e2e-tests/playwright.config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uui-e2e-tests/playwright.config.ts b/uui-e2e-tests/playwright.config.ts index 197eb78750..c4e3f91059 100644 --- a/uui-e2e-tests/playwright.config.ts +++ b/uui-e2e-tests/playwright.config.ts @@ -7,7 +7,7 @@ import { readUuiSpecificEnvVariables } from './scripts/envParamUtils'; const { isCi, isDocker, UUI_TEST_PARAM_PROJECT } = readUuiSpecificEnvVariables(); const { UUI_APP_BASE_URL, UUI_APP_BASE_URL_CI } = readEnvFile(); -const timeout = isCi ? 10000 : 15000; +const timeout = isCi ? 10000 : 20000; export const timeoutForFixture = isCi ? 20000 : 50000; const maxFailures = isCi ? 10 : undefined; const retries = isCi ? 1 : 0;