Skip to content

Commit

Permalink
Merge branch 'appium-master'
Browse files Browse the repository at this point in the history
merge
  • Loading branch information
csusheep committed Dec 21, 2023
2 parents 85521f2 + 654db99 commit 6974d17
Show file tree
Hide file tree
Showing 169 changed files with 4,150 additions and 2,550 deletions.
68 changes: 28 additions & 40 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
# https://github.com/actions/virtual-environments/tree/main/images/macos
# https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops&tabs=yaml
variables:
MIN_VM_IMAGE: macOS-10.15
MIN_XCODE_VERSION: 12.1
# Xcode 10.0 did not have Apple TV
MIN_TV_XCODE_VERSION: 12.1
MIN_TV_PLATFORM_VERSION: 14.0
MIN_TV_DEVICE_NAME: Apple TV 4K
MIN_PLATFORM_VERSION: 14.1
MIN_VM_IMAGE: macOS-12
MIN_XCODE_VERSION: 13.1
MIN_PLATFORM_VERSION: 15.0
MIN_TV_PLATFORM_VERSION: 15.0
MIN_TV_DEVICE_NAME: Apple TV 4K (2nd generation)
MIN_IPHONE_DEVICE_NAME: iPhone 11
MIN_IPAD_DEVICE_NAME: iPad Pro (11-inch) (2nd generation)
MAX_VM_IMAGE: macOS-11
MAX_XCODE_VERSION: 13.2
MAX_PLATFORM_VERSION: 15.2
MAX_PLATFORM_VERSION_TV: 15.2
MAX_IPHONE_DEVICE_NAME: iPhone 11 Pro Max
MAX_TV_DEVICE_NAME: Apple TV 4K
MAX_IPAD_DEVICE_NAME: iPad Pro (11-inch) (2nd generation)
DEFAULT_NODE_VERSION: "16.x"
MIN_IPAD_DEVICE_NAME: iPad Pro (11-inch) (3rd generation)
MAX_VM_IMAGE: macOS-12
MAX_XCODE_VERSION: 14.2
MAX_PLATFORM_VERSION: 16.2
MAX_PLATFORM_VERSION_TV: 16.1
MAX_IPHONE_DEVICE_NAME: iPhone 13
MAX_TV_DEVICE_NAME: Apple TV 4K (2nd generation)
MAX_IPAD_DEVICE_NAME: iPad Pro (11-inch) (3rd generation)
DEFAULT_NODE_VERSION: "18.x"

trigger:
batch: true
branches:
include: [master]

pr:
autoCancel: true
branches:
include: [master]

pool:
vmImage: "$(MAX_VM_IMAGE)"
Expand All @@ -44,14 +51,6 @@ parameters:
stages:
- stage: Unit_Tests_And_Linters
jobs:
- job: Node_Unit_Tests
steps:
- template: azure-templates/node_setup_steps.yml
- script: |
npm install -g appium@next
npm install
- script: npm run test

# region Build
- template: ./azure-templates/base_job.yml
parameters:
Expand Down Expand Up @@ -135,7 +134,7 @@ stages:
dest: tv
tvModel: $(MIN_TV_DEVICE_NAME)
tvVersion: $(MIN_TV_PLATFORM_VERSION)
xcodeVersion: $(MIN_TV_XCODE_VERSION)
xcodeVersion: $(MIN_XCODE_VERSION)
vmImage: $(MIN_VM_IMAGE)
# endregion

Expand Down Expand Up @@ -212,7 +211,7 @@ stages:
sdk: tv_sim
tvModel: $(MIN_TV_DEVICE_NAME)
tvVersion: $(MIN_TV_PLATFORM_VERSION)
xcodeVersion: $(MIN_TV_XCODE_VERSION)
xcodeVersion: $(MIN_XCODE_VERSION)
vmImage: $(MIN_VM_IMAGE)
- template: ./azure-templates/base_job.yml
parameters:
Expand All @@ -222,7 +221,7 @@ stages:
sdk: tv_sim
tvModel: $(MIN_TV_DEVICE_NAME)
tvVersion: $(MIN_TV_PLATFORM_VERSION)
xcodeVersion: $(MIN_TV_XCODE_VERSION)
xcodeVersion: $(MIN_XCODE_VERSION)
vmImage: $(MIN_VM_IMAGE)
# endregion

Expand Down Expand Up @@ -295,24 +294,13 @@ stages:
sdk: tv_sim
tvModel: $(MIN_TV_DEVICE_NAME)
tvVersion: $(MIN_TV_PLATFORM_VERSION)
xcodeVersion: $(MIN_TV_XCODE_VERSION)
xcodeVersion: $(MIN_XCODE_VERSION)
vmImage: $(MIN_VM_IMAGE)
# endregion

- stage: Integration_Tests
jobs:

- job: Node_Integration_Tests
variables:
XCODE_VERSION: $(MAX_XCODE_VERSION)
DEVICE_NAME: $(MAX_IPHONE_DEVICE_NAME)
PLATFORM_VERSION: $(MAX_PLATFORM_VERSION)
steps:
- template: azure-templates/node_setup_steps.yml
- script: npm install
- template: azure-templates/bootstrap_steps.yml
- script: npm run e2e-test

# region Integration Tests Max Xcode
- ${{ each job in parameters.integrationJobs }}:
- template: ./azure-templates/base_job.yml
Expand Down
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Resources
coverage
build
3 changes: 0 additions & 3 deletions .eslintrc

