3

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.

asked Jan 9, 2019 at 13:12
2
  • 1
    not sure if I want that. What exactly do you want to achieve? Commented Jan 9, 2019 at 13:14
  • It's a new project, nothing is done yet and there is a lot yet to be defined, but the idea is to start with ui tests, integrate with jenkins and run the tests remotely. Commented Jan 9, 2019 at 13:37

1 Answer 1

1

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 pom.xml file).

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

answered Jan 9, 2019 at 14:20
1
  • Thanks, this answers my question completely and you also provided extra info and some really useful links! Commented Jan 9, 2019 at 16:14

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.