'How to avoid "Duplicate test titles are not allowed" error in playwright-test?

Context: In long E2E test flows there are certain steps that are duplicated like moving in-between "Product" vs "shipping" vs "Payment method" tabs in an online order workflow.

Problem: In Playwright-Test, duplicate test titles are not allowed as "error" (not as a warning) which is painful for someone who is migrating test scripts from other testing frameworks like "Jasmine" (as in my scenario) where duplicate test titles were allowed.

Desired Solution : Is there a solution, where this error can be avoided on the configuration level (preferably as a warning) without changing 100s of scripts manually? Thanks!

enter image description here



Solution 1:[1]

Not sure that you can make it with config, since there is a valid question how you are going to create report in paralel run for non unique test descriptions in playwright...

But one thing you can do, you can make your test unique just by adding some parameter in description. In e.g. test ID, or if tests are data driven, put iterator as pat of the test name.

Or make some wraper that will overload test method and will add one unique parametar to the test every time.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Gaj Julije