Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test/adjust false positives visual tests #4304

Merged
merged 11 commits into from
Mar 25, 2024
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { test, expect } from "@playwright/experimental-ct-react";
import AirportIllustration from "./AirportIllustration.ct-story";

test.describe("visual AirportIllustration", () => {
test(`AirportIllustration`, async ({ mount }) => {
test(`AirportIllustration`, async ({ mount, page }) => {
const component = await mount(<AirportIllustration />);
page.waitForRequest(/images.kiwi.com/);

await expect(component).toHaveScreenshot();
});
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { test, expect } from "@playwright/experimental-ct-react";
import ButtonMobileStoreStory from "./ButtonMobileStore.ct-story";

test.describe("visual ButtonMobileStoreStory", () => {
test("ButtonMobileStoreStory", async ({ mount }) => {
test("ButtonMobileStoreStory", async ({ mount, page }) => {
const component = await mount(<ButtonMobileStoreStory />);
page.waitForRequest(/images.kiwi.com/);

await expect(component).toHaveScreenshot();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,20 @@ import CallOutBannerStory from "./CallOutBanner.ct-story";
import RenderInRtl from "../utils/rtl/RenderInRtl";

test.describe("visual CallOutBanner", () => {
test("default", async ({ mount }) => {
test("default", async ({ mount, page }) => {
const component = await mount(<CallOutBannerStory />);
page.waitForRequest(/images.kiwi.com/);

await expect(component).toHaveScreenshot();
});

test("rtl", async ({ mount }) => {
test("rtl", async ({ mount, page }) => {
const component = await mount(
<RenderInRtl>
<CallOutBannerStory />
</RenderInRtl>,
);
page.waitForRequest(/images.kiwi.com/);

await expect(component).toHaveScreenshot();
});
Expand Down
3 changes: 2 additions & 1 deletion packages/orbit-components/src/CarrierLogo/CarrierLogo.ct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { test, expect } from "@playwright/experimental-ct-react";
import CarrierLogoStory from "./CarrierLogo.ct-story";

test.describe("visual CarrierLogo", () => {
test("CarrierLogo", async ({ mount }) => {
test("CarrierLogo", async ({ mount, page }) => {
const component = await mount(<CarrierLogoStory />);
page.waitForRequest(/images.kiwi.com/);

await expect(component).toHaveScreenshot();
});
Expand Down
3 changes: 2 additions & 1 deletion packages/orbit-components/src/FeatureIcon/FeatureIcon.ct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { test, expect } from "@playwright/experimental-ct-react";
import FeatureIconStory from "./FeatureIcon.ct-story";

test.describe("visual FeatureIcon", () => {
test("FeatureIcon", async ({ mount }) => {
test("FeatureIcon", async ({ mount, page }) => {
const component = await mount(<FeatureIconStory />);
page.waitForRequest(/images.kiwi.com/);

await expect(component).toHaveScreenshot();
});
Expand Down
10 changes: 9 additions & 1 deletion packages/orbit-components/src/Illustration/Illustration.ct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export const NAMES: Name[] = [
"CompassSaveOnBooking",
"CompassTravelPlan",
"Damage",
"DepartureBoard",
"DepartureBoardBadge",
"DepartureBoardLounge",
"DesktopSearch",
"EnjoyApp",
"Error",
Expand Down Expand Up @@ -102,29 +105,34 @@ export const NAMES: Name[] = [

test.describe("visual Illustration", () => {
NAMES.map(name =>
test(`Illustration ${name}`, async ({ mount }, info) => {
test(`Illustration ${name}`, async ({ mount, page }, info) => {
if (info.project.name === "Small Mobile") {
const component = await mount(<IllustrationStory name={name} size="extraSmall" />);
page.waitForRequest(/images.kiwi.com/);
await expect(component).toHaveScreenshot();
}

if (info.project.name === "Medium Mobile" || info.project.name === "Large Mobile") {
const component = await mount(<IllustrationStory name={name} size="small" />);
page.waitForRequest(/images.kiwi.com/);
await expect(component).toHaveScreenshot();
}

if (info.project.name === "Tablet") {
const component = await mount(<IllustrationStory name={name} size="medium" />);
page.waitForRequest(/images.kiwi.com/);
await expect(component).toHaveScreenshot();
}

if (info.project.name === "Desktop") {
const component = await mount(<IllustrationStory name={name} size="large" />);
page.waitForRequest(/images.kiwi.com/);
await expect(component).toHaveScreenshot();
}

if (info.project.name === "Large Desktop") {
const component = await mount(<IllustrationStory name={name} size="display" />);
page.waitForRequest(/images.kiwi.com/);
await expect(component).toHaveScreenshot();
}
}),
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 6 additions & 3 deletions packages/orbit-components/src/Modal/Modal.ct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,24 @@ import { SIZES } from "./consts";

test.describe("visual Modal", () => {
Object.values(SIZES).forEach(size => {
test(`ModalVisualDefaultStory ${size}`, async ({ mount }) => {
test(`ModalVisualDefaultStory ${size}`, async ({ mount, page }) => {
const component = await mount(<ModalVisualDefaultStory size={size} />);
page.waitForResponse(/images.kiwi.com/);

await expect(component).toHaveScreenshot();
});
});

test(`ModalVisualDefaultStory isMobileFullPage`, async ({ mount }) => {
test(`ModalVisualDefaultStory isMobileFullPage`, async ({ mount, page }) => {
const component = await mount(<ModalVisualDefaultStory isMobileFullPage />);
page.waitForResponse(/images.kiwi.com/);

await expect(component).toHaveScreenshot();
});

test("ModalVisualMobileHeader", async ({ mount }) => {
test("ModalVisualMobileHeader", async ({ mount, page }) => {
const component = await mount(<ModalVisualMobileHeader />);
page.waitForResponse(/images.kiwi.com/);

await expect(component).toHaveScreenshot();
});
Expand Down
3 changes: 2 additions & 1 deletion packages/orbit-components/src/ServiceLogo/ServiceLogo.ct.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import { test, expect } from "@playwright/experimental-ct-react";
import ServiceLogoStory from "./ServiceLogo.ct-story";

test.describe("visual ServiceLogo", () => {
test("default", async ({ mount }) => {
test("default", async ({ mount, page }) => {
const component = await mount(<ServiceLogoStory />);
page.waitForRequest(/images.kiwi.com/);

await expect(component).toHaveScreenshot();
});
Expand Down
Loading