-
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.
test(e2e): AVR-549 replace Protractor tests with Playwright
- Loading branch information
1 parent
079a917
commit c476f26
Showing
20 changed files
with
279 additions
and
15,412 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,29 @@ | ||
name: E2E Tests | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
workflow_dispatch: | ||
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: npx playwright test | ||
- 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
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.
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,6 @@ | ||
export const URLS = { | ||
live: "https://avrae.io", | ||
stg: "", | ||
dev: "http://localhost:4200", | ||
docker: "http://localhost:8000", | ||
}; |
Oops, something went wrong.