Skip to content

Commit 75d3321

Browse files
committed
Added tests for link to blog posts
1 parent 5de386d commit 75d3321

File tree

2 files changed

+152
-0
lines changed

2 files changed

+152
-0
lines changed

tests/playwright/landingPage.spec.ts

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { test, expect } from "@playwright/test";
44
const baseUrl = "https://www.crocoder.dev";
55
const bookACallSection = "book-a-call-section";
66
const discoverOurServices = "discover-our-services";
7+
const blogUrl = "blog";
8+
const contactUrl = "contact";
79

810
test.describe("Landing page", () => {
911
test.beforeEach(async ({ page }) => {
@@ -46,4 +48,81 @@ test.describe("Navigation via links to", () => {
4648
await expect(page).toHaveURL(`${baseUrl}/#${discoverOurServices}`);
4749
await expect(page.locator(`#${discoverOurServices}`)).toBeInViewport();
4850
});
51+
52+
test("how we rebuilt a legacy ui with zero downtime blog post", async ({
53+
page,
54+
}) => {
55+
const caseStudy = page
56+
.locator("#animation-wrapper section")
57+
.filter({ hasText: "Expert Led Digital" });
58+
59+
await caseStudy.scrollIntoViewIfNeeded();
60+
await expect(caseStudy.getByRole("link")).toBeInViewport();
61+
await caseStudy.getByRole("link").click();
62+
63+
await Promise.all([
64+
page.waitForURL(
65+
`${baseUrl}/${blogUrl}/how-we-rebuilt-a-legacy-ui-with-zero-downtime`,
66+
),
67+
page.getByText(
68+
"How We Rebuilt a Legacy UI With Zero Downtime: A Case Study in Component Libraries and Frontend Guidance",
69+
),
70+
]);
71+
});
72+
73+
test("using lago to create a flexible billing system blog post", async ({
74+
page,
75+
}) => {
76+
const caseStudy = page
77+
.locator("#animation-wrapper section")
78+
.filter({ hasText: "Product & Platform" });
79+
80+
await caseStudy.scrollIntoViewIfNeeded();
81+
await expect(caseStudy.getByRole("link")).toBeInViewport();
82+
await caseStudy.getByRole("link").click();
83+
84+
await Promise.all([
85+
page.waitForURL(
86+
`${baseUrl}/${blogUrl}/using-lago-to-create-a-flexible-billing-system`,
87+
),
88+
page.getByText("Using Lago to Create a Flexible Billing System"),
89+
]);
90+
});
91+
92+
test("Contact us page", async ({ page }) => {
93+
const contactUsLink = page.getByRole("link", {
94+
name: "Schedule a free DevEx audit",
95+
});
96+
97+
await page
98+
.locator("#animation-wrapper section")
99+
.filter({ hasText: "Workflow & Release" })
100+
.scrollIntoViewIfNeeded();
101+
await expect(contactUsLink).toBeInViewport();
102+
await contactUsLink.click();
103+
104+
await Promise.allSettled([
105+
page.waitForURL(`${baseUrl}/${contactUrl}`, { timeout: 10000 }),
106+
expect(page.getByText("get in touch")).toBeVisible(),
107+
]);
108+
});
109+
110+
test("migrating an enterprise app from angularjs to react blog post", async ({
111+
page,
112+
}) => {
113+
const caseStudy = page
114+
.locator("#animation-wrapper section")
115+
.filter({ hasText: "Team Enablement & Upskilling" });
116+
117+
await caseStudy.scrollIntoViewIfNeeded();
118+
await expect(caseStudy.getByRole("link")).toBeInViewport();
119+
await caseStudy.getByRole("link").click();
120+
121+
await Promise.all([
122+
page.waitForURL(
123+
`${baseUrl}/${blogUrl}/migrating-an-enterprise-app-from-angularjs-to-react`,
124+
),
125+
page.getByText("Migrating an Enterprise App from AngularJS to React"),
126+
]);
127+
});
49128
});

tests/playwright/landingPageMobile.spec.ts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import type { Page } from "@playwright/test";
55
const baseUrl = "https://www.crocoder.dev";
66
const bookACallSection = "book-a-call-section";
77
const discoverOurServices = "discover-our-services";
8+
const blogUrl = "blog";
9+
const contactUrl = "contact";
810

911
test.describe("Landing page in mobile view", () => {
1012
let page: Page;
@@ -73,4 +75,75 @@ test.describe("Navigation via links in mobile view to", () => {
7375
await expect(page).toHaveURL(`${baseUrl}/#${discoverOurServices}`);
7476
await expect(page.locator(`#${discoverOurServices}`)).toBeInViewport();
7577
});
78+
79+
test("how we rebuilt a legacy ui with zero downtime blog post", async () => {
80+
const caseStudy = page
81+
.locator("#animation-wrapper section")
82+
.filter({ hasText: "Expert Led Digital" });
83+
84+
await caseStudy.scrollIntoViewIfNeeded();
85+
await expect(caseStudy.getByRole("link")).toBeInViewport();
86+
await caseStudy.getByRole("link").click();
87+
88+
await Promise.all([
89+
page.waitForURL(
90+
`${baseUrl}/${blogUrl}/how-we-rebuilt-a-legacy-ui-with-zero-downtime`,
91+
),
92+
page.getByText(
93+
"How We Rebuilt a Legacy UI With Zero Downtime: A Case Study in Component Libraries and Frontend Guidance",
94+
),
95+
]);
96+
});
97+
98+
test("using lago to create a flexible billing system blog post", async () => {
99+
const caseStudy = page
100+
.locator("#animation-wrapper section")
101+
.filter({ hasText: "Product & Platform" });
102+
103+
await caseStudy.scrollIntoViewIfNeeded();
104+
await expect(caseStudy.getByRole("link")).toBeInViewport();
105+
await caseStudy.getByRole("link").click();
106+
107+
await Promise.all([
108+
page.waitForURL(
109+
`${baseUrl}/${blogUrl}/using-lago-to-create-a-flexible-billing-system`,
110+
),
111+
page.getByText("Using Lago to Create a Flexible Billing System"),
112+
]);
113+
});
114+
115+
test("Contact us page", async () => {
116+
const contactUsLink = page.getByRole("link", {
117+
name: "Schedule a free DevEx audit",
118+
});
119+
120+
await page
121+
.locator("#animation-wrapper section")
122+
.filter({ hasText: "Workflow & Release" })
123+
.scrollIntoViewIfNeeded();
124+
await expect(contactUsLink).toBeInViewport();
125+
await contactUsLink.click();
126+
127+
await Promise.allSettled([
128+
page.waitForURL(`${baseUrl}/${contactUrl}`, { timeout: 10000 }),
129+
expect(page.getByText("get in touch")).toBeVisible(),
130+
]);
131+
});
132+
133+
test("migrating an enterprise app from angularjs to react blog post", async () => {
134+
const caseStudy = page
135+
.locator("#animation-wrapper section")
136+
.filter({ hasText: "Team Enablement & Upskilling" });
137+
138+
await caseStudy.scrollIntoViewIfNeeded();
139+
await expect(caseStudy.getByRole("link")).toBeInViewport();
140+
await caseStudy.getByRole("link").click();
141+
142+
await Promise.all([
143+
page.waitForURL(
144+
`${baseUrl}/${blogUrl}/migrating-an-enterprise-app-from-angularjs-to-react`,
145+
),
146+
page.getByText("Migrating an Enterprise App from AngularJS to React"),
147+
]);
148+
});
76149
});

0 commit comments

Comments
 (0)