Search This Blog

Thursday, September 2, 2021

API Automation Guidelines

 As an automation engineer, we need to follow a few guidelines.

Few of the guidelines as below:

  • No code change in the master branch directly - work on feature branches

  • Build the project locally before raising a PR

  • Run the test(s) locally before raising a PR

  • There has to be at least 1 person who reviews a PR

    • Post your PR link on the slack channel tagging concerned people and the reviewer would merge the PR and update with a comment on the slack thread

    • Reviewer has to ensure that the newly added tests are passing on the pipeline before merging

  • Ensure we add proper commit message while committing any code

    • Example: “automated customer cancel in order flow” or “modified X to achieve Y“. Basically meaningful commit instead of just writing “commit“ “fixed“ etc

  • Test Method should be 40-50 lines long at max

    • Break it into private methods if needed

    • Name the test method such that there is NO need of documenting its behaviour - test method names should start with "verify******"

  • Do NOT span any PR beyond 3-4 days - either get it merged within this time period or close the current one (if it is spilling over 3-4 days) and create another after local rebase

  • Put all assertions in Test classes (use return in helper methods to get what needs to be compared for assertions)

  • Always add a message with assertions to be logged upon a failure - it gives the good context of the issue in the report upon a failure, upfront

  • Ensure the correct tags are attached to the scenarios/tests before raising a PR (Smoke, Regression, ServiceType)

  • Don’t use “System.out.println” in the code, use TestNG logger only.

  • Add allure annotations properly so test reports can be used effectively.

  • Test your code with all negative cases. Avoid null pointer exceptions in your code.

  • Add logging for each api call (Request Call/Request Payload/Response Json are the minimal ones).

  • Add all other necessary logging for your test case so it can be helpful later for the debugging

  • Avoid adding redundant code and create a helper method instead.

  • Always add health check verification for the new APIs.

QA Process Guidelines

 As part of QA, we need to follow a few guidelines to deliver the product fast and with quality.

Few of the guidelines are as follow:

  • QA Process

    • Add postman collection for new API's in the existing collection as part of sprint story (create a sub-task)

    • QA should do PRD review before even picking any sprint task and figure out issue there itself

    • Identify critical scenarios before dev start coding and share your feedback upfront

    • Add test cases in JIRA and share it with dev/PM for review before dropping a build to QA.

    • Ask the dev team to test the critical scenarios by themselves and need to publish the Test Results.

    • Ask dev team to publish unit test report

    • Look into big impact of the sprint story from an application perspective instead of checking specific task

    • Create a checklist for production release

    • Each team member should monitor Crashlytics report after the release

    • Always add first-level analysis in the defect including Request/Response, back-end, mobile application logs

    • Verify logs as part of sprint story testing. If logs have been added for the feature, it helps to debug any issue on the feature

    • QA should take all necessary access to debug the issue so they can do first-level analysis by themselves

    • Enhance App Regression Suite with every release

  • Ask dev to verify APK from their end for few critical cases before sharing with QA

  • QA should own deployment on staging/QA env

 

  • Prod Bugs RCA

    • Template to write RCA in JIRA

      • Description of the issue

        • Application Version

        • Android/iOS Version

      • Steps to reproduce

      • Impact

        • App crash impact

        • Orders impacted

      • The root cause of the issue (how it introduced)

      • How can we avoid this issue in future or similar issues

      • Time took to reproduce the issue

      • Tag/Label issue type (Functional/Performance/Infra)

  • QA Involvement

    • Get a detailed understanding of the issue so we can tag the issue correctly

    • QA of the POD/Team should take responsibility w.r.t issue raised

 

  • Automation

    • Each team member should follow automation guidelines while writing code

    • Identify smoke test suite to automate

    • Everyone in the team must automate test cases

    • At least 50% of sprint tasks must be automated

 

  • Postman Collection

    • Each team member responsible to maintain postman collection w.r.t his deliverables.

My Profile

My photo
can be reached at 09916017317