2022-04-08 05:33:24 +00:00
|
|
|
import { Page, test } from "@playwright/test";
|
2022-04-04 15:44:04 +00:00
|
|
|
|
|
|
|
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) => {
|
2022-04-08 05:33:24 +00:00
|
|
|
setTimeout(resolve, 2000);
|
2022-04-04 15:44:04 +00:00
|
|
|
});
|
|
|
|
let embedIframe = page.frame("cal-embed");
|
|
|
|
if (!embedIframe) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
const u = new URL(embedIframe.url());
|
|
|
|
if (u.pathname === pathname) {
|
|
|
|
return embedIframe;
|
|
|
|
}
|
|
|
|
return null;
|
|
|
|
};
|