Not all tests are going to pass the first time. Hammer provides some tools to help you debug failed specs. When you run your tests, you can find a report in tests/e2e/report/index.html
timer Exercise: Fix a spec
To start, in your
- Uncomment the line,
- Run the tests with these updated specs.
You will notice there is an error in one of our tests.
All the information regarding the error is listed in these console details.
However if you end up with too many errors, reading them in
can be daunting. There is an optional view you can use to debug. It is located in code
The HTML view is much easier to read.
Whenever a test fails, a screenshot is taken and a link is provided to view it. This will
help if the spec is testing against something visual. In our case, we are looking for a string
No action taken. but it only found
No action taken. The period is missing.
Looks like we have a typo in our test.
Find the spec
should have label "No action taken" in
Change this line:
expect(statusWidget.getText()).toEqual('No action taken');
expect(statusWidget.getText()).toEqual('No action taken.');
Rerun the tests and all specs should now pass.