-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(core): add test for example.com page title
- Loading branch information
Showing
4 changed files
with
31 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { describe, expect, it, test } from "bun:test"; | ||
const { chromium: playwright } = require("playwright-core"); | ||
|
||
test("Check the page title of example.com", async (t) => { | ||
const browser = await playwright.launch({ | ||
// args: chromium.args, | ||
// executablePath: await chromium.executablePath(), | ||
// headless: chromium.headless, | ||
}); | ||
|
||
const context = await browser.newContext(); | ||
const page = await context.newPage(); | ||
await page.goto("https://example.com"); | ||
const pageTitle = await page.title(); | ||
await browser.close(); | ||
|
||
expect(pageTitle).toBe("Example Domain"); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
export async function downloadPDF() { | ||
// const cloud = require("@sparticuz/chromium"); | ||
// // biome-ignore lint/style/useSingleVarDeclarator: <explanation> | ||
// const executablePath = await cloud.executablePath() | ||
const { chromium } = require("playwright-core"); | ||
|
||
return { c: chromium }; | ||
} | ||
|
||
export const cloud = require("chrome-aws-lambda"); | ||
export const desc = "Api for pdf generation"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1 @@ | ||
export async function downloadPDF() { | ||
// const cloud = require("@sparticuz/chromium"); | ||
// // biome-ignore lint/style/useSingleVarDeclarator: <explanation> | ||
// const executablePath = await cloud.executablePath() | ||
const { chromium } = require("playwright-core"); | ||
|
||
return { c: chromium }; | ||
} | ||
|
||
export const cloud = require("chrome-aws-lambda"); | ||
export const desc = "Api for pdf generation"; | ||
export * from "./core"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters