0

Usually UI test automation framework is a separate code base, different from developers repository.

It is common to use Maven or Gradle as a build tool in test automation frameworks written on Java. By default it means that the project has main and test subfolders, which is know as "Maven Standard Directory Layout".

For developers code it is clear for me: under main there is application code itself, whereas under test there are unit tests.

Is there any standard or best practices adopted by the automation community regarding which of these subfolders should be used for which code in Test Automation Framework?

asked Aug 5, 2024 at 8:59

1 Answer 1

0

When you run Maven/Gradle test task, it will look for code in the test folder (unless configured otherwise).

answered Aug 6, 2024 at 8:42
5
  • Thanks for the answer! Code from test folder can use the code from main folder. So it is possible that e.g. page objects are in main while tests are in test without additional configuration. Commented Aug 6, 2024 at 10:28
  • Yes, you just have to import the types. Commented Aug 8, 2024 at 8:24
  • @zer_ik if the answer is satisfiable for you question, please mark it as Accepted, so others will know the it answers the question. Commented Aug 8, 2024 at 8:25
  • The question is about best practices or standard for test automation frameworks: which modules should be in test and which in main. I saw different frameworks and people do it differently. Some use only test. Some claim that page objects, framework initialization etc. should be in main, where test should contain tests, maybe step definitions... Commented Aug 8, 2024 at 8:30
  • @zer_ik In practical terms, it makes barely any difference. The important parts of your architecture will be on the application modules you will be creating. Meaning: What dependencies exist between the page objects or between the framework init code will be more important for the development of your code. main and test modules are almost virtual modules, of interest of Maven/Gradle, not much for the application code. Commented Aug 13, 2024 at 8:18

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.