Test Automation 101: (4)Robot Framework Project and GitHub integration
*Please read the tutorial introduction, in case you haven’t yet. Here’s the link -> [LINK]
*Previous article in the tutorial series -> [LINK]
In the previous 3 articles, we did the following:
- Setup our work space
- Captured HTML elements
- Created Keywords and Tests
And at this point, we have a working Robot Framework Test Case. In a real project, the source code must be secured and manageable. That is why we need a remote repository where we can safely store our automated test cases.
So what we are going to do is integrate our current project to GitHub (a hosting service for GIT repositories).
It is possible to do the integration via command line. If you want to try that, you may refer to this -> https://help.github.com/en/github/importing-your-projects-to-github/adding-an-existing-project-to-github-using-the-command-line
But for this guide, we will do the integration using Eclipse IDE.
Before we do that, create an account in GitHub then create a repository. It is very easy.
Take note of the URL as it will be needed later.
- Launch Eclipse IDE and let’s go back to the last state we were in.
2. Go to Window -> Perspective -> Open Perspective -> Other… ->Git
3. Click “Create a new local Git repository.” Change the directory to the folder location of your project in Eclipse. Click Create.
4. Go back to Robot view by clicking the Robot Framework icon in the upper-right corner.
5. Git Staging sub-window should appear. If does not appear on your end, go to Window -> Show View -> Other… -> Git -> Git Staging.
6. Drag the robot file we created in the previous tutorial from Unstaged to Staged.
7. Add a commit message. Then click Commit and Push.
8. This window will appear. In the URI field, paste the URL taken from Github. In the Authentication section, enter your Github username and password.
9. Click Next and Next.
10. Click Finish. Then lastly, go back to your Github repository and refresh the page, it should contain the robot file.
If the robot file appeared, then commit and push was successful!
WARNING!!!: The steps we did above shows a quick commit and push procedure to give you an idea how a local project can be connected to a remote repository. However, there are best practices which should be applied in a real project. For example, pushing changes directly to the master branch is not a best practice. Creating your own branch and submitting a pull request to a peer is a good practice. For more information about branching, you may refer to this -> https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging
For now, you are awesome, we’re halfway through!
In the next tutorial we will put in place a project structure to organize our test cases.
*If you ran into some issues, I’d be happy to assist. Just leave a comment and I’ll respond as soon as I can.