UI automation from scratch: Part 0 – create an empty project

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.

  1. I created a github repo named ‘ui-automation’
  2. Before cloning it, I created my ssh key pair from my macbook
    ssh-keygen -C <my email address>
  3. And copied the ~/.ssh/id_rsa.pub content into Github – settings – SSH key section
  4. 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
  5. 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
  6. 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.
    mvn test
  7. 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
  8. If Eclipse is your choice of IDE, now you may import this project at this step.
    Screen Shot 2016-12-14 at 11.35.45 PM
    Screen Shot 2016-12-14 at 11.37.42 PM

changgull