From 3a915d09c20968c3f76da87873cc6596186a277f Mon Sep 17 00:00:00 2001 From: Binit Shah Date: Wed, 25 Sep 2024 21:27:57 -0400 Subject: [PATCH] Add first test --- .gitignore | 1 + package.json | 1 + tests/signaling.spec.ts | 16 ++++++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 tests/signaling.spec.ts diff --git a/.gitignore b/.gitignore index 634a2bc7..c6d5cdde 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ # testing /coverage +test-results/ # production /build diff --git a/package.json b/package.json index 610fc50f..9f6b46c0 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/tests/signaling.spec.ts b/tests/signaling.spec.ts new file mode 100644 index 00000000..d678fb8b --- /dev/null +++ b/tests/signaling.spec.ts @@ -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() + } +});