-
Notifications
You must be signed in to change notification settings - Fork 12
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 #695 from avrae/test/AVR-549-playwright-tests
Test/avr 549 playwright tests
- Loading branch information
Showing
21 changed files
with
283 additions
and
15,414 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
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,30 @@ | ||
name: E2E Tests | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
env: | ||
description: "Environment to run tests against" | ||
required: true | ||
default: "live" | ||
jobs: | ||
test: | ||
timeout-minutes: 60 | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: "14" | ||
cache: "npm" | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Install Playwright Browsers | ||
run: npx playwright install --with-deps | ||
- name: Run Playwright tests | ||
run: npm run e2e:${{ github.event.inputs.env }} | ||
- uses: actions/upload-artifact@v4 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: playwright-report | ||
path: playwright-report/ | ||
retention-days: 14 |
This file was deleted.
Oops, something went wrong.
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
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,12 @@ | ||
import { test, expect } from "@playwright/test"; | ||
|
||
test.describe("avrae frontpage", () => { | ||
test.beforeEach(async ({ page }) => { | ||
await page.goto("/"); | ||
}); | ||
|
||
test("should display welcome message", async ({ page }) => { | ||
const paragraphText = await page.textContent("css=.about-avrae"); | ||
expect(paragraphText).toContain("I am Avrae"); | ||
}); | ||
}); |
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,35 @@ | ||
import { test, expect } from "@playwright/test"; | ||
import { CommandsPage } from "./pages/commands"; | ||
|
||
test.describe("avrae commands page", () => { | ||
let commandsPage: CommandsPage; | ||
|
||
test.beforeEach(async ({ page }) => { | ||
commandsPage = new CommandsPage(page); | ||
await commandsPage.navigate(); | ||
}); | ||
|
||
test("should display a header", async () => { | ||
const headerText = await commandsPage.getHeaderText(); | ||
expect(headerText).toEqual("Avrae Commands"); | ||
}); | ||
|
||
test("should show some modules", async () => { | ||
const renderedModules = await commandsPage.getRenderedModules(); | ||
for (const moduleElement of await renderedModules.all()) { | ||
expect(moduleElement); | ||
} | ||
}); | ||
|
||
test("should show some commands in each module", async () => { | ||
const renderedModules = await commandsPage.getRenderedModules(); | ||
for (const moduleElement of await renderedModules.all()) { | ||
const moduleCommands = await commandsPage.getModuleCommands( | ||
moduleElement | ||
); | ||
for (const commandElement of await moduleCommands.all()) { | ||
expect(commandElement).toBeVisible(); | ||
} | ||
} | ||
}); | ||
}); |
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,25 @@ | ||
import { Page } from "@playwright/test"; | ||
|
||
export class CommandsPage { | ||
readonly page: Page; | ||
|
||
constructor(page: Page) { | ||
this.page = page; | ||
} | ||
|
||
async navigate() { | ||
await this.page.goto("/commands"); | ||
} | ||
|
||
async getHeaderText() { | ||
return this.page.textContent("h1"); | ||
} | ||
|
||
async getRenderedModules() { | ||
return this.page.locator("css=.module-container"); | ||
} | ||
|
||
async getModuleCommands(moduleElement) { | ||
return moduleElement.locator("css=avr-command-display"); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.