Skip to content

Commit

Permalink
Document appium deque integration using the axe devtools for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
bahrimootaz committed Nov 18, 2024
1 parent cd2fdbc commit ece3e95
Showing 1 changed file with 129 additions and 1 deletion.
130 changes: 129 additions & 1 deletion docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,139 @@ the Deque team, enabling seamless integration of accessibility scans into your e
You can find more details on Sauce Labs' [Appium versions documentation](/mobile-apps/automated-testing/appium/appium-versions/#appium-2x).

Check warning on line 36 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L36

[sauce.WordList] Use 'Appium' instead of 'appium'.
Raw output
{"message": "[sauce.WordList] Use 'Appium' instead of 'appium'.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 36, "column": 105}}}, "severity": "WARNING"}

## Key Features of `appium2-deque-accessibility`

- ****Includes Deque Drivers :**** This version incorporates the following accessibility drivers developed by Deque:
- [axe-appium-xcuitest-driver](https://docs.deque.com/devtools-mobile/2024.9.18/en/appium-setup#configure-your-tests): Automation name is `AxeXCUITEST`
- [axe-appium-uiautomator2-driver](https://docs.deque.com/devtools-mobile/2024.9.18/en/appium-setup#configure-your-tests): Automation name is `AxeUIAutomator2`
- [axe-appium-xcuitest-driver](https://docs.deque.com/devtools-mobile/2024.9.18/en/appium-setup#configure-your-tests): Automation name is `AxeXCUITEST`
:::info Min iOS Version for `axe-appium-xcuitest-driver`:
- You can use the `axe-appium-xcuitest-driver` only for devices with iOS 17 or above.
:::
- ****Backward Compatibility with Deprecated Plugin:**** While Deque’s [axeDevToolsMobile Appium Plugin](https://docs.deque.com/devtools-mobile/2024.2.14/en/june-2024-3)

Check warning on line 46 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L46

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 46, "column": 171}}}, "severity": "WARNING"}
has been deprecated, Sauce Labs will continue hosting it until January 31st, allowing users time to migrate to the new drivers.
- ****Powered by Appium :**** This version is built on version [2.12.1](https://github.com/appium/appium/releases/tag/appium%402.12.1) of appium,

Check warning on line 48 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L48

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 48, "column": 146}}}, "severity": "WARNING"}
ensuring the latest Appium features and compatibility enhancements.

## How to Use `appium2-deque-accessibility`

Check warning on line 51 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L51

[sauce.Headings] 'How to Use ***************************' should use title case capitalization.
Raw output
{"message": "[sauce.Headings] 'How to Use ***************************' should use title case capitalization.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 51, "column": 1}}}, "severity": "WARNING"}

Follow these steps to set up and execute accessibility tests using the `appium2-deque-accessibility` image, leveraging Deque's Appium drivers for Android and iOS.

Check warning on line 53 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L53

[sauce.Inclusivity] Avoid problematic language. Use 'run' instead of 'execute'.
Raw output
{"message": "[sauce.Inclusivity] Avoid problematic language. Use 'run' instead of 'execute'.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 53, "column": 34}}}, "severity": "WARNING"}

1. Set Up Your Appium Capabilities

<Tabs
groupId="appium2-deque-accessibility"
defaultValue="AxeUIAutomator2"
values={[
{label: 'AxeUIAutomator2', value: 'AxeUIAutomator2'},
{label: 'AxeXCUITEST', value: 'AxeXCUITEST'},
]}>

<TabItem value="AxeUIAutomator2">

<!-- prettier-ignore -->
```js
const capabilities = {
platformName: 'Android',
'appium:platformVersion': '1[0-9]',
'appium:automationName': 'AxeUIAutomator2', // New Automation name goes here

Check warning on line 72 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L72

[sauce.MeaningfulLinkWords] Improve SEO and accessibility by rewriting 'here' in the link text.
Raw output
{"message": "[sauce.MeaningfulLinkWords] Improve SEO and accessibility by rewriting 'here' in the link text.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 72, "column": 75}}}, "severity": "WARNING"}
'appium:app': 'storage:filename=XXXXXXXXXx',
'appium:appPackage': 'xxxxxxxxxx',
'appium:autoGrantPermissions': true,
'appium:autoAcceptAlerts': true,
'appium:newCommandTimeout': 90,
'sauce:options': {
name: "Android Driver - Testing appium2-deque-accessibility",
appiumVersion: 'appium2-deque-accessibility',
},
}
```
</TabItem>
<TabItem value="AxeXCUITEST">

<!-- prettier-ignore -->
```js
const capabilities = {
platformName: 'iOS',
'appium:platformVersion': '^1(7|8).*$', // The ios Drvier will work only on ios 17 devices and above
'appium:automationName': 'AxeXCUITEST', // New Automation name goes here

Check warning on line 92 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L92

[sauce.MeaningfulLinkWords] Improve SEO and accessibility by rewriting 'here' in the link text.
Raw output
{"message": "[sauce.MeaningfulLinkWords] Improve SEO and accessibility by rewriting 'here' in the link text.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 92, "column": 71}}}, "severity": "WARNING"}
'appium:app': 'storage:filename=XXXXXXXXXx',
'appium:appPackage': 'xxxxxxxxxx',
'appium:autoGrantPermissions': true,
'appium:autoAcceptAlerts': true,
'appium:newCommandTimeout': 90,
'sauce:options': {
name: "iOS Driver - Testing appium2-deque-accessibility",
resigningEnabled: true,
appiumVersion: 'appium2-deque-accessibility',
},
}
```
</TabItem>

</Tabs>

2. Obtain Your Deque API Key
Log in to your [axe Deque account setting page](https://axe.deque.com/settings) and retrieve your API key.

Check warning on line 110 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L110

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 110, "column": 107}}}, "severity": "WARNING"}
This key is required to authenticate and initiate accessibility scans during your tests.

