Skip to content

Commit 37bf5a8

Browse files
committed
fixup! fixup! fixup! fixup! test: ci added
1 parent 4ad6aff commit 37bf5a8

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

.github/workflows/pr-playwright-report.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ jobs:
2727
AWS_SECRET_ACCESS_KEY: ${{ secrets.STORYBOOK_S3_SECRET_KEY }}
2828
AWS_DEFAULT_REGION: ru-central1
2929
AWS_EC2_METADATA_DISABLED: true
30-
run: aws s3 cp playwright-report s3://playwright-reports/page-constructor/pulls/${{ steps.pr.outputs.id }}/ --endpoint-url=https://storage.yandexcloud.net --recursive
30+
run: aws s3 cp playwright-report s3://playwright-reports/blog-constructor/pulls/${{ steps.pr.outputs.id }}/ --endpoint-url=https://storage.yandexcloud.net --recursive
3131
shell: bash
3232
- name: Create Comment
3333
uses: marocchino/sticky-pull-request-comment@v2
3434
with:
3535
GITHUB_TOKEN: ${{ secrets.GRAVITY_UI_BOT_GITHUB_TOKEN }}
3636
number: ${{ steps.pr.outputs.id }}
3737
header: playwright test
38-
message: '[Playwright Test Component](https://storage.yandexcloud.net/playwright-reports/page-constructor/pulls/${{ steps.pr.outputs.id }}/index.html) is ready.'
38+
message: '[Playwright Test Component](https://storage.yandexcloud.net/playwright-reports/blog-constructor/pulls/${{ steps.pr.outputs.id }}/index.html) is ready.'

playwright/core/expectScreenshotFixture.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import {expect} from '@playwright/experimental-ct-react';
2-
import type {JSHandle, Locator, PageScreenshotOptions} from '@playwright/test';
3-
import {isFunction} from 'lodash';
2+
import type {Locator, PageScreenshotOptions} from '@playwright/test';
43

54
import {DEFAULT_MOUNT_TEST_DELAY} from './constants';
65
import type {PlaywrightFixture} from './types';
76

87
interface CaptureScreenshotParams extends PageScreenshotOptions {
98
screenshotName?: string;
109
component?: Locator;
11-
waitingFunction?: JSHandle<boolean>;
1210
skipTheme?: 'light' | 'dark';
1311
}
1412

@@ -24,11 +22,10 @@ export const expectScreenshotFixture: PlaywrightFixture<ExpectScreenshotFixture>
2422
const expectScreenshot: ExpectScreenshotFixture = async ({
2523
component,
2624
screenshotName,
27-
waitingFunction,
2825
skipTheme,
2926
...pageScreenshotOptions
3027
} = {}) => {
31-
const captureScreenshot = async (waitingFunctionLocal?: JSHandle<boolean>) => {
28+
const captureScreenshot = async () => {
3229
const locators = await page.locator('//img').all();
3330
const promises = locators.map((locator) =>
3431
locator.evaluate(
@@ -39,10 +36,6 @@ export const expectScreenshotFixture: PlaywrightFixture<ExpectScreenshotFixture>
3936
);
4037
await Promise.all(promises);
4138

42-
if (waitingFunctionLocal && isFunction(waitingFunctionLocal)) {
43-
await waitingFunctionLocal();
44-
}
45-
4639
return (component || page.locator('.playwright-wrapper-test')).screenshot({
4740
animations: 'disabled',
4841
...pageScreenshotOptions,
@@ -52,7 +45,7 @@ export const expectScreenshotFixture: PlaywrightFixture<ExpectScreenshotFixture>
5245
const nameScreenshot = testInfo.titlePath.slice(1).join(' ');
5346

5447
if (skipTheme !== 'light') {
55-
expect(await captureScreenshot(waitingFunction)).toMatchSnapshot({
48+
expect(await captureScreenshot()).toMatchSnapshot({
5649
name: `${screenshotName || nameScreenshot} light.png`,
5750
});
5851
}
@@ -62,7 +55,7 @@ export const expectScreenshotFixture: PlaywrightFixture<ExpectScreenshotFixture>
6255

6356
await page.waitForTimeout(DEFAULT_MOUNT_TEST_DELAY);
6457

65-
expect(await captureScreenshot(waitingFunction)).toMatchSnapshot({
58+
expect(await captureScreenshot()).toMatchSnapshot({
6659
name: `${screenshotName || nameScreenshot} dark.png`,
6760
});
6861
}

scripts/playwright-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -euo pipefail
55
IMAGE_NAME="mcr.microsoft.com/playwright"
66
IMAGE_TAG="v1.45.3-jammy" # This version have to be synchronized with playwright version from package.json
77

8-
NODE_MODULES_CACHE_DIR="$HOME/.cache/page-constructor-playwright-docker-node-modules"
8+
NODE_MODULES_CACHE_DIR="$HOME/.cache/blog-constructor-playwright-docker-node-modules"
99

1010
command_exists() {
1111
command -v "$1" >/dev/null 2>&1

0 commit comments

Comments
 (0)