General instructions
The version of Selenide and other dependencies will be determined in the pom.xml file. This file can be edited for upgrades or different versions.
For more information: https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
For more information: https://maven.apache.org/guides/getting-started/maven-in-five-minutes.html
The test files should end their name with "Test", such as this:
a_yourfilenamehereTest.java
a_yourfilenamehereTest.java
Because we use jUnit, each test method needs to have this annotation above it:
@Test
@Test
Example:
@Test public void _01_myTestName(){ //test code }
When using intelliJ, it is essential to "import as a Maven project" to enable code auto-completion. Normally, intelliJ will automatically ask you to import the project, and you can select the option to "auto-import". IntelliJ will also need your path to the JDK.
If the auto-complete feature fails, re-open the project like this:
https://www.jetbrains.com/help/idea/maven-support.html#maven_import_project_start
If the auto-complete feature fails, re-open the project like this:
https://www.jetbrains.com/help/idea/maven-support.html#maven_import_project_start
mvn test mvn clean test
What's the difference by adding "clean"?
The "clean" will delete the folder called "target" so that the sub-folder "surefire-reports" will be fresh, only-pertaining to the most recent test result. This surefire-reports folder is where you can find detailed error messages.
The "clean" will delete the folder called "target" so that the sub-folder "surefire-reports" will be fresh, only-pertaining to the most recent test result. This surefire-reports folder is where you can find detailed error messages.
To launch a single test, you may want to consider this naming convention:
Name your java files beginning with letters like this: a_filename, b_filename, c_filename, etc. Individual tests on each file can start with a numerical identifier. For example, this would be test # _01:
Name your java files beginning with letters like this: a_filename, b_filename, c_filename, etc. Individual tests on each file can start with a numerical identifier. For example, this would be test # _01:
@Test public void _01_testname(){ }
Test # _01 from file a may be run via this command:
mvn test -Dtest=a*#_01*
where * represents a wildcard character and # represents the separation between file name and test name.
The numeric naming convention for tests can insert additional tests similar to decimal notation:
_0111 for example will run between _01 and _02 if you add this code at the top:
_0111 for example will run between _01 and _02 if you add this code at the top:
import org.junit.runners.MethodSorters; @FixMethodOrder(MethodSorters.NAME_ASCENDING)