New to QA and Playwright.

Related to styling and file naming conventions:

Say you have complex software with multiple endpoints that you are writing automated tests for. How would you organize your tests? My approach is to relate it to the use case of the test. i.e.


Whereas an approach was suggested to divide it down even further related to the readability of the actual test file. i.e


UPDATE: Upon some further digging it also seems that some prefer to take it further and have a test file for every test case. i.e.


I cannot find any decent reading material covering the topic. What is the standard convention in this regard? Do you have any suggested reading material on the topic?

1 Answer 1


There is no one-size-fits-all approach for organizing tests in Playwright or any other framework. It always depends on specific needs & preferences of the team. However, you can follow some general guidelines and good practices,

One common approach is to organize tests based on the functionality or feature being tested. This can help make it easier to find tests for specific features or functions. For example:

--User management
--Inventory management
--Payment processing

st.ts ---MakePayment.test.ts

Another approach is to organize tests based on the type of test. This can help make it easier to find specific types of tests, such as performance tests or integration tests. For example:

--Unit tests
--Integration tests
--Performance tests

For file naming conventions, it's important to use descriptive names that clearly indicate the purpose of the test. Some common naming conventions include using a verb-noun format or a test case format. For example:

Verb-noun format: login.test.ts, viewInventory.test.ts, makePayment.test.ts

Test case format: testLogin.ts, testViewInventory.ts, testMakePayment.ts

Most important thing is to choose an approach that works for your team & helps you stay organized and efficient.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.