Fix test titles

fix/less-recurring-bookings-failure-1
Hariom 2023-10-27 18:20:06 +05:30
parent 71d5d096f0
commit da5f8a96b8
4 changed files with 30 additions and 9 deletions

View File

@ -1,39 +1,53 @@
import type { Page } from "@playwright/test";
import { test, expect } from "@playwright/test";
// You can override the default Playwright test timeout of 30s
// test.setTimeout(60_000);
test.describe("Org", () => {
test.describe("Embeds", () => {
// Because these pages involve next.config.js rewrites, it's better to test them on production
test.describe("Embeds - i.cal.com", () => {
test("Org Profile Page should be embeddable", async ({ page }) => {
const response = await page.goto("https://i.cal.com/embed");
expect(response?.status()).toBe(200);
await page.screenshot({ path: "screenshot.jpg" });
await expectPageToBeServerSideRendered(page);
});
test("Org User Page should be embeddable", async ({ page }) => {
test("Org User(Peer) Page should be embeddable", async ({ page }) => {
const response = await page.goto("https://i.cal.com/peer/embed");
expect(response?.status()).toBe(200);
await expect(page.locator("text=Peer Richelsen")).toBeVisible();
await expectPageToBeServerSideRendered(page);
});
test("Org User Event Page should be embeddable", async ({ page }) => {
test("Org User Event(peer/meet) Page should be embeddable", async ({ page }) => {
const response = await page.goto("https://i.cal.com/peer/meet/embed");
expect(response?.status()).toBe(200);
await expect(page.locator('[data-testid="decrementMonth"]')).toBeVisible();
await expect(page.locator('[data-testid="incrementMonth"]')).toBeVisible();
await expectPageToBeServerSideRendered(page);
});
test("Org Team Profile page should be embeddable", async ({ page }) => {
test("Org Team Profile(/sales) page should be embeddable", async ({ page }) => {
const response = await page.goto("https://i.cal.com/sales/embed");
expect(response?.status()).toBe(200);
await expect(page.locator("text=Cal.com Sales")).toBeVisible();
await expectPageToBeServerSideRendered(page);
});
test("Org Team Event page should be embeddable", async ({ page }) => {
test("Org Team Event page(/sales/hippa) should be embeddable", async ({ page }) => {
const response = await page.goto("https://i.cal.com/sales/hipaa/embed");
expect(response?.status()).toBe(200);
await expect(page.locator('[data-testid="decrementMonth"]')).toBeVisible();
await expect(page.locator('[data-testid="incrementMonth"]')).toBeVisible();
await expectPageToBeServerSideRendered(page);
});
});
});
// This ensures that the route is actually mapped to a page that is using withEmbedSsr
async function expectPageToBeServerSideRendered(page: Page) {
expect(
await page.evaluate(() => {
return window.__NEXT_DATA__.props.pageProps.isEmbed;
})
).toBe(true);
}

View File

@ -257,7 +257,7 @@ const nextConfig = {
},
{
...matcherConfigRootPathEmbed,
destination: "/team/:orgSlug?isOrgProfile=1",
destination: "/team/:orgSlug/embed?isOrgProfile=1",
},
{
...matcherConfigUserRoute,

View File

@ -0,0 +1,7 @@
import withEmbedSsr from "@lib/withEmbedSsr";
import { getServerSideProps as _getServerSideProps } from "./index";
export { default } from "./index";
export const getServerSideProps = withEmbedSsr(_getServerSideProps);

View File

@ -19,7 +19,7 @@ const config = defineConfig({
/* Checkly data centers to run your Checks as monitors */
locations: ["us-east-1", "eu-west-1"],
/* An optional array of tags to organize your Checks */
tags: ["mac"],
tags: ["Web"],
/** The Checkly Runtime identifier, determining npm packages and the Node.js version available at runtime.
* See https://www.checklyhq.com/docs/cli/npm-packages/
*/