Skip to content

Commit

Permalink
Merge pull request #2330 from epam/e2e/increase_tomeout_for_some_tests
Browse files Browse the repository at this point in the history
Increase expect timeout for slow tests
  • Loading branch information
siarheiyelin authored Jun 6, 2024
2 parents 13989f0 + e94c992 commit 6dd9872
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 28 deletions.
2 changes: 1 addition & 1 deletion uui-e2e-tests/e2e.Dockerfile
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 2 additions & 0 deletions uui-e2e-tests/framework/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export type TMatrixMinimal<PreviewIdArr extends TObjValues<TPreviewIdByComponent
onlyChromium?: true;
// Chromium-only property
forcePseudoState?: { state: 'hover', selector: string };
// increases the default "expect" timeout
slow?: true;
};

export type TMatrixFull<PreviewIdArr extends TObjValues<TPreviewIdByComponentId> = TObjValues<TPreviewIdByComponentId>> = TMatrixMinimal<PreviewIdArr> & {
Expand Down
2 changes: 1 addition & 1 deletion uui-e2e-tests/framework/utils/testBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } : {}) });
}
});
});
Expand Down
2 changes: 1 addition & 1 deletion uui-e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion uui-e2e-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 : 20000;
export const timeoutForFixture = isCi ? 20000 : 50000;
const maxFailures = isCi ? 10 : undefined;
const retries = isCi ? 1 : 0;
Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions uui-e2e-tests/tests/screenshot.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 });
Expand Down
37 changes: 15 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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==
Expand Down Expand Up @@ -2990,12 +2983,12 @@
resolved "https://registry.yarnpkg.com/@pkgjs/parseargs/-/parseargs-0.11.0.tgz#a77ea742fab25775145434eb1d2328cf5013ac33"
integrity sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==

"@playwright/[email protected].0":
version "1.44.0"
resolved "https://registry.yarnpkg.com/@playwright/test/-/test-1.44.0.tgz#ac7a764b5ee6a80558bdc0fcbc525fcb81f83465"
integrity sha512-rNX5lbNidamSUorBhB4XZ9SQTjAqfe5M+p37Z8ic0jPFBMo5iCtQz1kRWkEMg+rYOKSlVycpQmpqjSFq7LXOfg==
"@playwright/[email protected].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"
Expand Down Expand Up @@ -13498,17 +13491,17 @@ platform@^1.3.3:
resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.6.tgz#48b4ce983164b209c2d45a107adb31f473a6e7a7"
integrity sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==

[email protected].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==
[email protected].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==

[email protected].0:
version "1.44.0"
resolved "https://registry.yarnpkg.com/playwright/-/playwright-1.44.0.tgz#22894e9b69087f6beb639249323d80fe2b5087ff"
integrity sha512-F9b3GUCLQ3Nffrfb6dunPOkE5Mh68tR7zN32L4jCk4FjQamgesGay7/dAAe1WaMEGV04DkdJfcJzjoCKygUaRQ==
[email protected].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"

Expand Down

0 comments on commit 6dd9872

Please sign in to comment.