Skip to content

Commit

Permalink
feat: wdi5 2.0 progression (#518)
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
vobu authored Aug 28, 2023
1 parent 65d1250 commit d51cdde
Show file tree
Hide file tree
Showing 117 changed files with 11,276 additions and 7,125 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-docker-standalone-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:

strategy:
matrix:
node_version: [16, 18, 19, 20]
node_version: [18, 20]

env:
REGISTRY: ghcr.io
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ name: "CodeQL"
on:
pull_request:
# The branches below must be a subset of the branches above
branches: [main]
branches: [main, main-v2]
schedule:
- cron: "43 16 * * 4"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
- run: npm run build
- uses: ncipollo/release-action@v1
with:
artifacts: "dist/**/*,client-side-js/**/*"
artifacts: "cjs/**/*,esm/**/*,client-side-js/**/*"
bodyFile: "CHANGELOG.md"
token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ on:
push:
branches:
- main
- main-v2
pull_request:
branches:
- main
- main-v2

jobs:
run-linters:
Expand Down
29 changes: 24 additions & 5 deletions .github/workflows/wdi5-tests_auth.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
name: auth
on:
workflow_run:
workflows: [core]
types:
- completed
pull_request_target:
paths:
# relevant
- "client-side-js/**"
- "examples/**"
- "scripts/**"
- "src/**"
# don't run on changes to these
- "!.husky/**"
- "!.vscode/**"
- "!docs/**"
- "!.*"
- "!*.md"
- "!*.cjs"

env:
wdi5_username: ${{secrets.BTP_LOGIN}}
Expand All @@ -18,16 +28,25 @@ env:
SAUCE_ACCESS_KEY: ${{secrets.SAUCE_ACCESS_KEY}}

jobs:
authorize:
environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
runs-on: ubuntu-latest
steps:
- run: true

tests:
needs: authorize
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16]
node-version: [18]

steps:
- name: check out repo
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha || github.ref }}

- name: use node ${{ matrix.node-version }}
uses: actions/setup-node@v3
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/wdi5-tests_core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- main
- main-v2
paths:
# relevant
- "client-side-js/**"
Expand All @@ -23,7 +24,7 @@ jobs:

strategy:
matrix:
node-version: [16, 18, 19, 20]
node-version: [18, 20]

steps:
- name: check out repo
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/wdi5-tests_fe-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
pull_request:
branches:
- main
- main-v2
paths:
# relevant
- "client-side-js/**"
Expand All @@ -23,17 +24,20 @@ jobs:

strategy:
matrix:
node-version: [16, 18, 19, 20]
node-version: [18, 20]

steps:
- name: update chrome
run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable
# check chrome version
google-chrome --version
### no mas since wdio^8 allows for auto-download of matching chromedriver for the env
### -> we save CI time!
### yet leaving this as ref
# - name: update chrome
# run: |
# wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
# sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
# sudo apt-get update
# sudo apt-get --only-upgrade install google-chrome-stable
# # check chrome version
# google-chrome --version

- name: check out repo
uses: actions/checkout@v3
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/wdi5-tests_js-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
pull_request:
branches:
- main
- main-v2

paths:
# relevant
- "client-side-js/**"
Expand All @@ -24,17 +26,20 @@ jobs:

strategy:
matrix:
node-version: [16, 18, 19, 20]
node-version: [18, 20]

steps:
- name: update chrome
run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable
# check chrome version
google-chrome --version
### no mas since wdio^8 allows for auto-download of matching chromedriver for the env
### -> we save CI time!
### yet leaving this as ref
# - name: update chrome
# run: |
# wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
# sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
# sudo apt-get update
# sudo apt-get --only-upgrade install google-chrome-stable
# # check chrome version
# google-chrome --version

- name: check out repo
uses: actions/checkout@v3
Expand Down
22 changes: 13 additions & 9 deletions .github/workflows/wdi5-tests_ts-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- main
- main-v2
paths:
# relevant
- "client-side-js/**"
Expand All @@ -24,17 +25,20 @@ jobs:

strategy:
matrix:
node-version: [16, 18, 19, 20]
node-version: [18, 20]

steps:
- name: update chrome
run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get --only-upgrade install google-chrome-stable
# check chrome version
google-chrome --version
### no mas since wdio^8 allows for auto-download of matching chromedriver for the env
### -> we save CI time!
### yet leaving this as ref
# - name: update chrome
# run: |
# wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
# sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
# sudo apt-get update
# sudo apt-get --only-upgrade install google-chrome-stable
# # check chrome version
# google-chrome --version

- name: check out repo
uses: actions/checkout@v3
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ typings/
.idea

# don't include build artifacts
cjs/**/*
esm/**/*
dist/**/*

# Gitkeep generally
Expand Down
3 changes: 2 additions & 1 deletion .mocharc.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"extension": ["ts"],
"spec": "test/**/*.test.ts",
"require": "ts-node/register"
"require": "ts-node/register",
"node-option": ["experimental-specifier-resolution=node", "loader=ts-node/esm"]
}
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
18
9 changes: 9 additions & 0 deletions .retrofit-pkg-json.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// transmogrifying wdi5's package.json to a cjs version
import { promises as fs } from "fs"
import pkgJson from "./package.json" assert { type: "json" }
;["type", "exports", "types", "files", "workspaces", "scripts", "lint-staged"].forEach((section) => {
delete pkgJson[section]
})
;(async () => {
await fs.writeFile("./cjs/package.json", JSON.stringify(pkgJson, null, 2))
})()
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@
"editor.formatOnSave": true,
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
},
"javascript.preferences.importModuleSpecifierEnding": "js",
"typescript.preferences.importModuleSpecifierEnding": "js"
}
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

