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

[TEST] Automatic screenshots comparing and error checking in IE11, Firefox and Chrome #715

Merged
merged 74 commits into from Nov 2, 2019

Conversation

tinovyatkin
Copy link
Contributor

@tinovyatkin tinovyatkin commented Oct 28, 2019

Visual regressions (like #702 ) are very hard to track without automatic tools in place.
This PR adds one small GitHub Action that automatically loads demo page from local sources, opens one instance of Choices, makes screenshots in Internet Explorer 11, Firefox (on Windows and MacOs, as they are different) and Chrome (via Puppeteer) and compares them against base snapshots using pixelmatch.
If a something is not matching snapshot then a contributor will be able to download current screenshot as well as diff.
Screenshot 2019-10-28 at 16 28 51

Screenshot 2019-10-28 at 14 28 31

So, every PR that makes a visible changes will had to come with new snapshots making it very easy for visual review too.

On Chrome we also verifying that whole demo page is loading without errors nor console.error output.

No dependencies are adding to the project itself, all required dependencies are installing on demand at GitHub Actions (I think we should do the same with bundlesizes too).

🎉

@jshjohnson purposely didn't fixup all commits to show that it was easy 😄

PS: Had to add .gitattributes to be able to build on Windows
PS1: Unfortunately, Safari on GitHub Actions is not configured for remote automation, so, had to left that for future improvements.

@tinovyatkin tinovyatkin changed the title [TESTS] Automatic screenshots comparing and error checking in IE, Firefox and Chrome [TEST] Automatic screenshots comparing and error checking in IE, Firefox and Chrome Oct 28, 2019
@tinovyatkin tinovyatkin changed the title [TEST] Automatic screenshots comparing and error checking in IE, Firefox and Chrome [TEST] Automatic screenshots comparing and error checking in IE11, Firefox and Chrome Oct 28, 2019
@jshjohnson jshjohnson added the chore Pull request that does not change core code label Oct 30, 2019
await once(server, 'listening');
return server;
}
module.exports = launchServer;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it not possible to utilise server.js? It seems to be doing the same thing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it's possible, it just looks a little bit overblown (with WebPack middlewares and test endpoint) for me for the task. I will submit an update later.

@tinovyatkin
Copy link
Contributor Author

tinovyatkin commented Nov 1, 2019

@jshjohnson this is done. Test in IE11 is failing, because the actual page is failing - see #732 and #733. You can merge this first to see which PR will finally fix IE11 😄

@jshjohnson jshjohnson merged commit dddba5b into Choices-js:master Nov 2, 2019
@jshjohnson
Copy link
Collaborator

Thanks for this! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Pull request that does not change core code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants