Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(test): add initial WebdriverIO infrastructure #5456

Merged
merged 16 commits into from
Mar 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/test-wdio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: WebdriverIO Tests

on:
christian-bromann marked this conversation as resolved.
Show resolved Hide resolved
merge_group:
pull_request:
push:
branches:
- 'main'

jobs:
build_core:
name: Build
uses: ./.github/workflows/build.yml

Comment on lines +11 to +14
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No action required right now, but we could make this a little more similar to test-unit where we have a reusable workflow that uses the build_core build from the main workflow, instead of something separate. That'd give us a little less to manage here in terms of infra-as-code, but that's about it

run_wdio:
name: Run WebdriverIO Component Tests
runs-on: ubuntu-22.04
needs: [build_core]

steps:
- name: Checkout Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Use Node Version from Volta (Karma)
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
with:
# pull the version to use from the volta key in package.json
node-version-file: './test/karma/package.json'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Download Build Archive
uses: ./.github/workflows/actions/download-archive
with:
name: stencil-core
path: .
filename: stencil-core-build.zip

- name: Run WebdriverIO Component Tests
run: npm run test.wdio
Comment on lines +41 to +42
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's sort of six of one half a dozen of another but would it make sense for us to kick off the wdio tests from within the main workflow, like we do for the unit tests and whatnot? instead of having a separate workflow here that runs independently

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also is the plan to circle back later to do some sort of matrix on browsers and browser versions?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to kick off the wdio tests from within the main workflow, like we do for the unit tests and whatnot?

The test run is cheap and can be run as part of the unit test.

also is the plan to circle back later to do some sort of matrix on browsers and browser versions?

Just pushed a fix to include Firefox and Safari when running in CI

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recognize that there are some browser differences with some assertions. I had to change some assertion values based on whether we run in Safari or not. This could be either an actual browser issue or something with the driver underneath. I would like to investigate this separately. This could become ultimately a burden to maintain at some point. I can bring this up at the next Jam session.


- name: Check Git Context
uses: ./.github/workflows/actions/check-git-context
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,6 @@ coverage/**
null_errors*.json
# TODO(STENCIL-454): Remove or change this up once we've eliminated unused exports
unused-exports*.txt

# TODO(STENCIL-1203): check in type files back into the repository after migration
test/wdio/src/components.d.ts
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
"test.jest": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js",
"test.karma": "cd test/karma && npm ci && npm run karma",
"test.karma.prod": "cd test/karma && npm ci && npm run karma.prod",
"test.wdio": "cd test/wdio && npm ci && npm run test",
"test.wdio.testOnly": "cd test/wdio && npm ci && npm run wdio",
"test.prod": "npm run test.dist && npm run test.end-to-end && npm run test.jest && npm run test.karma && npm run test.sys.node && npm run test.testing && npm run test.analysis",
"test.testing": "node scripts/test/validate-testing.js",
"test.watch": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --watch",
Expand Down
1 change: 0 additions & 1 deletion test/karma/stencil.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export const config: Config = {
},
],
globalScript: 'test-app/global.ts',
globalStyle: 'test-app/style-plugin/global-sass-entry.scss',
rwaskiewicz marked this conversation as resolved.
Show resolved Hide resolved
plugins: [sass()],
buildEs5: true,
extras: {
Expand Down
6 changes: 0 additions & 6 deletions test/karma/test-app/attribute-basic/index.html

This file was deleted.

27 changes: 0 additions & 27 deletions test/karma/test-app/attribute-basic/karma.spec.ts

This file was deleted.

6 changes: 0 additions & 6 deletions test/karma/test-app/attribute-boolean/index.html

This file was deleted.

50 changes: 0 additions & 50 deletions test/karma/test-app/attribute-boolean/karma.spec.ts

This file was deleted.

15 changes: 0 additions & 15 deletions test/karma/test-app/attribute-complex/index.html

This file was deleted.

6 changes: 0 additions & 6 deletions test/karma/test-app/attribute-host/index.html

This file was deleted.

88 changes: 0 additions & 88 deletions test/karma/test-app/attribute-host/karma.spec.ts

This file was deleted.

9 changes: 0 additions & 9 deletions test/karma/test-app/attribute-html/index.html

This file was deleted.

17 changes: 0 additions & 17 deletions test/karma/test-app/attribute-html/karma.spec.ts

This file was deleted.

6 changes: 0 additions & 6 deletions test/karma/test-app/build-data/index.html

This file was deleted.

17 changes: 0 additions & 17 deletions test/karma/test-app/build-data/karma.spec.ts

This file was deleted.

Loading
Loading