Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions tests/e2e/whitepaper.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,23 @@ import { expect, request, test } from "@playwright/test"
import { MdPage } from "./pages/MdPage"

const PAGE_URL = "/whitepaper"
const PDF_LINK_TEXT = /whitepaper.*pdf/i
const PDF_PATH =
"/content/whitepaper/whitepaper-pdf/Ethereum_Whitepaper_-_Buterin_2014.pdf"
const PDF_FILENAME = "Ethereum_Whitepaper_-_Buterin_2014.pdf"
const PDF_PATH = `/content/whitepaper/whitepaper-pdf/${PDF_FILENAME}`

test.describe("Whitepaper Page", () => {
test("whitepaper PDF link has correct href", async ({ page }) => {
test("whitepaper PDF link is visible and has correct href", async ({
page,
}) => {
const whitepaperPage = new MdPage(page, PAGE_URL)
await whitepaperPage.goto()
await whitepaperPage.verifyLinkVisible(PDF_LINK_TEXT)
await whitepaperPage.verifyLinkHref(PDF_LINK_TEXT, PDF_PATH)

// Select by href - more robust than link text which may change
const pdfLink = page.locator(`a[href*="${PDF_FILENAME}"]`)
await expect(pdfLink).toBeVisible()
await expect(pdfLink).toHaveAttribute(
"href",
expect.stringContaining(PDF_PATH)
)
})

test("whitepaper PDF is accessible and served as PDF", async ({
Expand Down
Loading