Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcguire12 committed Dec 23, 2024
1 parent 5e18d42 commit 2350d0f
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 12 deletions.
2 changes: 1 addition & 1 deletion evals/deterministic/tests/addRemoveLocatorHandler.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test.describe("StagehandPage - addLocatorHandler and removeLocatorHandler", () =
async () => {
console.log("Overlay detected. Clicking 'No thanks' to remove it...");
await page.getByRole("button", { name: "No thanks" }).click();
}
},
);

await page.goto("https://example.com");
Expand Down
5 changes: 4 additions & 1 deletion evals/deterministic/tests/frames.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ test.describe("StagehandPage - frame operations", () => {
await page.waitForSelector('iframe[name="frame-two"]');

const frames = page.frames();
console.log("All frames found:", frames.map((f) => f.name()));
console.log(
"All frames found:",
frames.map((f) => f.name()),
);
expect(frames).toHaveLength(3);

const mainFrame = page.mainFrame();
Expand Down
4 changes: 3 additions & 1 deletion evals/deterministic/tests/getBy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ test.describe("StagehandPage - Built-in locators", () => {
await expect(signInButton).toBeVisible();
const greetingDiv = page.getByTestId("greeting");
await expect(greetingDiv).toHaveText("Hello World!");
const descriptiveText = page.getByText("This is some descriptive text on the page.");
const descriptiveText = page.getByText(
"This is some descriptive text on the page.",
);
await expect(descriptiveText).toBeVisible();
const heading = page.getByTitle("A heading for the page");
await expect(heading).toHaveText("Site Title");
Expand Down
2 changes: 1 addition & 1 deletion evals/deterministic/tests/pageContext.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test.describe("StagehandPage - page.context()", () => {

// The newly created page should be recognized by stagehandContext as well.
const foundExtraPage = contextPages.find(
(p) => p.url() === "https://example.com/"
(p) => p.url() === "https://example.com/",
);
expect(foundExtraPage).toBeDefined();
});
Expand Down
17 changes: 9 additions & 8 deletions evals/deterministic/tests/waitFor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ test.describe("StagehandPage - waitFor", () => {
const page = stagehand.page;
await page.goto("https://docs.browserbase.com/introduction");
const dynamicElement = page.locator(
"div.grid:nth-child(1) > a:nth-child(1) > div:nth-child(1)"
"div.grid:nth-child(1) > a:nth-child(1) > div:nth-child(1)",
);

const isVisibleBefore = await dynamicElement.isVisible();
expect(isVisibleBefore).toBe(false);

const clickableElement = page.locator(
"div.mt-12:nth-child(3) > ul:nth-child(2) > li:nth-child(2) > div:nth-child(1)"
"div.mt-12:nth-child(3) > ul:nth-child(2) > li:nth-child(2) > div:nth-child(1)",
);
await clickableElement.click();

Expand All @@ -37,7 +37,7 @@ test.describe("StagehandPage - waitFor", () => {
await page.goto("https://docs.browserbase.com/introduction");

const disappearingElement = page.locator(
"div.not-prose:nth-child(2) > a:nth-child(1) > div:nth-child(1)"
"div.not-prose:nth-child(2) > a:nth-child(1) > div:nth-child(1)",
);

await disappearingElement.click();
Expand Down Expand Up @@ -108,7 +108,7 @@ test.describe("StagehandPage - waitFor", () => {
const page = stagehand.page;

const requestPromise = page.waitForRequest((req) =>
req.url().includes("mintlify")
req.url().includes("mintlify"),
);

await page.goto("https://docs.browserbase.com/introduction");
Expand All @@ -125,8 +125,8 @@ test.describe("StagehandPage - waitFor", () => {

const page = stagehand.page;

const responsePromise = page.waitForResponse((res) =>
res.url().includes("introduction") && res.status() === 200
const responsePromise = page.waitForResponse(
(res) => res.url().includes("introduction") && res.status() === 200,
);

await page.goto("https://docs.browserbase.com/introduction");
Expand All @@ -143,8 +143,9 @@ test.describe("StagehandPage - waitFor", () => {
const page = stagehand.page;
await page.goto("https://docs.browserbase.com");


const quickstartLink = page.locator("div.mt-12:nth-child(3) > ul:nth-child(2) > li:nth-child(2) > div:nth-child(1) > div:nth-child(1)");
const quickstartLink = page.locator(
"div.mt-12:nth-child(3) > ul:nth-child(2) > li:nth-child(2) > div:nth-child(1) > div:nth-child(1)",
);
await quickstartLink.click();

await page.waitForURL(/.*quickstart.*/);
Expand Down

0 comments on commit 2350d0f

Please sign in to comment.