## [2.0.0-alpha.1](https://github.com/ui5-community/wdi5/compare/v2.0.0-alpha.0...v2.0.0-alpha.1) (2023-07-06)

## [2.0.0-alpha.0](https://github.com/ui5-community/wdi5/compare/v1.5.1...v2.0.0-alpha.0) (2023-07-03)


### Features

* wdio v8 enablement ([#498](https://github.com/ui5-community/wdi5/issues/498)) ([ee5e2c4](https://github.com/ui5-community/wdi5/commit/ee5e2c4cca23af6dfb9f5552c6a91d34d51accdc)), closes [#384](https://github.com/ui5-community/wdi5/issues/384)

### 1.5.3 (2023-08-22)


Expand Down
34 changes: 34 additions & 0 deletions MIGRATION_GUIDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# migrating to `wdi5` 2.x

Version >= 2 of `wdi5` is WebdriverIO v8 compatible. This entails a move to ESM as primary module, with CJS compatibility ensured.

## check file sys dir references in your test code

dir references start from the dir the file is in now,
not from `cwd`

```diff
const config = {
- specs: [join("webapp", "test", "e2e", "ui5-late.test.js")],
+ specs: [join("..", "webapp", "test", "e2e", "ui5-late.test.js")],
baseUrl: "https://github.com/ui5-community/wdi5/"
}
```

## usage of devtools automation protocol

Now requires using the `devtools` package (which is now a dependency of `wdi5`) and explicit configuration in the `*.conf.(j|t)s`-file:

```diff
export const config: wdi5Config = {
baseUrl: "https://your-app",
services: ["ui5"],
specs: [resolve("test/e2e/Protocol.test.ts")],
+ automationProtocol: "devtools",
capabilities: [
{
//...
}
]
}
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 5 additions & 7 deletions docker/package-standalone.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,17 @@
},
"devDependencies": {
"@ui5/cli": "latest",
"@wdio/cli": "^7",
"@wdio/mocha-framework": "^7",
"@wdio/spec-reporter": "^7",
"chromedriver": "latest",
"@wdio/local-runner": "^7",
"@wdio/cli": "^8",
"@wdio/mocha-framework": "^8",
"@wdio/spec-reporter": "^8",
"@wdio/local-runner": "^8",
"fs-extra": "^10.1.0",
"mocha": "^9.2.2",
"npm-run-all": "^4.1.5",
"ui5-middleware-simpleproxy": "latest",
"wait-on": "^6.0.1",
"wdio-chromedriver-service": "^7",
"wdio-ui5-service": "latest",
"webdriverio": "^7"
"webdriverio": "^8"
},
"ui5": {
"dependencies": ["ui5-middleware-simpleproxy"]
Expand Down
12 changes: 5 additions & 7 deletions docker/package-wdi5-dev.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@
"test:docker:standalone": "run-p start test:standalone"
},
"devDependencies": {
"@wdio/cli": "^7.19.1",
"@wdio/mocha-framework": "^7.19.1",
"@wdio/spec-reporter": "^7.19.1",
"chromedriver": "latest",
"@wdio/local-runner": "^7.19.1",
"@wdio/cli": "^8",
"@wdio/mocha-framework": "^8",
"@wdio/spec-reporter": "^8",
"@wdio/local-runner": "^8",
"fs-extra": "^10.0.1",
"mocha": "^9.2.2",
"npm-run-all": "^4.1.5",
"soerver": "^0.0.3",
"wait-on": "^6.0.1",
"wdio-chromedriver-service": "^7",
"wdio-ui5-service": "file:wdio-ui5-service",
"webdriverio": "^7.19.1"
"webdriverio": "^8"
},
"engines": {
"node": ">=14",
Expand Down
12 changes: 5 additions & 7 deletions docker/package-wdi5.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@
"test:docker:standalone": "run-p start test:standalone"
},
"devDependencies": {
"@wdio/cli": "^7.19.1",
"@wdio/mocha-framework": "^7.19.1",
"@wdio/spec-reporter": "^7.19.1",
"chromedriver": "latest",
"@wdio/local-runner": "^7.19.1",
"@wdio/cli": "^8",
"@wdio/mocha-framework": "^8",
"@wdio/spec-reporter": "^8",
"@wdio/local-runner": "^8",
"fs-extra": "^10.0.1",
"mocha": "^9.2.2",
"npm-run-all": "^4.1.5",
"soerver": "^0.0.3",
"wait-on": "^6.0.1",
"wdio-chromedriver-service": "^7",
"wdio-ui5-service": "*",
"webdriverio": "^7.19.1"
"webdriverio": "^8"
},
"engines": {
"node": ">=14",
Expand Down
Binary file added docs/img/social-media-wb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/social-media.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit d51cdde

Please sign in to comment.