Skip to content

Debugging E2E Tests

Sean Moore edited this page Nov 30, 2021 · 8 revisions

To debug locally:

  1. Open the Travis log and read which component’s tests failed
  2. In your IDE, go to the wdio.conf.js file
  3. Change the config to meet your debugging needs (specify component, browser/OS)
    • i.e. specs: [ './e2e/wdio/<platform/core>/**/<failing-spec-name>.e2e-spec.ts', ]
  4. Run the test with localhost
    • serve app locally: npm run start
    • run tests: npm run e2e:wdio
  5. [Alternate to step 4] Run the test with firebase deployment
    • copy the firebase deploy preview link from your PR
    • go to package.json and find the CLI name e2e:wdio and replace the baseUrl with your firebase link
    • run tests: npm run e2e:wdio
  6. Check the log to see if there is additional info about failed tests

Additional

E2E tests are located in the e2e/wdio/<platform/core>/tests folder

To run a specific case within a suite, you can add an ‘f’ in front of the ‘describe’ or ‘it’ which you want to run.

  • describe -> fdescribe
  • it -> fit

For information on updating/debugging visual regression screenshots, please see the visual regression doc here.


To debug using Saucelabs (required for visual regression):

Preconditions: setup Saucelabs according to instructions here.

  1. Open the Travis log and read which component’s tests failed
  2. In your IDE, go to the wdio-cron.conf.js file
  3. Change the config to meet your debugging needs (specify component, browser/OS)
    • for a core test: change specs to your needed test suite specs: [ './e2e/wdio/<platform/core>/**/<failing-spec-name>.e2e-spec.ts', ]
      • for a platform test: comment out all not needed test suites under the platform test suites
      • uncomment the baseUrl and change as needed (line 235)
  4. Run the test through Saucelabs
    • start app: ng serve --disable-host-check --ssl --no-watch --aot --prod
    • run tests: - core: npm run e2e:cron:wdio:saucelabs:core - platformA: npm run e2e:cron:wdio:saucelabs:platformA - platformB: npm run e2e:cron:wdio:saucelabs:platformB
  5. Check the results
    • Locally: check your IDE terminal logs
    • Saucelabs:
      • Go to Saucelabs using SSO
      • Click on the tab ‘automated’
      • Click on 'Test Results'
      • Choose your test run from the list
      • watch provided recording of test run
Clone this wiki locally