Skip to content

Commit

Permalink
Upgrade outdated modules (#28)
Browse files Browse the repository at this point in the history
* chore: upgrade modules

* test: refactor, use inbuilt baseUrl

* chore: run workflow on PR push

* chore: standardise test result folder

* chore: no retries anywhere, ✔️ CI parallelisation

* test: stabilise test

* chore: upload failing check's screenshots

* chore: remove unused ENV var

* test: refactor - use locator for auto-wait

* test: stabilise monkey test
narrow focus to form without submit button
  • Loading branch information
davidseow authored Aug 15, 2022
1 parent 58199e9 commit 16ffac2
Show file tree
Hide file tree
Showing 16 changed files with 38,448 additions and 111 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/test.yml → .github/workflows/quality.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: "Test"
name: "Quality"

on:
push:
pull_request:
branches: [main]

jobs:
Expand Down Expand Up @@ -32,7 +32,7 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: Failed test screenshots
path: "screenshots"
path: "jest-playwright/test-results/"
if-no-files-found: ignore

playwright-test-runner:
Expand All @@ -56,5 +56,5 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: Failed test screenshots
path: "screenshots"
path: "playwright-test/test-results/"
if-no-files-found: ignore
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ node_modules
*.log

# playwright-test
screenshots
test-results
playwright-test/state.json
playwright-test/test-results
playwright-test/playwright-report/
playwright/.cache/
5 changes: 2 additions & 3 deletions jest-playwright/jest.custom-environment.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const PlaywrightEnvironment =
require("jest-playwright-preset/lib/PlaywrightEnvironment").default;
const PlaywrightEnvironment = require("jest-playwright-preset/lib/PlaywrightEnvironment").default;

class CustomEnvironment extends PlaywrightEnvironment {
async setup() {
Expand All @@ -18,7 +17,7 @@ class CustomEnvironment extends PlaywrightEnvironment {
const specName = event.test.name.replace(/\W/g, "-");

await this.global.page.screenshot({
path: `screenshots/${parentName}_${specName}.png`,
path: `test-results/${parentName}_${specName}.png`,
});
}
}
Expand Down
9 changes: 4 additions & 5 deletions playwright-test/global-setup.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import { chromium } from "@playwright/test";
import { chromium, FullConfig } from "@playwright/test";

const { BASEURL } = process.env;

async function globalSetup() {
async function globalSetup(config: FullConfig) {
const { baseURL } = config.projects[0].use;
const browser = await chromium.launch();
const page = await browser.newPage();
await page.goto(`${BASEURL}/react-admin-demo/#/`, {
await page.goto(`${baseURL}/react-admin-demo/#/`, {
waitUntil: "networkidle",
});

Expand Down
Loading

0 comments on commit 16ffac2

Please sign in to comment.