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
Conversation
@@ -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` |
There was a problem hiding this comment.
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` |
There was a problem hiding this comment.
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.
mmm Drone is failing, let me investigate... |
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| |
There was a problem hiding this comment.
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.
@daynew updated this to work in Drone, take another look when you have a minute! |
There was a problem hiding this 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.
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: