rssfrncs
rssfrncs

Reputation: 1011

TestCafe reload page and re-execute fixture hook

The common wisdom for reloading is using await t.eval(() => location.reload(true));.

However, with this approach, once the page is reloaded if you have installed anything using the fixture hooks, such as testcafe-testing-library, it will no longer be available.

Is there any way to re-execute the fixture hook?

Relevant GitHub issue raised https://github.com/testing-library/testcafe-testing-library/issues/28

Upvotes: 2

Views: 660

Answers (1)

Helen Dikareva
Helen Dikareva

Reputation: 1036

Please use the new TestCafe feature to inject client scripts into testing pages and your scripts will be available even after reloading.

Upvotes: 2

Related Questions