Skip to content

Commit

Permalink
chore: remove caso-morte
Browse files Browse the repository at this point in the history
  • Loading branch information
Giulia Ye committed Oct 30, 2024
1 parent e457a13 commit 1296c27
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 288 deletions.
48 changes: 48 additions & 0 deletions e2e/autofill.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { test } from "./fixtures";
import YourOfferPage from "../src/lib/pages/life/yourOfferPage";
import HealthStatusPage from "../src/lib/pages/life/healthStatusPage";
import BeneficiariesPage from "../src/lib/pages/life/beneficiariesPage";
import PersonalDataPage from "../src/lib/pages/life/personalDataPage";
import CheckoutPage from "../src/lib/pages/life/checkoutPage";

test.describe("Autofill", () => {
test(`in /vita path, when user goes to the next page, should still render path box`, async ({
page,
context,
extensionId,
}) => {
const extensionPage = await context.newPage();
await page.goto(`https://calc-dev.vitesicure.it/vita/preventivatore`);

await page.waitForLoadState("networkidle");

await extensionPage.goto(
`chrome-extension://${extensionId}/src/entries/popup/index.html`,
);

await page.waitForTimeout(1000);
await extensionPage.getByText("Autofill and go to next page").dblclick();

await page.bringToFront();
await page.waitForURL(`**/${YourOfferPage.path}**`);

await page.waitForTimeout(1000);
await extensionPage.getByText("Autofill and go to next page").dblclick();
await page.waitForURL(`**/${HealthStatusPage.path}`);

await page.waitForTimeout(1000);
await extensionPage.getByText("Autofill and go to next page").dblclick();
await page.waitForURL(`**/${BeneficiariesPage.path}`, { timeout: 50000 });

await page.waitForTimeout(1000);
await extensionPage.getByText("Autofill and go to next page").dblclick();
await page.waitForURL(`**/${PersonalDataPage.path}`);

await page.waitForTimeout(1000);
await extensionPage.getByText("Autofill and go to next page").dblclick();
await page.waitForURL(`**/${CheckoutPage.path}`);
await page.waitForTimeout(1000);
await extensionPage.getByText("Autofill and go to next page").dblclick();
await page.waitForURL(`**/grazie**`, { timeout: 30000 });
});
});
13 changes: 2 additions & 11 deletions e2e/path-box.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { type Page } from "@playwright/test";
import { test, expect } from "./fixtures";

test.describe("PathBox", () => {
const paths = ["vita", "caso-morte", "infortuni"];
const paths = ["vita", "infortuni"];

for (const path of paths) {
test(`in /${path} path, should render path box`, async ({ page }) => {
Expand All @@ -21,11 +21,7 @@ test.describe("PathBox", () => {
context,
extensionId,
}) => {
await page.goto(
`https://calc-dev.vitesicure.it/${
path === "caso-morte" ? "caso-morte?no-redirect=true" : path
}`,
);
await page.goto(`https://calc-dev.vitesicure.it/${path}`);

await page.waitForLoadState("networkidle");

Expand All @@ -50,11 +46,6 @@ async function fillAndGoToNextPage(page: Page, path: string) {
await page.click("input[name='privacyPolicyAccepted']");
await page.click("button[data-testid='calculate-offer-button']");
break;
case "caso-morte":
await page.fill("input[name='customerInfo.birthDate']", "26/03/1997");
await page.click("input[name='agreements.privacyPolicy']");
await page.click("button[data-testid='calculate-quote-button']");
break;
case "infortuni":
await page.click("div[data-testid='injury-select-me']");
const continueButton = page.locator("button", {
Expand Down
5 changes: 0 additions & 5 deletions src/lib/components/PathBox.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@
border-color: #d2527f;
color: #d2527f;
}
.caso-morte {
background: rgba(39, 174, 96, 0.1);
border-color: #27ae60;
color: #27ae60;
}
.infortuni {
background: rgba(34, 167, 240, 0.1);
border-color: #22a7f0;
Expand Down
6 changes: 1 addition & 5 deletions src/lib/components/PathBox.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,9 @@ describe("PathBox", () => {

test.each([
{
currentPath: Product.NetLife,
currentPath: Product.Life,
style: "background: rgb(252 165 165); color: rgb(185 28 28);",
},
{
currentPath: Product.SquareLife,
style: "background: rgb(134 239 172); color: rgb(21 128 61);",
},
{
currentPath: Product.Injury,
style: "background: rgb(147 197 253); color: rgb(29 78 216);",
Expand Down
23 changes: 0 additions & 23 deletions src/lib/pages/old-life/beneficiariesPage.ts

This file was deleted.

77 changes: 0 additions & 77 deletions src/lib/pages/old-life/checkoutPage.ts

This file was deleted.

14 changes: 0 additions & 14 deletions src/lib/pages/old-life/healthStatusPage.ts

This file was deleted.

69 changes: 0 additions & 69 deletions src/lib/pages/old-life/personalDataPage.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/lib/pages/old-life/preventivatorePage.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/lib/pages/old-life/yourOfferPage.ts

This file was deleted.

25 changes: 0 additions & 25 deletions src/lib/pages/pageFactory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,6 @@ import HealthStatusPage from "./life/healthStatusPage";
import PersonalDataPage from "./life/personalDataPage";
import PreventivatorePage from "./life/preventivatorePage";
import YourOfferPage from "./life/yourOfferPage";
import OldBeneficiariesPage from "./old-life/beneficiariesPage";
import OldCheckoutPage from "./old-life/checkoutPage";
import OldHealthStatusPage from "./old-life/healthStatusPage";
import OldPersonalDataPage from "./old-life/personalDataPage";
import OldPreventivatorePage from "./old-life/preventivatorePage";
import OldYourOfferPage from "./old-life/yourOfferPage";
import PageFactory from "./pageFactory";

describe("PageFactory tests", () => {
Expand All @@ -37,25 +31,6 @@ describe("PageFactory tests", () => {
CheckoutPage,
);

expect(PageFactory.getPage("caso-morte", "preventivatore")).toBeInstanceOf(
OldPreventivatorePage,
);
expect(PageFactory.getPage("caso-morte", "la-tua-offerta")).toBeInstanceOf(
OldYourOfferPage,
);
expect(PageFactory.getPage("caso-morte", "stato-di-salute")).toBeInstanceOf(
OldHealthStatusPage,
);
expect(PageFactory.getPage("caso-morte", "beneficiari")).toBeInstanceOf(
OldBeneficiariesPage,
);
expect(PageFactory.getPage("caso-morte", "dati-personali")).toBeInstanceOf(
OldPersonalDataPage,
);
expect(PageFactory.getPage("caso-morte", "checkout")).toBeInstanceOf(
OldCheckoutPage,
);

expect(PageFactory.getPage("infortuni", "seleziona")).toBeInstanceOf(
SelectPage,
);
Expand Down
Loading

0 comments on commit 1296c27

Please sign in to comment.