-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This is a port of v1 healthz page to v2 Impact: A simple way to check site health (requires no auth). Good smoke test for e2e.
- Loading branch information
G r e y
committed
Mar 16, 2022
1 parent
5a42e17
commit 27749ce
Showing
4 changed files
with
31 additions
and
0 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,13 @@ | ||
import { Locator, Page } from "@playwright/test" | ||
import { BasePom } from "./BasePom" | ||
|
||
export class HealthzPage extends BasePom { | ||
constructor(baseURL: string | undefined, page: Page) { | ||
super(baseURL, "/healthz", page) | ||
} | ||
|
||
getOk(): Locator { | ||
const locator = this.page.locator("text=ok") | ||
return locator | ||
} | ||
} |
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,8 @@ | ||
import { test } from "@playwright/test" | ||
import { HealthzPage } from "../pom/HealthzPage" | ||
|
||
test("Healthz is available without authentication", async ({ baseURL, page }) => { | ||
const healthzPage = new HealthzPage(baseURL, page) | ||
await page.goto(healthzPage.url, { waitUntil: "networkidle" }) | ||
await healthzPage.getOk().waitFor({ state: "visible" }) | ||
}) |
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
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,8 @@ | ||
import React from "react" | ||
|
||
/** | ||
* HealthzPage is a page that is available without authentication that is used | ||
* for reporting whether or not the Dashboard is online. It should be | ||
* accessible by humans and services. | ||
*/ | ||
export const HealthzPage: React.FC = () => <div>ok</div> |