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

Use chromy v0.5.7 #606

Closed
VladimirPittner opened this issue Nov 27, 2017 · 18 comments
Closed

Use chromy v0.5.7 #606

VladimirPittner opened this issue Nov 27, 2017 · 18 comments

Comments

@VladimirPittner
Copy link

Please would it be possible to set dependency for chromy: ^0.5.7 instead of 0.5.5 ?

The new Chromy https://github.com/OnetapInc/chromy/blob/master/CHANGELOG.md supports passing arguments in .evaluate().

Thanks.

@garris
Copy link
Owner

garris commented Dec 1, 2017

Sorry for the delay. Yes, I am happy to upgrade. I am just very very short on time. To upgrade we need to ensure that the new version behaves as expected when running test/configs/backstop_features.js

@ackmanx
Copy link

ackmanx commented Dec 12, 2017

Is there a way for us to manually upgrade chromy ourselves and then run backstop_features.js to see if it works? Could I do this within my node_modules/backstopjs?

@VladimirPittner
Copy link
Author

@garris sorry for the respond, been busy too. Unfortunately I was experiencing some funny unwanted console outputs with BackstopJS 3.0.32 and ChromyJS 0.5.7, so I cant say its working as expected 100% :/, and did not really had time to look into what might be the cause.

@ackmanx yes I guess you can manually install newer version of ChromyJS, either with command or changing the package.json of your project and run npm install.

@garris
Copy link
Owner

garris commented Dec 12, 2017

@ackmanx Yes, @VladimirPittner is correct ^^^ You can change the chromy version number in package.json then run npm install from your backstop directory.

@VladimirPittner
Copy link
Author

@ackmanx actually to be more specific you will have to do it in the nodemodules/backstopjs folder, because backstopjs have its own nodemodules and package.json

@kiran-redhat
Copy link
Contributor

I had no problems using 0.5.6. But 0.5.7 getting hanged soon after logging 9224 Chrome v64 detected.

@garris
Copy link
Owner

garris commented Dec 13, 2017

Oh bummer. Really? Is there a Chromy changelog?

@kiran-redhat
Copy link
Contributor

I had no problems using 0.5.6.

But chromy 0.5.7 failing with compare | Chromy error: GotoTimeoutError. See scenario – <scenario name> and not creating test screenshots. Chromy 0.5.7 accepting arguments in evaluate function as per below:
image

@VladimirPittner
Copy link
Author

@kiran-redhat how do you pass the arguments to evaluate now? Maybe there might be some backward compatibility issue.

This is example of how I pass the arguments before and now:
0.5.5

.chromy
        .evaluate(`
            _url = '${url}'
        `)
        .evaluate(() => {
            return document.baseURI.match(new RegExp(_url)) !== null;
        })

0.5.7

.chromy
        .evaluate((_url) => {
            return document.baseURI.match(new RegExp(_url)) !== null;
        }, [url])

I am not getting any errors in scenarios but it does output the function call to console for some reason.

9222 INFO >  BackstopTools have been installed.
function anonymous() {

        return ((_url) => {
            return document.baseURI.match(new RegExp(_url)) !== null;
        }).apply(this, Array.from(arguments).concat(["censored"].map(function (parameter) {
          return JSON.parse(parameter)
        })))

}

@kiran-redhat
Copy link
Contributor

Update: Created a clean branch with BS 3.0.36 and Chromy 0.5.7(https://github.com/kiran-redhat/BackstopJS/tree/bs36-chromy57)

I've tested following these steps all steps passed:

  1. Clone: https://github.com/kiran-redhat/BackstopJS/tree/bs36-chromy57
  2. npm i
  3. cli/index.js init
  4. cli/index.js test
  5. cli/index.js approve
  6. cli/index.js test

@VladimirPittner , I haven't changed anything from chromy 0.5.5 to 0.5.7 in evaluate. I used in following way:

module.exports = function (chromy, scenario, vp) { let path = require('path'); let absolutePath = path.resolve(path.basename(__filename)); return chromy .evaluate(`_absolutePath = '${absolutePath}', _scenario = '${scenario.label}', _vpLabel = '${vp.label}'`) .evaluate(function () { console.log(`'${_absolutePath}' successful for : '${_scenario}' on viewport: '${_vpLabel}'`); }); }

@garris
Copy link
Owner

garris commented Dec 14, 2017

@kiran-redhat Just to be sure, when you test, please also run the sanity check here...
https://github.com/garris/BackstopJS/blob/master/README.md#there-is-a-backstopjs-sanity-check

@kiran-redhat
Copy link
Contributor

@garris sanity tests passed as well, here is the PR: #615

@garris
Copy link
Owner

garris commented Dec 14, 2017

That’s great — thank you very much for testing!

@garris
Copy link
Owner

garris commented Dec 14, 2017

Merged #615

@garris garris closed this as completed Dec 14, 2017
@garris
Copy link
Owner

garris commented Dec 14, 2017

I should be able to push to npm on Friday.

@ackmanx
Copy link

ackmanx commented Dec 18, 2017

Did this get pushed to npm? npm says the current version is 3.0.36, which the same as package.json here on GitHub. When I npm install the 3.0.36 though, Chromy is using 0.5.5 according to the backstopjs package.json in my node_modules.

@garris
Copy link
Owner

garris commented Dec 18, 2017

Hi @ackmanx -- many apologies. No -- I had to help with another project with a year-end deadline -- so I did not get to review. I will update this thread when I finally get to test and push.

In the meantime -- your project is probably installing 0.5.5 because you updated your package.json file?

@ackmanx
Copy link

ackmanx commented Dec 18, 2017

My package.json is "backstopjs": "3.0.36" but I haven't edited any chromy versions manually so it is still 0.5.5 and not 0.5.7 (I wiped node_modules and did a fresh install). I could update it as described above, but for the time being I put that ticket on hold. I don't want to cause other devs' tests from failing. No rush on my end with the update :)

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

4 participants