Skip to content

[🐛 Bug]: Type 'string' is not assignable to type 'WebdriverIO' #10286

@noahgregory-avanade

Description

@noahgregory-avanade

Have you read the Contributing Guidelines on issues?

WebdriverIO Version

2.0.0-beta.66

Node.js Version

19.8.1

Mode

Standalone Mode

Which capabilities are you using?

{
    platformName: 'Android',
    'appium:automationName': 'UiAutomator2',
    'appium:appPackage': 'com.android.settings',
    'appium:appActivity': '.Settings'
}

What happened?

Using the above capabilities with TypeScript 5.0.2 results in the type error Type 'string' is not assignable to type 'WebdriverIO'. for each key of the capabilities. Removing the appium:appActivity key resolves this issue.

It appears that:

  • the appium:appActivity key is not in the type(s) for capabilities, and
  • the type(s) for capabilities, for some reason, start to enforce a key type of WebdriverIO if an unfamiliar key is present

What is your expected behavior?

There is no type error.

How to reproduce the bug.

Use the following code:

import type { RemoteOptions } from 'webdriverio';

import { remote } from "webdriverio";

const capabilities: RemoteOptions['capabilities'] = {
    platformName: 'Android',
    'appium:automationName': 'UiAutomator2',
    'appium:appPackage': 'com.android.settings',
    'appium:appActivity': '.Settings',
}

const remoteOpts: RemoteOptions = {
    hostname: '0.0.0.0',
    port: 4723,
    capabilities,
}

const sampleTest = async () => {
    const driver = await remote(remoteOpts);
    console.info(driver);
}

sampleTest();

Relevant log output

N/A

Code of Conduct

  • I agree to follow this project's Code of Conduct

Is there an existing issue for this?

  • I have searched the existing issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug 🐛good first picka reasonable task to start getting familiar with the code basehelp wantedIssues that are free to take by anyone interested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions