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

Migration from PhantomJS to Headless Chrome #2534

Merged

Conversation

aitbw
Copy link
Collaborator

@aitbw aitbw commented Mar 9, 2018

References

Objectives

  • Migrate completely from PhantomJS to Headless Chrome, mitigating entirely all flaky specs 🎉

Notes

  • Just one spec outside of the scope of this PR is failing and it's already fixed at Fix rake db:dev_seed task flaky spec #2522
  • Had to apply xscenario to this spec, as it fails randomly (apparently it can't find the browser's alert so it can't accept it —the feature works as expected, though.)

To do

  • There are some failing specs that used to work with PhantomJS/Poltergeist because of poor CSS support and poorly implemented specs —here they are

  • Apparently, this spec (which is based on this one) is the last flaky remaining —it has failed just once in more than 20 Travis builds; I'll be monitoring this one closely

  • This spec works with the window-size=1200,600 argument for chromeOptions or with any resolution if the headless flag is removed —while this doesn't affect any other scenarios, it'd be nice to refactor this test for it to work with and without the flag

  • This spec works when the fill_in steps are reordered to be first —that's because the banner reloads when the elements for customization are out of focus. This gives us room for improvement for this module so we can implement actual live reload

  • Since Decide Madrid has a bigger codebase / test suite, this PR can't be ported straight away —a different pull request is needed to keep the migration as smooth as possible

  • Update CONSUL docs accordingly

@bertocq
Copy link
Collaborator

bertocq commented Mar 9, 2018

I was reading the commit messages and found out you're following some kind of pattern. Following the rules and conventions of the codebase you're working on it's always the best idea, please rebase them. It's not only about the header line, also about the lack of body description

Some resources to learn about good commit messages:

@aitbw aitbw force-pushed the aperez-headless-chrome branch 2 times, most recently from a44e572 to f8efc1d Compare March 12, 2018 13:50
@aitbw
Copy link
Collaborator Author

aitbw commented Mar 12, 2018

Rebased commits, @bertocq. Added description to only 2 commits as the commit messages alone were not descriptive enough.

@aitbw aitbw force-pushed the aperez-headless-chrome branch 3 times, most recently from 5408ec6 to 1f09d0f Compare March 16, 2018 19:06
@aitbw aitbw changed the title [WIP] Migration from PhantomJS to Headless Chrome Migration from PhantomJS to Headless Chrome Mar 16, 2018
@aitbw
Copy link
Collaborator Author

aitbw commented Mar 16, 2018

As today (16/03/2018), the migration from PhantomJS/Poltergeist to Headless Chrome/Selenium is 100% complete 🎉

The now-deprecated `.trigger('click')` API simulated a click against
the DOM rather a click on the UI, which made our tests fragile and
wouldn't simulate actual user interaction
The example tests if a certain selector is hidden after adding
one image but the assertion expected said selector to be visible,
which made the scenario to fail at random
@voodoorai2000
Copy link
Member

Awesome @aitbw! 👏🎉

@bertocq
Copy link
Collaborator

bertocq commented Mar 28, 2018

@aitbw

This is not working locally at macos as running a single spec (or multiple) throws errors like:

  1) Notifications Mark as unread
     Failure/Error: visit root_path

     Selenium::WebDriver::Error::WebDriverError:
       unable to connect to chromedriver 127.0.0.1:9516
     # ./spec/features/notifications_spec.rb:9:in `block (2 levels) in <top (required)>'

Should we include any tips/guidelines at readme file to make this work?

@aitbw
Copy link
Collaborator Author

aitbw commented Mar 28, 2018

Oh sorry about that @bertocq! On Mac OS you need to run brew install chromedriver first

I'll be updating the consul/docs later today with all this information

aitbw added a commit to wairbut-m2c-aytomadrid/consul that referenced this pull request May 2, 2018
Not necessary since test suite is using Headless Chrome for
E2E integration tests since PR consuldemocracy#2534
aitbw added a commit to wairbut-m2c/consul that referenced this pull request Aug 7, 2018
Not necessary since test suite is using Headless Chrome for
E2E integration tests since PR consuldemocracy#2534
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

Successfully merging this pull request may close these issues.

Improve test suite, move away from PhantomJS
3 participants