1. Add a Project to CircleCI
Link an existing project in a GitHub repository to CircleCI for continuous integration testing.
There are a several of advantages to running your tests in CircleCI:
You or your team members do not forget to run tests. Every change that gets committed to the repository is tested. This also includes merges which are often not tested manually. For example, such a merge can occur when a dev merges changes from a currently checked out branch into
developmentand accidentally breaks something.
You can set up notifications for your team when a test on CircleCI fails. This is great for teaching the "build should never fail" mindset. Once the build breaks, it becomes difficult for the team to figure out whether the build was already broken or if recent changes broke something new.
CircleCI builds from a blank slate so it allows you to catch errors that were introduced by dependency updates. For example, someone decides to upgrade the project to a new version of Nightwatch.js or Adaptive.js. If everyone else on the team then does not run
npm installmanually on their own machines, the bugs that are introduced by that update will not be caught. By contrast, CircleCI will build the project from a blank slate and catch these errors.
Continuous Integration Read the Continuous Integration article on ThroughtWorks for more information about continuous integration practices in software.
1. Build your Project in CircleCI
To add new project to CircleCI, you need to be an administrator for the CircleCI account. Ask your system administrator for access privileges.
1. Click on the upper right hand "Log In" link to sign in to CircleCI at https://circleci.com/ with your GitHub account credentials.
2. On the left-hand side menu, select the "Add Projects" menu option.
3. On the "Add Projects" page, under the first "Your accounts" section, click the "mobify" link.
If you are Mobify partner, select your company name and URL instead.
4. On the "Add Projects" page, in the second section, filter or scroll for your project repository.
5. Click the "Build Project" button beside the repository name.
CircleCI installs dependencies and starts to build.
The side bar loads with all of the branch activities for that project.
In the side bar under the project name, the Nightwatch.js tests that recently ran on the project are listed. The successful ones have a green checkmark indicator and failed attempts have a red cross.
The test either passes or fails.
6. Scroll to the top heading of the page to see the Nightwatch.js test status displayed.
2. Add the CircleCI Configuration File to your GitHub Repository to Execute Automated Testing
1. Copy this
circle.yml configuration file listing for a simple CircleCI Nightwatch.js tests.
dependencies: override: - gem install sass compass: timeout: 600 - npm install: timeout: 600 post: - chmod 755 ./node_modules/nightwatch-commands/selenium/drivers/chromedriver: timeout: 10 test: pre: - grunt preview: background: true timeout: 120 - sleep 5 override: - grunt nightwatch: timeout: 600
2. Go to GitHub at https://github.com/mobify/.
If you are a Mobify partner, sign in to your company GitHub repository.
3. Filter to find your project in the repository.
For example, start to type "merlin" to find the
4. Click on your project name to view its code repository in GitHub.
5. At the top of the project branch, near the name of the project, click the "+" link to create a new file at the root level of the project.
6. In the "Name your file..." text box, enter the
circle.yml file name.
7. Paste the contents of your clipboard with the simple CircleCI script into the "Edit new file" text field.
8. Scroll to the bottom of the page to commit the new file. Type in any additional descriptions in the provided text fields.
9. Select the "Create a new branch for this commit ... " toggle to create a new branch for the test.
Name your branch with our lower caps and dash-separated
name-of-new-branch name convention.
10. Click the "Propose new file" button.
11. On the next page, fill out the details of your pull request and click the "Create pull request" button.
12. The next page that appears shows your new "Create circle.yml #PullRequestNumber" pull request.
13. Hover over the indicator beside your commit number to see the status of the CircleCI test. It displays a message similar to "Pending: CircleCI is running your tests."
14. Click on the colored indicator to see the execution of CircleCI on your project in the CircleCI site.
The test executes with a success message if Nightwatch is correctly configured.
15. Navigate with the "Back" button of your browser to GitHub to check your pull request.
Your test status indicators show red crosses for failed tests and green check marks for successful tests.
Edit in GitHub