Commit 086ef3da authored by isstuev's avatar isstuev

fix screensots memory error

parent abb849b8
import { test as base, expect } from '@playwright/experimental-ct-react';
import { test as base, devices, expect } from '@playwright/experimental-ct-react';
import React from 'react';
import { buildExternalAssetFilePath } from 'configs/app/utils';
......@@ -53,7 +53,7 @@ const testFn: Parameters<typeof test>[1] = async({ mount, page }) => {
await expect(component).toHaveScreenshot();
};
test('base view +@mobile +@dark-mode', testFn);
test('base view +@dark-mode', testFn);
const testWithFeaturedApp = test.extend({
context: contextWithEnvs([
......@@ -63,7 +63,7 @@ const testWithFeaturedApp = test.extend({
]) as any,
});
testWithFeaturedApp('with featured app +@mobile +@dark-mode', testFn);
testWithFeaturedApp('with featured app +@dark-mode', testFn);
const testWithBanner = test.extend({
context: contextWithEnvs([
......@@ -74,7 +74,7 @@ const testWithBanner = test.extend({
]) as any,
});
testWithBanner('with banner +@mobile +@dark-mode', testFn);
testWithBanner('with banner +@dark-mode', testFn);
const testWithScoreFeature = test.extend({
context: contextWithEnvs([
......@@ -85,7 +85,7 @@ const testWithScoreFeature = test.extend({
]) as any,
});
testWithScoreFeature('with scores +@mobile +@dark-mode', async({ mount, page }) => {
testWithScoreFeature('with scores +@dark-mode', async({ mount, page }) => {
await page.route(MARKETPLACE_CONFIG_URL, (route) => route.fulfill({
status: 200,
body: JSON.stringify(appsMock),
......@@ -115,3 +115,44 @@ testWithScoreFeature('with scores +@mobile +@dark-mode', async({ mount, page })
await expect(component).toHaveScreenshot();
});
// I had a memory error while running tests in GH actions
// separate run for mobile tests fixes it
test.describe('mobile', () => {
test.use({ viewport: devices['iPhone 13 Pro'].viewport });
test('base view', testFn);
testWithFeaturedApp('with featured app', testFn);
testWithBanner('with banner', testFn);
testWithScoreFeature('with scores', async({ mount, page }) => {
await page.route(MARKETPLACE_CONFIG_URL, (route) => route.fulfill({
status: 200,
body: JSON.stringify(appsMock),
}));
await page.route(MARKETPLACE_SECURITY_REPORTS_URL, (route) => route.fulfill({
status: 200,
body: JSON.stringify(securityReportsMock),
}));
await Promise.all(appsMock.map(app =>
page.route(app.logo, (route) =>
route.fulfill({
status: 200,
path: './playwright/mocks/image_s.jpg',
}),
),
));
const component = await mount(
<TestApp>
<Marketplace/>
</TestApp>,
);
await component.getByText('Apps scores').click();
await expect(component).toHaveScreenshot();
});
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment