Search code examples
testingautomated-testse2e-testingweb-testingtestcafe

How do I get access to the running test information (screenshot pattern params)


I would like to store some information using the beforeEach and afterEach hooks in a fixture like: - tracking the REST API calls - browser console information and would like to store this information next to the screenshots.

Is there a way to get access to the screenshot params and current path and also know if a test had an assert during it's run?


Solution

  • get access to the screenshot params and current path

    It is not possible to access this information in beforeEach/afterEach. TestCafe provides an API to obtain screenshot params for reports only.  

    if a test had an assert during it's run

    If a test is successful, there is no any logged information. If a test fails, information about errors will be written to reports.