This file was deleted.

29 changes: 29 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"extends": ["@appium/eslint-config-appium-ts"],
"overrides": [
{
"files": "test/**/*.js",
"rules": {
"func-names": "off",
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": "Scripts/**/*.js",
"parserOptions": {"sourceType": "script"},
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": "ci-jobs/scripts/*.js",
"parserOptions": {"sourceType": "script"},
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
}
],
"rules": {
"require-await": "error"
}
}
36 changes: 36 additions & 0 deletions .github/workflows/functional-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Functional Tests

on: [pull_request]


jobs:
test:
env:
CI: true
_FORCE_LOGS: 1
XCODE_VERSION: 13.4
DEVICE_NAME: iPhone 11
PLATFORM_VERSION: 15.5
# https://github.com/actions/runner-images/blob/main/images/macos/macos-12-Readme.md
runs-on: macos-12
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "${{ env.XCODE_VERSION }}"
- run: |
npm install
mkdir -p ./Resources/WebDriverAgent.bundle
name: Install dev dependencies
- run: |
target_sim_id=$(xcrun simctl list devices available | grep "$DEVICE_NAME (" | cut -d "(" -f2 | cut -d ")" -f1)
open -Fn "$(xcode-select -p)/Applications/Simulator.app"
xcrun simctl bootstatus $target_sim_id -b
name: Preboot Simulator
- run: npm run e2e-test
name: Run functional tests
15 changes: 15 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Conventional Commits
on:
pull_request:


jobs:
lint:
name: https://www.conventionalcommits.org
runs-on: ubuntu-latest
steps:
- uses: beemojs/conventional-pr-action@v2
with:
config-preset: angular
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64 changes: 55 additions & 9 deletions .github/workflows/publish.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,67 @@ on:

jobs:
build:
runs-on: macos-latest
runs-on: macos-13

env:
XCODE_VERSION: 14.3.1
ZIP_PKG_NAME_IOS: "WebDriverAgentRunner-Runner.zip"
PKG_PATH_IOS: "appium_wda_ios"
ZIP_PKG_NAME_TVOS: "WebDriverAgentRunner_tvOS-Runner.zip"
PKG_PATH_TVOS: "appium_wda_tvos"

steps:
- uses: actions/checkout@v2
- name: Use Node.js 16.x
uses: actions/setup-node@v1
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: maxim-lobanov/setup-xcode@v1
with:
node-version: 16.x
- run: |
npm install -g appium@next
npm install --no-package-lock
xcode-version: "${{ env.XCODE_VERSION }}"
- run: npm install --no-package-lock
name: Install dev dependencies
- run: npm test
name: Run NPM Test
- run: npm run build
name: Run build
- run: npm run test
name: Run test

# building WDA packages
- name: Build iOS
run: |
xcodebuild clean build-for-testing \
-project WebDriverAgent.xcodeproj \
-derivedDataPath $PKG_PATH_IOS \
-scheme WebDriverAgentRunner \
-destination generic/platform=iOS \
CODE_SIGNING_ALLOWED=NO ARCHS=arm64
- name: Creating a zip of WebDriverAgentRunner-Runner.app for iOS after removing test frameworks
run: |
pushd appium_wda_ios/Build/Products/Debug-iphoneos
rm -rf WebDriverAgentRunner-Runner.app/Frameworks/XC*.framework
zip -r $ZIP_PKG_NAME_IOS WebDriverAgentRunner-Runner.app
popd
mv $PKG_PATH_IOS/Build/Products/Debug-iphoneos/$ZIP_PKG_NAME_IOS ./
- name: Build tvOS
run: |
xcodebuild clean build-for-testing \
-project WebDriverAgent.xcodeproj \
-derivedDataPath $PKG_PATH_TVOS \
-scheme WebDriverAgentRunner_tvOS \
-destination generic/platform=tvOS \
CODE_SIGNING_ALLOWED=NO ARCHS=arm64
- name: Creating a zip of WebDriverAgentRunner-Runner.app for tvOS after removing test frameworks
run: |
pushd appium_wda_tvos/Build/Products/Debug-appletvos
rm -rf WebDriverAgentRunner_tvOS-Runner.app/Frameworks/XC*.framework
zip -r $ZIP_PKG_NAME_TVOS WebDriverAgentRunner_tvOS-Runner.app
popd
mv $PKG_PATH_TVOS/Build/Products/Debug-appletvos/$ZIP_PKG_NAME_TVOS ./
# release tasks
- run: npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
name: Release

33 changes: 33 additions & 0 deletions .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Unit Tests

on: [pull_request, push]


jobs:
prepare_matrix:
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.generate-matrix.outputs.versions }}
steps:
- name: Select 3 most recent LTS versions of Node.js
id: generate-matrix
run: echo "versions=$(curl -s https://endoflife.date/api/nodejs.json | jq -c '[[.[] | select(.lts != false)][:3] | .[].cycle | tonumber]')" >> "$GITHUB_OUTPUT"

test:
needs:
- prepare_matrix
strategy:
matrix:
node-version: ${{ fromJSON(needs.prepare_matrix.outputs.versions) }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install --no-package-lock
name: Install dev dependencies
- run: npm run lint
name: Run linter
- run: npm run test
name: Run unit tests
Loading

0 comments on commit 6974d17

Please sign in to comment.