Debugging E2E Tests - SAP/fundamental-ngx GitHub Wiki
To debug locally:
- Open the Travis log and read which component’s tests failed
- In your IDE, go to the
wdio.conf.js
file - 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', ]
- i.e.
- Run the test with localhost
- serve app locally:
npm run start
- run tests:
npm run e2e:wdio
- serve app locally:
- [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
- 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.
- Open the Travis log and read which component’s tests failed
- In your IDE, go to the
wdio-cron.conf.js
file - 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)
- for a core test: change specs to your needed test suite
- 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
- start app:
- 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