Andy Wyatt
Andy Wyatt

Reputation: 11

How to specify axeDevToolsMobile plugin to WebdriverIO appium service?

The symptoms of my issue is that when I call axe:scan I get the following messages returned to the console:

2024-07-03T12:57:29.185Z DEBUG webdriver: request failed due to response error: unknown method
[0-0] 2024-07-03T12:57:29.185Z WARN webdriver: Request failed with status 405 due to Method is not implemented

The same call works fine on a different non-WDIO project where I started my appium server explicitly with this command:

appium --use-plugins=axeDevToolsMobile

BUT I can reproduce the above errors in the non-WDIO project if I launch appium without specifying the plugin name.

I have a series of config files that permit execution in a variety of platforms but I focussed on the config file where I specify the parameters for the local appium service. Here's the latest version of that file:

import {config} from './wdio.shared.conf';

// ===================
// Test Configurations
// ===================
//
config.services = [
    [
        'appium',
        {
            command: 'appium',
            usePlugins: 'axeDevToolsMobile',
            port: 4723,
        },
    ],
];

export default config;

I do have a valid Deque Axe Mobile API key and the code extracts from my spec file are:

const axeSettings = {
    apiKey: process.env.AXE_MOBILE_API_KEY,// axe API key, required by axe DevTools Mobile
}

and my call to scan using Axe Mobile:

await driver.execute('axe:scan', axeSettings);

which is the command that gives rise to the errors in the WDIO example - but work fine in my non-WDIO sample...

UPDATE - 4th July @ 10:10UK please see the following extract from the Appium log which confirms my hunch that the plugin is not being loaded:

[38;5;112m[Appium][0m   - [email protected] (automationName 'Chromium')
[38;5;112m[Appium][0m Available plugins:
[38;5;112m[Appium][0m   - [email protected]
[38;5;112m[Appium][0m No plugins activated. Use the --use-plugins flag with names of plugins to activate

So I think my question is - how to get the WDIO Appium service to load this plugin at startup?

Upvotes: 1

Views: 71

Answers (0)

Related Questions