by longrod · 4y ago · 0 comments
Obviously, that isn't always possible. I find this approach especially useful in writing e2e browser tests. You write an abstraction over the testing framework's (playwright, puppeteer etc) interaction and then use that in your tests.
So instead of writing:
await page.click(".play-button");
You do: await app.play();
This also has the benefit of extreme reusability. Doesn't work for everything though.No comments yet.