3. Prepare Your Testing Script
Once you have your API key, include it in your test script to perform a scan using the `mobile: axeScan` command. Below is an example script:

Check warning on line 114 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L114

[sauce.WordList] Use 'after you' instead of 'Once you'.
Raw output
{"message": "[sauce.WordList] Use 'after you' instead of 'Once you'.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 114, "column": 1}}}, "severity": "WARNING"}

```js
describe("Test appium2-deque-accessibility - Using Drivers Android/iOS", () => {
it('test appium2-deque-accessibility', async () => {

Check warning on line 118 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L118

[sauce.WordList] Use 'Appium' instead of 'appium'.
Raw output
{"message": "[sauce.WordList] Use 'Appium' instead of 'appium'.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 118, "column": 14}}}, "severity": "WARNING"}
const apiKey = process.env.DEQUE_API_KEY;
const settings = { apiKey: apiKey }

await driver.execute('mobile: axeScan', settings);
});
});
```
## Migrating from the Deprecated `axeDevToolsMobile` Plugin to Deque Drivers

Check warning on line 126 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L126

[sauce.Headings] 'Migrating from the Deprecated ***************** Plugin to Deque Drivers' should use title case capitalization.
Raw output
{"message": "[sauce.Headings] 'Migrating from the Deprecated ***************** Plugin to Deque Drivers' should use title case capitalization.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 126, "column": 1}}}, "severity": "WARNING"}

Deque's axeDevToolsMobile Appium Plugin is deprecated and will no longer be supported after January 31st. Moving forward,

Check warning on line 128 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L128

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 128, "column": 122}}}, "severity": "WARNING"}
the following drivers should be used to ensure compatibility and continued support for accessibility testing:

- Android: [axe-appium-uiautomator2-driver](https://docs.deque.com/devtools-mobile/2024.9.18/en/appium-setup#configure-your-tests): Automation name is `AxeUIAutomator2`
- iOS : [axe-appium-xcuitest-driver](https://docs.deque.com/devtools-mobile/2024.9.18/en/appium-setup#configure-your-tests): Automation name is `AxeXCUITEST`

Check warning on line 132 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L132

[sauce.WordList] Use 'Appium' instead of 'appium'.
Raw output
{"message": "[sauce.WordList] Use 'Appium' instead of 'appium'.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 132, "column": 14}}}, "severity": "WARNING"}

### Why Migrate?
- Continued Support: The plugin will no longer receive updates, fixes, or enhancements.
- Expanded Capabilities: The drivers offer better integration and updated functionalities for Android and iOS platforms.
- Compliance with Modern Requirements: For iOS, the new driver supports devices running iOS 17 and above.

### Migration Steps
1. ****Update Your Appium Capabilities****

Replace the old plugin reference with the appropriate new driver. Choose the correct automationName based on your platform:

Use `AxeUIAutomator2` for Android.
Use `AxeXCUITEST` for iOS.

Additionally, specify the appiumVersion as `appium2-deque-accessibility`.

```js
const capabilities = {
...,
'appium:automationName': 'AxeUIAutomator2', // For Android; use 'AxeXCUITEST' for iOS
...,
'sauce:options': {
...,
appiumVersion: 'appium2-deque-accessibility',
},
};
```
2. ****Update Your Testing Scripts****
The `axe:Scan` command used with the ****deprecated**** plugin should now be replaced with the new `mobile: axeScan` command.

Check warning on line 161 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L161

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 161, "column": 126}}}, "severity": "WARNING"}

This command works with the new drivers and requires the same API key setup.
```js
await driver.execute('mobile: axeScan', scanSettings);
```

## Additional Notes

- Ensure your Appium server is correctly set up to use the `appium2-deque-accessibility` version.

Check warning on line 170 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L170

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 170, "column": 98}}}, "severity": "WARNING"}
- Validate that your app and environment meet the OS version requirements for the selected Deque drivers.

Check warning on line 171 in docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md

View workflow job for this annotation

GitHub Actions / vale

[vale] docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md#L171

[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.
Raw output
{"message": "[sauce.EOLWhitespace] Remove whitespace characters from the end of the line.", "location": {"path": "docs/mobile-apps/automated-testing/appium/appium-2-deque-drivers.md", "range": {"start": {"line": 171, "column": 106}}}, "severity": "WARNING"}
- For iOS, remember that the AxeXCUITEST driver only works on devices running iOS 17 or later.
- The axeDevToolsMobile plugin will remain available in the Sauce Labs private cloud until January 31st.
- Use the Deque [documentation](https://docs.deque.com/devtools-mobile/2024.2.14/en/appium-setup) for further driver-specific details.

0 comments on commit ece3e95

Please sign in to comment.