Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
feat: playwright test migration (#717)
Browse files Browse the repository at this point in the history
* feat: init playwright

* test(core-progress): migrate to playwright

* ci(playwright): run *.spec.ts tests only

* test(core-scroll): migrate to playwright

* fixup! feat: init playwright

* ci(rollup): temporarly remove test files

* ci: retry tests once

* fix: redudant use property

* fix(core-scroll-test): await expect

* ci: use github reporter

* feat: normalize scroll css

* ci: use macos-latest github runner

* ci(playwright): set timezone to GMT

* test(core-datepicker): migrate to playwright

* test(core-dialog): migrate to playwright

* fix(core-datepicker): pad expected day

* fix(core-datepicker): remove await

* fix(core-datepicker): remove let datePicker

* test(core-suggest): migrate to playwright

* test(core-tabs): migrate to playwright

* test(core-toggle): migrate to playwright

* fix(core-datepicker-test): use setContent

* chore: format using standard

* chore: format playwright file using standard

* build: remove old test files, deps and config

* fix(core-datepicker-test): content should not have date

* fix: missing awaits

* fix(core-suggest-test): http was altered to https in firefox

* fix(core-suggest-test): missing hidden attr

* fix(core-toggle-test): skip for webkit and point to issue

* fix(core-scroll-test): use setContent

* fix(core-progress-test): use setContent

* fix(core-toggle-test): use setContent

* fix(core-scroll-test): wait for captureChangeEvent

* fix(test-spec-html): mock fav icon and remove missing css links

* fix(test-html): remove css files

* refactor: remove normalize.css

* refactor: playwright config cleanup

* feat: typescript definitions for core-components (#720)

* fix(js-docs): invalid typing

* feat(typescript): generate type def for core-components

* feat: index.d.ts for type definitions sourcing

* fix: missing types in core-components tests

* fix(core-scroll): add ignore to scroll in js

* chore: npmignore test-, type-def-, and config files

* build: compile type definitions after rollup bundling

---------

Co-authored-by: Ole Christer Selvig <[email protected]>

* fix: use tripple-slash reference in index.d.ts

* ci: use multiple test workers

* ci: output junit report

* ci: test summary action

* chore: remove unused afterEach

* fix: summary action

* build: change test script order

* docs: playwright testing readme

* build: use node v20

* refactor: enhance test readability with test steps

* ci: retain trace on failure

* ci: remove html reporter

* refactor: use same page for all tests

* test(core-datepicker): rework test for simple-date-parse to limit flakyness

* chore: rename test-fixtures/page to not match globbing pattern of packages

* chore: do not ship files for testing to npm

* docs: Update testing section in github readme

* refactor(core-suggest): sign anonyums timeout func

* test(core-suggest): wait for signed timeout func

* test: add Microsoft Edge test project

---------

Co-authored-by: Ole Christer Selvig <[email protected]>
Co-authored-by: Skjalg Teig <[email protected]>
  • Loading branch information
3 people committed Sep 5, 2023
1 parent 72f0dc2 commit 523c845
Show file tree
Hide file tree
Showing 55 changed files with 3,278 additions and 4,838 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Playwright Tests
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
jobs:
test:
timeout-minutes: 60
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- 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@v3
if: always()
with:
name: playwright-report
path: |
playwright-report/
results.xml
retention-days: 30
- name: Test summary
uses: test-summary/action@v2
with:
paths: results.xml
if: always()
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ yarn-error*
**/jsx.js
*.log
axe-linter.yml
/test-results/
/playwright-report/
/playwright/.cache/
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v20.5.1
129 changes: 0 additions & 129 deletions bin/test.js

This file was deleted.

11 changes: 11 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/**
* Typescript type definitions are currently only available in development (un-published)
*/

/// <reference path="./packages/core-datepicker/core-datepicker.d.ts" />
/// <reference path="./packages/core-dialog/core-dialog.d.ts" />
/// <reference path="./packages/core-progress/core-progress.d.ts" />
/// <reference path="./packages/core-scroll/core-scroll.d.ts" />
/// <reference path="./packages/core-suggest/core-suggest.d.ts" />
/// <reference path="./packages/core-tabs/core-tabs.d.ts" />
/// <reference path="./packages/core-toggle/core-toggle.d.ts" />
14 changes: 14 additions & 0 deletions jsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"compilerOptions": {
"module": "ESNext",
"moduleResolution": "Node",
"target": "ES2020",
"jsx": "react",
"strictNullChecks": true,
"strictFunctionTypes": true
},
"exclude": [
"node_modules",
"**/node_modules/*"
]
}
Loading

0 comments on commit 523c845

Please sign in to comment.