Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • That's good advice. I'm using testcafe and followed all the advice in this article. That's probably why this suite takes 10 minutes instead of 20. Beyond that, I don't know how to do any more due diligence; I can run the browser in normal mode (as opposed to headless mode) and observe with my eyes that there's seconds of delay between the browser opening and the test starting, but I can't reproduce this outside of that situation. I don't even know if it's relevant since I run the tests in headless mode? Commented Aug 17, 2023 at 2:48
  • That's one of many examples that makes it hard to pinpoint exactly where the performance issue lies. I assume that delay is the time it takes for testcafe to set up its environment, but can't prove it. I thought rewriting a simple test to run without a browser (i.e., using testing-library or jsdom) would be the pragmatic next step. By doing that, I could theoretically rule out a bunch of technologies simultaneously. After struggling for days, I started wondering, maybe there's a best practice for testing browser templating languages, hence the original question. Commented Aug 17, 2023 at 3:04
  • @DanielKaplan: you don't test the template language, you test the behavior. And for that you either need objects or functions to interact with so you can write unit tests, or realize that testing the UI layer of an application just takes a long time. As for profiling your tests, it can be simple log statements that subtract the time between two events. I'm just not sure how to log to the test output. Commented Aug 17, 2023 at 12:34
  • 1
    "you don't test the template language, you test the behavior" Agreed. Isn't the bullet list in my original question a list of behaviors I want to test? The paragraph that follows is my attempt to explain why interacting with objects and functions doesn't fully test those behaviors. I guess that leaves me with one option. Commented Aug 17, 2023 at 14:16