wswebcreation / wdio-native-app-compare

A module to compare app screenshots for native apps
MIT License
37 stars 8 forks source link

Make service options optional in typings #41

Closed ablok closed 2 years ago

ablok commented 2 years ago

I found out that, even though the options are required by the service, they have to be made optional. If you load the service typings globally in tsconfig, which is the preferred way according to the WDIO docs, it will apply these typings to any wdio config which uses typescript. This leads to that every service definition with additional properties now requires you to add a 'baselineFolder' and 'screenshotPath' to the options.

edit: Also removed some invalid options

Sorry for the oversight on the first PR.

ablok commented 2 years ago

It's a bit confusing, because there are the docs, and then there are the JSDoc. These do not seem to match. I stuck to the docs now, I hope that's ok.

ablok commented 2 years ago

Hi @ablok

You are correct, this needs to be options, but:

  • is there a reason why you removed the output?

The output is mentioned nowhere in the documentation, it's only in the JSDoc of the compareScreen method. If I glimpse at the code, I don't think it is used. Let me know what you think.

  • can you also change the docs that the baselineFolder and screenshotPath become optional?

Thanks!

They are not optional. You need to set them otherwise the service doesn't work. It will throw an error that these need to be set. It's just the way the service typings in WDIO work that requires them to be optional in the typings. Suboptimal on the WDIO side.

wswebcreation commented 2 years ago

Hmm, it should not break and use a default location, see https://github.com/wswebcreation/wdio-native-app-compare/blob/main/lib/helpers/options.js#L16 With the docs I mean this https://github.com/wswebcreation/wdio-native-app-compare/blob/main/docs/OPTIONS.md

Are you experiencing differently?

ablok commented 2 years ago

Hmm, it should not break and use a default location, see https://github.com/wswebcreation/wdio-native-app-compare/blob/main/lib/helpers/options.js#L16 With the docs I mean this https://github.com/wswebcreation/wdio-native-app-compare/blob/main/docs/OPTIONS.md

Are you experiencing differently?

You are correct. Changed docs.