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

Accomodate Mapbox response in flaky PLC workshop dashboard test #40106

Merged
merged 2 commits into from Apr 22, 2021

Conversation

bencodeorg
Copy link
Contributor

@bencodeorg bencodeorg commented Apr 15, 2021

Introduces a wait until Mapbox has responded with results for a location query before proceeding with the test. This test has failed intermittently when Mapbox takes a little bit to respond, and the dropdown with Mapbox's suggestions for a location then doesn't get re-hidden by selecting the next element where we're inputting information in the form.

Relying on the ability to connect to the Mapbox API broke this test in Drone, as we do not have Mapbox keys set up. The new approach now implemented in this PR is to click on one of the results from Mapbox if it is visible on the page, and do nothing if not.

I'll have to add an ignore region to this eyes test as well, such that if we do click on a response from Mapbox (which will fill in the "Location Address" field and override the default "Seattle, WA"), we do not get eyes diffs.

Historical failure: https://app.saucelabs.com/tests/90615d79f5e341baa117d6ca16be34d5#50
Historical success: https://app.saucelabs.com/tests/ce3ff47d1c234c23ae06959d7fe5a8ac/watch#42

I also include some cleanup of our README that I encountered while working on this.

Note that these are eyes tests, and only run in Chrome as a result. I was messing around trying to test my change, and noticed that this Mapbox input field doesn't render at all in at least the old version of Firefox we use in tests? Works fine for me on Mac/Firefox 70.

Links

Testing story

I tested via SauceLabs that this new step (as implemented) was able to dismiss the options provided by Mapbox, and overwrote the "Seattle, WA" text with the formatted text provided by Mapbox ("Seattle, Washington, United States").

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@@ -67,13 +67,9 @@ Run all UI tests using the local chromedriver against your localhost. Faster tha

`./runner.rb -l`

Run all UI tests for a given browser/os combination - full list of combinations is in browsers.json

`./runner.rb --config ChromeLatestWin7`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not valid:

MacBook-Pro:ui benjaminbrooks$ ./runner.rb --config ChromeLatestWin7
No config exists with name ChromeLatestWin7

Run all UI tests for a given browser

`./runner.rb --browser Chrome`
`./runner.rb --config Chrome`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

--config or -c is the flag that will allow you specify a single browser -- I'm not exactly sure what the browser flag does, but this results in running in all browsers for me.

@bencodeorg bencodeorg requested review from daynew and a team April 15, 2021 21:21
@bencodeorg bencodeorg changed the title Fix flaky PLC workshop dashboard test Wait for Mapbox response in flaky PLC workshop dashboard test Apr 15, 2021
@bencodeorg
Copy link
Contributor Author

mmm Drone is failing, let me investigate...

@bencodeorg
Copy link
Contributor Author

My theory is this is failing because Mapbox secrets are not available to Drone, confirming in Slack...

@@ -491,6 +491,14 @@ def select_dropdown(element, option_text, load)
page_load(load) {element.click}
end

When /^I click "([^"]*)" if it is visible$/ do |selector|
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Note we have a step When /^I click selector "([^"]*)" if it exists$/ that is very similar to this, but uses the built in HTMLElement click() method, rather than Selenium. I'm not 100% sure why this doesn't work.

@bencodeorg bencodeorg changed the title Wait for Mapbox response in flaky PLC workshop dashboard test Accomodate Mapbox response in flaky PLC workshop dashboard test Apr 16, 2021
@bencodeorg
Copy link
Contributor Author

@daynew updated this to work in Drone, take another look when you have a minute!

Copy link
Member

@daynew daynew left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you for spending a lot of time on this.

@bencodeorg bencodeorg merged commit 662e55a into staging Apr 22, 2021
@bencodeorg bencodeorg deleted the ben/fix-flaky-plc-mapbox-eyes-test branch April 22, 2021 15:10
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.

None yet

2 participants