File size: 1,017 Bytes
bee6636
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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 search = await frame.locator("textarea[Title='Search']").first().waitFor({ state: "visible" });
        expect(search).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();
    });
})