I'm really new here and started writing some UI tests using selenium and testng and wanted to know how do you structure the folders, it is a maven project and using java. I'm putting all the test files in src/test/java, is that the correct apporach? Noted it will run my UI tests when building, not sure if I want that.
If you want your tests to be controlled by Maven you have to adhere maven convention to house-keep your tests. Hence you have to keep them in your test source folder (that can actually be overwritten in
Normally tests are executed via surefire plugin that has the documentation here. More specifically, you can discover that you can disable test execution by default and run your goal with
-DskipTests=false argument when you want them not to be skipped.
There is also an option not to bind your tests to Maven. There is some specific though. You'll have to run your tests straight from your code and this way is different in different test frameworks. Here is my example for TestNg: https://sqa.stackexchange.com/a/36905/27679