Adding tests for appium iOS#58
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces comprehensive Appium test automation for the axe DevTools iOS Sample App, including support for both Appium 2.x and 3.x with @axe-devtools custom XCUITest drivers.
Key changes:
- Adds a complete Appium test suite covering app launch, tab navigation, home screen functionality, and accessibility testing
- Implements helper utilities and selectors for maintainable test code
- Includes GitHub Actions workflow for automated testing with multiple driver versions
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| appium-tests/test/specs/tab-navigation.spec.js | Tests for navigating between tabs and verifying tab state persistence |
| appium-tests/test/specs/home-screen.spec.js | Tests for home screen elements, search bar, and scrolling functionality |
| appium-tests/test/specs/app-launch.spec.js | Tests verifying successful app launch and initial UI state |
| appium-tests/test/specs/accessibility.spec.js | Tests for accessibility labels, touch targets, and screen navigation accessibility |
| appium-tests/test/helpers/utils.js | Utility functions for element interactions, waits, and screenshot capture |
| appium-tests/test/helpers/selectors.js | Centralized element selectors using XCUITest accessibility identifiers |
| appium-tests/package.json | Project dependencies and test scripts configuration |
| appium-tests/config/wdio.appium3.conf.js | WebDriverIO configuration for Appium 3.x |
| appium-tests/config/wdio.appium2.conf.js | WebDriverIO configuration for Appium 2.x with appium service setup |
| appium-tests/README.md | Comprehensive documentation for setup, running tests, and troubleshooting |
| appium-tests/.gitignore | Excludes test outputs, dependencies, and IDE files from version control |
| .github/workflows/ios-appium-tests.yml | CI/CD workflow for building the app and running tests with multiple driver versions |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| if (i === retries - 1) { | ||
| throw error; | ||
| } | ||
| await driver.pause(1000); |
There was a problem hiding this comment.
Hard-coded wait time of 1000ms between retry attempts. Consider making this configurable via a parameter or constant to allow flexibility in different test environments where network or system performance may vary.
| * Get app state | ||
| * @returns {number} App state | ||
| */ | ||
| async getAppState() { | ||
| return await driver.execute('mobile: queryAppState', { | ||
| bundleId: 'com.deque.axe-devtools-ios-sample-app' |
There was a problem hiding this comment.
The bundle ID is hard-coded in the utils module. Consider making this configurable through environment variables or a configuration file to improve flexibility when testing different apps or build configurations.
| * Get app state | |
| * @returns {number} App state | |
| */ | |
| async getAppState() { | |
| return await driver.execute('mobile: queryAppState', { | |
| bundleId: 'com.deque.axe-devtools-ios-sample-app' | |
| * Get the app bundle ID, allowing override via environment variable. | |
| * @returns {string} Bundle ID | |
| */ | |
| getBundleId() { | |
| return process.env.IOS_BUNDLE_ID || 'com.deque.axe-devtools-ios-sample-app'; | |
| } | |
| /** | |
| * Get app state | |
| * @returns {number} App state | |
| */ | |
| async getAppState() { | |
| return await driver.execute('mobile: queryAppState', { | |
| bundleId: this.getBundleId() |
| 'appium:platformVersion': process.env.IOS_VERSION || '17.5', | ||
| 'appium:deviceName': process.env.DEVICE_NAME || 'iPhone 15 Pro', |
There was a problem hiding this comment.
The default iOS version 17.5 and device 'iPhone 15 Pro' should be documented in a central location or configuration file to ensure consistency across both Appium 2 and Appium 3 configurations, as they are duplicated in wdio.appium2.conf.js.
| npm config set "@deque:registry" "https:${{ env.AGORA_REGISTRY_URL }}" | ||
| npm config set "@axe-devtools:registry" "https:${{ env.AGORA_REGISTRY_URL }}" | ||
| npm config set "${{ env.AGORA_REGISTRY_URL }}:email" "${{ env.AGORA_NPM_EMAIL }}" | ||
| npm config set "${{ env.AGORA_REGISTRY_URL }}:_auth" "${{ env.AGORA_NPM_AUTH }}" |
There was a problem hiding this comment.
Inconsistent npm authentication configuration between Appium 2 and Appium 3 test jobs. Line 159 uses :_authToken while line 322 uses :_auth. This inconsistency could cause authentication failures. Both should use the same authentication field.
| npm config set "${{ env.AGORA_REGISTRY_URL }}:_auth" "${{ env.AGORA_NPM_AUTH }}" | |
| npm config set "${{ env.AGORA_REGISTRY_URL }}:_authToken" "${{ env.AGORA_NPM_AUTH }}" |
No description provided.