Skip to content

Conversation

@Abhi007-collab
Copy link

What did you build?

Implemented both Cypress and Postman/Newman tests as part of the project.


🧪 Cypress (UI E2E)

Created an end-to-end test for the SauceDemo purchase flow:

  • Logs in with valid credentials
  • Sorts products by price (low to high)
  • Adds an item to the cart
  • Proceeds to checkout and completes the order
  • Asserts that the confirmation message appears successfully

This test demonstrates a realistic UI-driven purchase workflow and ensures the key user journey works as expected.


🔌 Postman/Newman (API Testing)

Built an API test suite for the /posts endpoint on jsonplaceholder.typicode.com.
The Postman collection includes:

  1. GET /posts → Verifies that all posts are returned and response status = 200
  2. POST /posts → Creates a new post and asserts correct status (201) and response body
  3. PUT /posts/{id} → Updates an existing post and checks response structure
  4. DELETE /posts/{id} → Deletes a post and verifies correct status code (200)

All requests use dynamic variables and assertions for response validation.
The same collection can be executed via Newman CLI to demonstrate command-line automation.


🧰 Approach and Tools

  • Used Postman GUI for building and debugging the API requests
  • Used Newman CLI to run the same collection in a scriptable, CI/CD-friendly way
  • Used Cypress for browser-based validation of end-to-end purchase flow

Tradeoffs: Focused on clarity and reproducibility rather than full coverage of every edge case.


What would you improve with more time?

  • Add negative test cases and more detailed response schema validation for APIs
  • Integrate both Cypress and Newman runs into a single CI pipeline
  • Parameterize environment URLs and credentials
  • Use Page Object Model in Cypress for scalability
  • Add data-driven tests and custom reports for better maintainability

Which task did you choose?

  • Cypress
  • Postman/Newman

🧭 How to Run the Tests

Cypress UI Test:

npx cypress run --spec cypress/e2e/saucedemo-purchase.spec.js

Postman/newman -
npx newman run ~/Downloads/jsonplaceholder.postman_collection.json \
  -e ~/Downloads/jsonplaceholder-env.postman_environment.json \
  -r cli,html \
  --reporter-html-export ~/Downloads/newman-report.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants