-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #292 from projectEndings/headless_testing
Headless testing (resolves #204)
- Loading branch information
Showing
4 changed files
with
103 additions
and
3 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
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,42 @@ | ||
import { defineConfig, devices } from "@playwright/test"; | ||
|
||
/** | ||
* @see https://playwright.dev/docs/test-configuration | ||
*/ | ||
module.exports = defineConfig({ | ||
testDir: "tests", | ||
outputDir: "test-results", | ||
/* Fail the build on CI if you accidentally left test.only in the source code. */ | ||
forbidOnly: true, | ||
retries: 0, | ||
workers: 1, | ||
reporter: "list", | ||
use: { | ||
screenshot: { | ||
mode: "on", | ||
fullPage: true, | ||
}, | ||
baseURL: "http://127.0.0.1:8080", | ||
}, | ||
webServer: { | ||
command: "npx -y http-server ../", | ||
url: "http://127.0.0.1:8080", | ||
reuseExistingServer: false, | ||
}, | ||
/* Configure projects for major browsers */ | ||
projects: [ | ||
{ | ||
name: "chromium", | ||
use: { ...devices["Desktop Chrome"] }, | ||
}, | ||
// { | ||
// name: "firefox", | ||
// use: { ...devices["Desktop Firefox"] }, | ||
// }, | ||
|
||
// { | ||
// name: "webkit", | ||
// use: { ...devices["Desktop Safari"] }, | ||
// }, | ||
], | ||
}); |
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,24 @@ | ||
import { test, expect } from "@playwright/test"; | ||
|
||
test("search page exists", async ({ page }) => { | ||
const response = await page.goto("./test/search.html"); | ||
expect(response.status()).toEqual(200); | ||
}); | ||
|
||
test("search debug exists", async ({ page }) => { | ||
const response = await page.goto("./test/search-debug.html"); | ||
expect(response.status()).toEqual(200); | ||
}); | ||
|
||
test("manual search debug exists", async ({ page }) => { | ||
const response = await page.goto("./test/search-manual-debug.html"); | ||
expect(response.status()).toEqual(200); | ||
}); | ||
|
||
test("tests are successful", async ({ page }) => { | ||
await page.goto("./test/search.html"); | ||
const result = page.locator(".complete"); | ||
await result.waitFor(); | ||
const classList = await result.getAttribute("class"); | ||
expect(classList).toContain("success"); | ||
}); |
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