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?
1 Answer 1
When you run Maven/Gradle test task, it will look for code in the test folder (unless configured otherwise).
-
Thanks for the answer! Code from
test
folder can use the code frommain
folder. So it is possible that e.g. page objects are inmain
while tests are intest
without additional configuration.VladislavShcherba– VladislavShcherba2024年08月06日 10:28:47 +00:00Commented Aug 6, 2024 at 10:28 -
Yes, you just have to import the types.João Farias– João Farias2024年08月08日 08:24:27 +00:00Commented 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.João Farias– João Farias2024年08月08日 08:25:22 +00:00Commented 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 inmain
. I saw different frameworks and people do it differently. Some use onlytest
. Some claim that page objects, framework initialization etc. should be inmain
, wheretest
should contain tests, maybe step definitions...VladislavShcherba– VladislavShcherba2024年08月08日 08:30:24 +00:00Commented 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.João Farias– João Farias2024年08月13日 08:18:23 +00:00Commented Aug 13, 2024 at 8:18
Explore related questions
See similar questions with these tags.