Open cfarm opened 6 years ago
short-term goal: run browser tests with Sauce Labs on push using Travis; get at least one browser working (latest IE) and see how this affects the time for builds
@Scotchester and document it ✍️ 📓 📝
--suite
param do? "--suite: Choose a particular suite or suites to run."
gulp test:acceptance --sauce --browserName='internet explorer' --version='9' --platform='Windows 7'
gulp test:acceptance:protractor --sauce=true
note the --sauce
flag alone doesn't work. you have to have a local server running. environment-test.js
and .env fileenvironment-test.js
so we can run with http OR https in the URL for localhost URL @cfarm, so you can run the browser tests when using HTTPS locally with ./runserver.sh ssl
environment-test.js
so we can run www.consumerfinance.gov without the PORT constant in our .env @virginiacc (just need to set DJANGO_HTTP_PORT=''
in .env; the test env var TEST_HTTP_PORT
maps to DJANGO_HTTP_PORT
, which is set to 8000 in runserver.sh and needs to be overridden for local testing against production)Scenario | Failure | Browser |
---|---|---|
Large Size, when mouse is over link (mega-menu.feature:13 ) |
✖ Then the mega-menu organism shouldn't show the first link immediately |
|
Large Size, when mouse is over link (mega-menu.feature:13 ) |
✖ Then the mega-menu organism shouldn't show the first link immediately (UnsupportedOperationError: mouseMoveTo ) |
|
State on page load (multi-select.feature:10 ) |
✖ Then the multi-select should be rendered (multi-select.js:63 ) |
|
Navigate to the previous page (pagination.feature:14 ) |
✖ Then the page url should contain "page=1" |
|
Navigate to nth Page (pagination.feature:19 ) |
✖ Then the page url should contain "page=2" |
|
Large Size, should navigate to search portal (global-search.feature:24 ) |
✖ Then I should navigate to search portal |
|
Do we ever run all the browser tests in any environment, such as Jenkins? I'm going to dig around docs/JAC jobs to find out but if anyone knows the answer let us know. From what I remember when talking about it in the past, the answer was 'no.'
@cfarm afaik browser tests are never run on Jenkins, only on Travis.
OK. The browser tests are run in Chrome with Travis, so it seems that none of the other browsers are tested automatically: https://github.com/cfpb/cfgov-refresh/blob/master/test/browser_tests/default-suites.js#L64
For scheduling all the browser tests to run outside of the Travis PR queue, we looked at https://circleci.com/docs/2.0/workflows/#scheduling-a-workflow which allows us to schedule a specific time to run the browser tests every day. This wouldn't block our PRs since it'd be running through CircleCI instead of Travis. We could also use CircleCI eventually to run performance tests, visual regression tests, etc - other tests that we normally don't implement on Travis because we worry about blocking PRs.
Adam would have to approve CircleCI app on the cfpb organization for us to try this out.
Edited to add: can we also set up Sauce Labs to run these as a cron job? Something to investigate
Plan for next Thursday 3/ 👍
Future discussions:
We initially looked into the possibility of creating a Travis cron job to run the browser tests in Sauce at night so it wouldn't impact our Travis queue, but it appears that Travis only offers the option to set an interval (daily, weekly, monthly) for a cron job, not a specific start time. It does sound like jobs run at approximately the same time you first set them up, so a workaround could be to initially enable the job at night. Using something like CircleCI to completely bypass the Travis queue might be a cleaner option, though.
Here's my WIP branch with changes to the browser tests documentation...added info on how to run tests against localhost, consumerfinance.gov, etc. I haven't fully tested some of the instructions I wrote here, so they are probably wrong in places (it's based on piecing together memories of last July's findings) https://github.com/cfpb/cfgov-refresh/pull/4859
Travis and CircleCI cron jobs for the cross-browser tests are now on hold. We may be able to use CircleCI, we need to talk to @marcesher about our use case and get a PUA going to be able to enable it on cfgov-refresh.
For now, we will continue our proof-of-concept for running cross-browser tests on Sauce Labs by using Jenkins - for reference we will use this technique https://github.com/cfpb/cfgov-refresh/pull/new/new-acceptance-tests-feedback
JAC the whats-in-a-name job to use node > 8