Skip to content

Commit

Permalink
Add first test
Browse files Browse the repository at this point in the history
  • Loading branch information
hello-binit committed Sep 26, 2024
1 parent 88ef80a commit 3a915d0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

# testing
/coverage
test-results/

# production
/build
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"@babel/preset-env": "^7.22.6",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.4",
"@playwright/test": "^1.47.2",
"@types/node": "^20.6.0",
"@types/three": "^0.157.0",
"babel-loader": "^9.1.2",
Expand Down
16 changes: 16 additions & 0 deletions tests/signaling.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { test, expect } from '@playwright/test';

test('has title', async ({ browser }) => {
const playwrightContext = await browser.newContext();
const githubContext = await browser.newContext();
try {
const playwrightPage = await playwrightContext.newPage();
const githubPage = await githubContext.newPage();
await playwrightPage.goto('https://playwright.dev/');
await githubPage.goto('https://github.com/');
await expect(playwrightPage).toHaveTitle(/Playwright/);
await expect(githubPage).toHaveTitle(/GitHub/);
} finally {
await playwrightContext.close()
}
});

0 comments on commit 3a915d0

Please sign in to comment.