calcom/packages/embeds/embed-core/playwright/lib/testUtils.ts
Hariom Balhara c63d81719b
Embed Improvements (#2365)
Co-authored-by: Omar López <zomars@me.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2022-04-08 05:33:24 +00:00

21 lines
621 B
TypeScript

import { Page, test } from "@playwright/test";
export function todo(title: string) {
test.skip(title, () => {});
}
export const getEmbedIframe = async ({ page, pathname }: { page: Page; pathname: string }) => {
// FIXME: Need to wait for the iframe to be properly added to shadow dom. There should be a no time boundation way to do it.
await new Promise((resolve) => {
setTimeout(resolve, 2000);
});
let embedIframe = page.frame("cal-embed");
if (!embedIframe) {
return null;
}
const u = new URL(embedIframe.url());
if (u.pathname === pathname) {
return embedIframe;
}
return null;
};