Functional Tests using Seleium Web Driver. These tests can be developed and run locally in eclipse. They will also be incorporated into nightly runs of qa site builds for VEuPath Sites.
- browser automation (firefox,chrome) to run tests
- tests can be written in java,python,c#,Ruby,Javascript, …
- find elements By cssClass,linkText,elmenentId,xpath
- Page Object Model (separate out the code which navigates the page from the tests)
- Page Object Model Guidelines
- Each kind of page gets its own java class.
- the hard bits about how to find elements is stored as instance variables of these classes
- Page Object Model Guidelines
- Selenium has plugins for Firefox and Chrome
- This allows you to Design tests through browser interactions
- You can export test to language of your choice (java (JUnit), python, …)
- git clone https://github.com/VEuPathDB/FunctionalTests.git
- Install TestNG
- Download a Driver (Above)
- Import Projects
- From the Project Explorer click “import projects”
- click “Existing Maven Projects”
- select your project_home as the “Root Directory”
- select the pom.xml file
- Create a new “Run Configuration” For TestNG. You can make a run config for a class,suite,method,…
- click on “Arguments” Tab and add VM arguments
Dbaseurl="https://hostdb.org" -Dwebappname="hostdb" -Dusername="apidb" -Dpassword="$PASSWORD"
- click “Environment” Tab and add the path to your Chrome or Firefox Driver to the “PATH” variable.
- click on “Arguments” Tab and add VM arguments
- Apply/Save
- Run
- testing framework in java (similar to JUnit)
- integrated into Jenkins or run locally in eclipse
- groups of tests (deployment/dashboard) are associated with types of builds (Integration/QA/Production)
<test name="Integration" junit="false" enabled="true"> <groups> <run> <include name="functional_tests"/> <include name="performance_tests"/> </run> </groups> <classes> <class name="org.apidb.eupathsitecommon.watar.SeleniumTests"/> </classes> </test>
- Can we use these in Jenkins runs after qa site builds?
- selenium/standalone-chrome
- selenium/standalone-firefox