To start a UI test automation project, You can start everything from scratch but it’s easier if you have some skeleton project to work with. I am going to explain the steps I had to go through to create this skeleton project. So if you want to start building your test automation right away, you can jump to a much later part. This ‘Part 0’ will go through creating an empty git repo, make a maven project, then push it back to git.
- I created a github repo named ‘ui-automation’
- Before cloning it, I created my ssh key pair from my macbook
ssh-keygen -C <my email address>
- And copied the ~/.ssh/id_rsa.pub content into Github – settings – SSH key section
- Now I can clone and do all the git transactions without typing in my github credentials
cd ~/workspace git clone https://github.com/changgull/ui-automation.git
- This is an empty project. Now we need to create a maven project so we can benefit from its build facilitation. Creating a maven project is just one command liner. Reference here. From your workspace folder and run this command:
mvn archetype:generate -DgroupId=com.mycompany.ui -DartifactId=ui-automation-2
- That will create a directory named ui-automation-2. Now modify the pom.xml to change the artifactId from ui-automation-2 to ui-automation then move all contents to ui-automation. Now I see the build pass from ui-automation directory.
- Now you can push the change made to this project back to the git repo
mvn clean echo *.class >.gitignore git add * .gitignore git commit -am "Converted to Maven" git push origin master
- If Eclipse is your choice of IDE, now you may import this project at this step.