scramjet/tests/google.spec.ts

26 lines
No EOL
971 B
TypeScript

import { test, expect } from "@playwright/test";
import { setupPage } from "./util/setupPage";
test.describe("Google", () => {
test("The front page can load.", async ({ page }) => {
const frame = await setupPage(page, "https://www.google.com/");
const logo = await frame.locator("img[alt='Google']").first().getAttribute("src");
expect(logo).not.toBeNull();
});
test("The Google Apps menu opens and content is visible.", async ({ page }) => {
const frame = await setupPage(page, "https://www.google.com/");
frame.locator("a[aria-label='Google apps']").first().click();
const appsMenuFrame = frame.locator("iframe[name='app']");
await appsMenuFrame.waitFor({ state: "visible" });
await appsMenuFrame.contentFrame().locator("c-wiz").first().waitFor({ state: "visible" });
const appsMenu = await appsMenuFrame.getAttribute("src");
expect(appsMenu).not.toBeNull();
});
})