Skip to content
This repository has been archived by the owner on Dec 30, 2022. It is now read-only.

tests(visual): add Argos CI #130

Merged
merged 1 commit into from
Jun 22, 2017
Merged

tests(visual): add Argos CI #130

merged 1 commit into from
Jun 22, 2017

Conversation

oliviertassinari
Copy link
Contributor

@oliviertassinari oliviertassinari commented Jun 17, 2017

This PR is a continuation of algolia/instantsearch#2166.
We are integrating Storybook, Happo and Argos-CI.

  • Storybook responsibility is to aggregate the React Components through stories.
  • Happo responsibility is to generate screenshots based on Storybook's stories.
  • Argos-CI responsibility is to handle the diffs and dev workflow based on Happo's screenshots.

The following video is an example of what Happo is doing for us:
juin-18-2017 00-31-58

Things we need to get right:

For more context on the available solutions

@algobot
Copy link
Contributor

algobot commented Jun 17, 2017

Deploy preview ready!

Built with commit bbc8561

https://deploy-preview-130--react-instantsearch.netlify.com

package.json Outdated
"gh-pages": "^0.12.0",
"glob": "^7.1.1",
"google-map-react": "^0.22.3",
"happo-olivier": "^5.0.2",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

custom fork waiting for the fix to be released.

@mthuret
Copy link
Contributor

mthuret commented Jun 19, 2017

@oliviertassinari that's super nice! Love it!

What do you mean with the task "Test stability"?

@oliviertassinari
Copy link
Contributor Author

that's super nice! Love it!

I'm happy to hear it :).

What do you mean with the task "Test stability"?

I wanted to make sure the pending http request trick was working with all the stories. That seems to be fine.

@mthuret
Copy link
Contributor

mthuret commented Jun 19, 2017

Let's wait for that fix being released then :)

@@ -0,0 +1,17 @@
(function() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment to inform what is this file and why we need it?
Then link to this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

@@ -0,0 +1,41 @@
const path = require('path');
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a comment on what is this file doing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure

@vvo
Copy link
Contributor

vvo commented Jun 20, 2017

This looks cool!

What would we have to do to get those screenshots/diffs to be ran in multiple browsers? Would having some functional tests going through all stories help?

@@ -0,0 +1,41 @@
const path = require('path');
Copy link
Contributor

Choose a reason for hiding this comment

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

Needs eslint comment

@oliviertassinari
Copy link
Contributor Author

What would we have to do to get those screenshots/diffs to be ran in multiple browsers? Would having some functional tests going through all stories help?

@vvo Happo doesn't support multiple browsers yet. We would either have to write a chrome-headless target plugin or a selenium target plugin for even more browser coverage like we could go through Browserstack or Saucelab.
On Material-UI we are using vrtest with Chrome and Selenium in a docker, making cross-browser testing quite easy.

@vvo
Copy link
Contributor

vvo commented Jun 21, 2017

As for screenshots and diffing I would say a ultimate solution would be to have a selenium pluggin that is easy to use yes so that we can take screenshots from many browsers at the same time. Ultimately that's what we would like.

@mthuret
Copy link
Contributor

mthuret commented Jun 21, 2017

@oliviertassinari if you wish to be compatible with storybook directly you could create an addon for it. The user will have the ability to use you as a decorator for all their stories which gave you the opportunity to do whatever you want for each on of theme.

Check this documentation: https://storybook.js.org/addons/introduction/

@oliviertassinari
Copy link
Contributor Author

oliviertassinari commented Jun 21, 2017

@mthuret I didn't know about storybook plugins, thanks for sharing it! After going throw the documentation, I don't see how that could help us with the screenshot generation. All we need are the components and the styles when not using a CSS-in-JSS solution.

@oliviertassinari
Copy link
Contributor Author

Ultimately that's what we would like.

@vvo Shouldn't be too hard to write given we have the source code of vrtest doing that, I'm wondering if Happo has any plan for that.

@@ -32,7 +32,8 @@ function sidebarFollowScroll(sidebarContainer) {
sidebarContainer.style.top = null;
}
sidebarContainer.classList.add('fixed');
linksContainer.style.maxHeight = `calc(100vh - ${titleHeight + navHeight}px)`;
linksContainer.style.maxHeight = `calc(100vh - ${titleHeight +
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have been running yarn reformat.

Copy link
Contributor Author

@oliviertassinari oliviertassinari Jun 21, 2017

Choose a reason for hiding this comment

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

Feel free to do so on master, I will rebase if you need a less noisy PR.

@vvo
Copy link
Contributor

vvo commented Jun 21, 2017

LGTM

@mthuret mthuret merged commit c1e751a into algolia:master Jun 22, 2017
@oliviertassinari oliviertassinari deleted the add-argos-ci branch June 22, 2017 07:50
@oliviertassinari
Copy link
Contributor Author

oliviertassinari commented Jun 22, 2017

@mthuret Let me know if you experience any issue with that solution. I'm here to help.

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

Successfully merging this pull request may close these issues.

None yet

4 participants