2.- Process
Introduction¶
In this section is described the steps followed to complete the backend section of the SQA Onboarding challenge.
Prerequisites (optional)¶
- Study or review about REST, API testing and Postman.
- Understand how positive and negative tests work and how should be their expected results.
Steps¶
Postman¶
- Navigate to Todoist API website:
- Read the documentation to better understand the 'Todoist' REST API, HTTP requests methods, and expected responses for each case.
- Download Postman
- Define a new collection and a new environment for your variables.
- Create 2 folders: Projects and Tasks and define the folder/test structure you prefer (this can change later in case you find a better structure).
- Create your endpoints.
- Think about your positive and negative scenarios you will test.
- Define your variables and the test scripts for your endpoints.
- Test your endpoints.
- If everything goes well then run your collection using Postman until all tests passed.
Newman¶
- Export your collections and environment variables and save them in a folder of your computer.
- Install newman and htmlextra in your computer.
- Open your terminal inside the folder you created and run your collection using newman and htmlextra to verify everything is working and the HTML reports with the results were created.
Jenkins¶
- Install Jenkins in your computer
- Open your localhost in web browser and complete the steps for admin password, plugins and required.
- Install plugins Manage Jenkins > Manage Plugins: (HTML reporter, NodeJS, Blue Ocean, SonarScanner, Jenkinslint, Slack Notification)
- Add NodeJs: Global Tools configuration > NodeJs > choose newman for npm.
- Create a new item (job). Select 'pipeline' if you want to define a Jenkinsfile with different stages or environments, but if not then select 'freestyle project'.
- Click on Configure:
- In Source Code Management select git option and integrate your github repo, your branch and save your credentials.
- In Build environments check the option of 'Provide Node & npm bin/ folder to PATH'
- In Build add an 'Add build step' and create your command to install dependencies, HTML reports and run your collection and env variables from your github repo.
- In Post-build Actions fill the fields.
- Exit 'configure' and click on build now to see if the job run fine and the HTML report with the results was generated.
-
In the case of Jenkinsfile, you define all the stages, sh commands and installation there.
Note
you can install and use Jenkins in your localhost or use a Docker image of Jenkins. Both are correct.