Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Handling click events and screenshots with Niffy #7

Open
alexjtark opened this issue Jul 21, 2017 · 1 comment
Open

Handling click events and screenshots with Niffy #7

alexjtark opened this issue Jul 21, 2017 · 1 comment

Comments

@alexjtark
Copy link

Trying to work out how to do this given the limited documentation currently.
Im aiming to run the Niffy screenshot on page load, then do some page interaction (ex: open a menu), and take a new screenshot at that moment so in the end i will have 2 screenshots of the page to compare against my base screenshots of those same instances.

Im assuming some nightmare API interaction will be needed but just hoping I could get some wisdom on how to do it.

Thank you.

@jessehattabaugh
Copy link

jessehattabaugh commented Aug 1, 2017

Newb-leading-the-newb here, but it seems that the callback to test() and goto() gets the Nightmare object as an argument. You can then call Nightmare methods (which return Promises) on it. The example here https://github.com/segmentio/niffy#gotourl-fn does this in the before, but I believe you can do it in a test case too.

I'd be curious to hear whether manipulating the Nightmare instance in these callbacks affects subsequent tests. Maybe the maintainers have some advice?

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

No branches or pull requests

2 participants