Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/charliewilco/playwright-next-github-actions
reduced test case
https://github.com/charliewilco/playwright-next-github-actions
e2e-testing mongodb nextjs playwright testing typescript
Last synced: 26 days ago
JSON representation
reduced test case
- Host: GitHub
- URL: https://github.com/charliewilco/playwright-next-github-actions
- Owner: charliewilco
- Created: 2020-12-26T02:25:14.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-19T04:17:47.000Z (9 months ago)
- Last Synced: 2024-04-17T02:07:55.160Z (7 months ago)
- Topics: e2e-testing, mongodb, nextjs, playwright, testing, typescript
- Language: TypeScript
- Homepage: https://playwright-next.typescript.wtf/
- Size: 1.65 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Playwright + Next.js Example
![E2E Testing](https://github.com/charliewilco/puppeteer-next-github-actions/workflows/E2E%20Testing/badge.svg)
This is a really simple project that shows the usage building an E2E test with [Playwright](https://playwright.dev/).
This was a reduced test case to see if GitHub Actions could run the E2E tests with the headless browswer; also uses TypeScript and MongoDB.
Install [MongoDB](https://www.mongodb.com/docs/manual/tutorial/install-mongodb-on-os-x/)
```
brew tap mongodb/brew
``````
brew install mongodb-community
```Install the project dependencies:
```
npm install
```Install playwright:
```
npx playwright install --with-deps
```Build the project first:
```
npm run build
```## Notes
Tests are meant to be simple, doesn't focus on doing evaluation for assertion but to see if one of the operations catches and fails to continue.
```ts
test("should find link", async ({ page }) => {
await page.goto("/");await page.click("text=About");
await expect(page).toHaveURL("/about");
await expect(page.locator("h1")).toContainText("About");
});
```