Closed g-farrow closed 3 years ago
Hi there 👋
Thanks for raising this! I'll look into it as soon as I can, probably later today 😄
We use stub types internally to support multiple versions of wdio at once, it looks like the type for execute is incompatible with v7.12.1. I think the type of that stub is just too specific to one version so it should just be a case making it a little looser.
I'll let you know how I get on 👍
Btw do you have a link to a public repo I can look at so I can replicate your setup? Or your tsconfig would also be useful if not 😁
hi @olivierwilkinson - thanks for responding. I have put together https://github.com/g-farrow/test-appium-project as an example. npm i
followed by npm run test
should show the error I am seeing.
hi @olivierwilkinson - thanks for responding. I have put together https://github.com/g-farrow/test-appium-project as an example.
npm i
followed bynpm run test
should show the error I am seeing.
Ah brilliant thank you very much for doing that! I'll have a look as soon as I can 👍
@g-farrow just wanted to let you know I've found the issue, thanks for the repo it made it much easier to track down! I'll raise a PR with an explanation and a fix later today after work. 👍
:tada: This issue has been resolved in version 3.0.4 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
@g-farrow I merged the PR since I was pretty confident it at least fixes a related problem. Let me know if it still doesn't work for you with v3.0.4 and I'll reopen this or create a new issue 👍.
Thanks again for raising this!
Hi @olivierwilkinson thanks for the fix.
However, I'm now seeing a whole bunch of different typescript errors. I have bumped all deps in that project to the latest versions and now I get this:
node_modules/@wdio/mocha-framework/node_modules/@wdio/types/build/index.d.ts:23:13 - error TS2374: Duplicate index signature for type 'string'.
23 [key: string]: any;
~~~~~~~~~~~~~~~~~~~
node_modules/@wdio/mocha-framework/node_modules/@wdio/types/build/index.d.ts:26:13 - error TS2374: Duplicate index signature for type 'string'.
26 [key: string]: any;
~~~~~~~~~~~~~~~~~~~
node_modules/@wdio/mocha-framework/node_modules/@wdio/types/build/index.d.ts:29:13 - error TS2374: Duplicate index signature for type 'string'.
29 [key: string]: any;
~~~~~~~~~~~~~~~~~~~
node_modules/@wdio/mocha-framework/node_modules/@wdio/types/build/index.d.ts:43:14 - error TS2300: Duplicate identifier 'Capabilities'.
43 type Capabilities = Capabilities.Capabilities;
~~~~~~~~~~~~
node_modules/@wdio/types/build/index.d.ts:43:14
43 type Capabilities = Capabilities.Capabilities;
~~~~~~~~~~~~
'Capabilities' was also declared here.
node_modules/@wdio/mocha-framework/node_modules/@wdio/types/build/index.d.ts:44:14 - error TS2300: Duplicate identifier 'DesiredCapabilities'.
44 type DesiredCapabilities = Capabilities.DesiredCapabilities;
~~~~~~~~~~~~~~~~~~~
node_modules/@wdio/types/build/index.d.ts:44:14
44 type DesiredCapabilities = Capabilities.DesiredCapabilities;
~~~~~~~~~~~~~~~~~~~
'DesiredCapabilities' was also declared here.
node_modules/@wdio/types/build/index.d.ts:23:13 - error TS2374: Duplicate index signature for type 'string'.
23 [key: string]: any;
~~~~~~~~~~~~~~~~~~~
node_modules/@wdio/types/build/index.d.ts:26:13 - error TS2374: Duplicate index signature for type 'string'.
26 [key: string]: any;
~~~~~~~~~~~~~~~~~~~
node_modules/@wdio/types/build/index.d.ts:29:13 - error TS2374: Duplicate index signature for type 'string'.
29 [key: string]: any;
~~~~~~~~~~~~~~~~~~~
node_modules/@wdio/types/build/index.d.ts:35:19 - error TS2320: Interface 'Config' cannot simultaneously extend types 'Testrunner' and 'Testrunner'.
Named property 'after' of types 'Testrunner' and 'Testrunner' are not identical.
35 interface Config extends Options.Testrunner {
~~~~~~
node_modules/@wdio/types/build/index.d.ts:35:19 - error TS2320: Interface 'Config' cannot simultaneously extend types 'Testrunner' and 'Testrunner'.
Named property 'afterSession' of types 'Testrunner' and 'Testrunner' are not identical.
35 interface Config extends Options.Testrunner {
~~~~~~
node_modules/@wdio/types/build/index.d.ts:35:19 - error TS2320: Interface 'Config' cannot simultaneously extend types 'Testrunner' and 'Testrunner'.
Named property 'before' of types 'Testrunner' and 'Testrunner' are not identical.
35 interface Config extends Options.Testrunner {
~~~~~~
node_modules/@wdio/types/build/index.d.ts:35:19 - error TS2320: Interface 'Config' cannot simultaneously extend types 'Testrunner' and 'Testrunner'.
Named property 'beforeSession' of types 'Testrunner' and 'Testrunner' are not identical.
35 interface Config extends Options.Testrunner {
~~~~~~
node_modules/@wdio/types/build/index.d.ts:35:19 - error TS2320: Interface 'Config' cannot simultaneously extend types 'Testrunner' and 'Testrunner'.
Named property 'capabilities' of types 'Testrunner' and 'Testrunner' are not identical.
35 interface Config extends Options.Testrunner {
~~~~~~
node_modules/@wdio/types/build/index.d.ts:35:19 - error TS2320: Interface 'Config' cannot simultaneously extend types 'Testrunner' and 'Testrunner'.
Named property 'onComplete' of types 'Testrunner' and 'Testrunner' are not identical.
35 interface Config extends Options.Testrunner {
~~~~~~
node_modules/@wdio/types/build/index.d.ts:35:19 - error TS2320: Interface 'Config' cannot simultaneously extend types 'Testrunner' and 'Testrunner'.
Named property 'onPrepare' of types 'Testrunner' and 'Testrunner' are not identical.
35 interface Config extends Options.Testrunner {
~~~~~~
node_modules/@wdio/types/build/index.d.ts:35:19 - error TS2320: Interface 'Config' cannot simultaneously extend types 'Testrunner' and 'Testrunner'.
Named property 'onWorkerStart' of types 'Testrunner' and 'Testrunner' are not identical.
35 interface Config extends Options.Testrunner {
~~~~~~
node_modules/@wdio/types/build/index.d.ts:35:19 - error TS2320: Interface 'Config' cannot simultaneously extend types 'Testrunner' and 'Testrunner'.
Named property 'services' of types 'Testrunner' and 'Testrunner' are not identical.
35 interface Config extends Options.Testrunner {
~~~~~~
node_modules/@wdio/types/build/index.d.ts:43:14 - error TS2300: Duplicate identifier 'Capabilities'.
43 type Capabilities = Capabilities.Capabilities;
~~~~~~~~~~~~
node_modules/@wdio/mocha-framework/node_modules/@wdio/types/build/index.d.ts:43:14
43 type Capabilities = Capabilities.Capabilities;
~~~~~~~~~~~~
'Capabilities' was also declared here.
node_modules/@wdio/types/build/index.d.ts:44:14 - error TS2300: Duplicate identifier 'DesiredCapabilities'.
44 type DesiredCapabilities = Capabilities.DesiredCapabilities;
~~~~~~~~~~~~~~~~~~~
node_modules/@wdio/mocha-framework/node_modules/@wdio/types/build/index.d.ts:44:14
44 type DesiredCapabilities = Capabilities.DesiredCapabilities;
~~~~~~~~~~~~~~~~~~~
'DesiredCapabilities' was also declared here.
I have pushed up those changes so you should be able to pull and see the errors yourself.
@g-farrow I think that is a problem in the @wdio/mocha-framework package, possibly with the version of Typescript installed? I'm not sure entirely. I raised a PR into your test-appium-project though which fixes the compilation, if you want to talk through anything else that comes up I'm more than happy to do that on the PR 😄
Confirmed this works, thanks @olivierwilkinson
I am trying to add the @testing-library/webdriverio to my typescript project. However, it is causing the following type errors:
My package.json looks like this:
I'm guessing that there is a conflicting type version between
webdriverio
and the testing library but I don't know how to resolve it.Any ideas?