Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When running from "inherited" config file, browser.checkElement(etc) does not produce screenshot #65

Open
aliu145 opened this issue Mar 14, 2018 · 5 comments

Comments

@aliu145
Copy link

aliu145 commented Mar 14, 2018

I have 2 config files which "inherit" from a main config file that contain certain specific specs (i.e. setup like here). When I run from these "inherited" config files, even if I copy the required wdio-visual-regression config into these files, the browser.check____ do not produce screenshots (return undefined). However, if I run from the main "parent" config file, it does work. Do you know why this may be and how I can make the visual regression service work with inheriting from a main config file?

@aliu145 aliu145 closed this as completed Mar 14, 2018
@aliu145 aliu145 reopened this Mar 14, 2018
@emilyrohrbough
Copy link

Do you have an example of your configuration?

@tnypxl
Copy link

tnypxl commented Jun 11, 2018

@emilyrohrbough @zinserjan She already provided an example linked in her comment. The issue occurs when you use the deepmerge package to inherit default configs. For whatever reason it runs the tests, but it doesn't produce any screenshots and compare functions are not attached to the browser instance causing them to be undefined.

But if I create the same exact config without using deepmerge, it works fine. Just kind of a bummer that a special case has to be made for this package.

@Gary-Osteen-Q2
Copy link

I've run into this last week after I had to refactor to support visual regressions and multiremote style configs. I created a base config and then modify it for once for single browser tests and once for multi-browser. Now the single can't do screen compares because of the deepmerge issue. If I leave it in the base config, it errors out when running the multiremote setup.

I don't want to make two big config files just combat this issue when only 1 things changes between the config files. I might do that for the time being, though it would be nice if wdio-v-r supported both formats for capabilities styles or worked with deepmerge. Maybe the real issue is hidden in deepmerge and we need to merge config files a different way.

@soduor
Copy link

soduor commented Dec 19, 2018

@tnypxl what package did you use instead of deepmerge? facing exact same issue.

@tnypxl
Copy link

tnypxl commented Dec 19, 2018

@soduor I didn't use an alternative or anything. I basically just made a contraption with Object.assign. I have one "default" and then just import and overwrite them in subsequent config files. Its not as elegant as deepmerge and I lose some of the DRYness, but it saves enough copying and pasting that I don't mind it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants