Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# QA Automation Project (v2.6.0)
# QA Automation Project (v2.6.2)

[![Coverage](https://img.shields.io/badge/Coverage-100%25-brightgreen)](https://github.com/destrutoyt/yourrepo)
![Build Status](https://img.shields.io/github/actions/workflow/status/destrutoyt/qa-automation-automationexercise/playwright.yml)
![GitHub License](https://img.shields.io/github/license/destrutoyt/qa-automation-automationexercise)
![GitHub commit activity (branch)](https://img.shields.io/github/commit-activity/t/destrutoyt/qa-automation-automationexercise/main)
![version](https://img.shields.io/badge/version-2.6.0-blue)
![version](https://img.shields.io/badge/version-2.6.2-blue)

## 🚀 Project Overview

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "qa-automation-automationexercise",
"version": "2.6.0",
"version": "2.6.2",
"description": "QA automation project showcasing UI, API, and visual tests for AutomationExercise. Integrated with Docker, Allure, and CI/CD pipelines.",
"main": "index.js",
"directories": {
Expand Down
16 changes: 14 additions & 2 deletions tests/api-handling.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ test('@API - (POST) Verify login with wrong credentials', async ({ request }) =>

// Check the body for the API's error code
const body = await response.json()
console.log(body) // Verifies actual API response
expect(body.responseCode).toBe(400) // API seems to returned 400 code instead of 404.
expect(body.message).toBe('Bad request, email or password parameter is missing in POST request.') // API returns a different message than "User not found!" (Website docs might be outdated)
})
Expand All @@ -34,9 +33,22 @@ test('@API - (GET) Get all products', async ({ request }) => {
})

// Additional API tests
test('@API - (POST) - To All Product List is invalid', async ({ request }) => {
test('@API - (POST) To All Product List is invalid', async ({ request }) => {
const response = await request.post('https://automationexercise.com/api/productsList')
expect(response.status()).toBe(200)
const body = await response.json()
expect(body.message).toBe('This request method is not supported.')
})

test('@API - (POST) Search Product with valid product', async ({ request }) => {
const response = await request.post('https://automationexercise.com/api/searchProduct', {
// used 'form' instead of 'data' because the API expects form-urlencoded data.
form: {
search_product: 'top',
},
})

expect(response.status()).toBe(200)
const body = await response.json()
expect(body.products.length).toBeGreaterThan(0)
})
Loading