Search code examples
testinge2e-testingtestcafebrowser-automationbrowserstack

Testcafe "chapters" in Text Log on Browserstack


I have a test suite that takes ~ 10 minutes to run in BrowserStack (Automate). If a test case fails, it is challenging to find where in the recorded video the failure occurs. Having the fixture name and test name visible in the bottom of the browser helps with scrubbing through the video, but having some kind of chapter marker would be really helpful. I noticed that something in my tests is spitting out links with start buttons into the Text Log but I'm not sure what is actually causing it. Is there a way to do this on purpose?

Update with picture of what I'm talking about: logs


Solution

  • The Text Log on BrowserStack shows Selenium commands executed by the browser during a test session. Since TestCafe doesn't use Selenium to perform test actions it must be clear in ideal conditions, but BrowserStack will terminate the session that doesn't send any command within 90 seconds (IDLE TIMEOUT). So TestCafe retrieves the current URL every 80 seconds to work around this timeout.

    To help you identify problematic tests in a recorded video, you can modify TestCafe reporters (e.g., the default spec reporter) to print a precise timestamp when a test starts. You can also modify the BrowserStack browser provider to execute custom Selenium commands that will be added to the Text Log on BrowserStack.

    Also, you can create a proposal in the TestCafe repository about improving test logs on BrowserStack. If it receives enough votes, the TestCafe team will consider its implementation.