From e3c1086c87d23be2e9892e6515be714dffdc9e4f Mon Sep 17 00:00:00 2001 From: suman123 Date: Fri, 3 Mar 2023 12:57:46 +0530 Subject: [PATCH 1/2] Updated custom commnds for RESTAPI logs --- CHANGELOG.md | 5 +++++ cypress-shared/support/common/api_commands.js | 2 +- cypress-shared/support/common/commands.js | 5 ++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c73c4e01..9d0921e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## [2.4.1] - 2023-03-03 +### Added +- [ENGINEERS-1065] Updated logs for restAPI + +## [2.4.1] - 2023-03-03 + ### Fixed - [ENGINEERS-1184] Fixed TypeError: axios is not a function diff --git a/cypress-shared/support/common/api_commands.js b/cypress-shared/support/common/api_commands.js index b0aae110..9de7bc71 100644 --- a/cypress-shared/support/common/api_commands.js +++ b/cypress-shared/support/common/api_commands.js @@ -47,7 +47,7 @@ Cypress.Commands.add('getAPI', (url, headers) => { method: 'GET', url: ${url}, ${headers ? `headers: ${headers}` : ''} - ${FAIL_ON_STATUS_CODE_STRING} + ${FAIL_ON_STATUS_CODE_STRING} })`) cy.request({ method: 'GET', diff --git a/cypress-shared/support/common/commands.js b/cypress-shared/support/common/commands.js index 3861c163..438749df 100644 --- a/cypress-shared/support/common/commands.js +++ b/cypress-shared/support/common/commands.js @@ -9,6 +9,7 @@ import { saveOrderId, } from './support.js' import { generateAddtoCartCardSelector } from './utils.js' +import { FAIL_ON_STATUS_CODE } from './constants.js' Cypress.Commands.add('qe', (msg = '') => { const logFile = `${ @@ -28,10 +29,12 @@ Cypress.Commands.add('addGraphqlLogs', (query, variables) => { Cypress.Commands.add( 'addLogsForRestAPI', - ({ method = 'POST', url, body = null } = {}) => { + ({ method = 'POST', url, body = null, headers = null } = {}) => { cy.request({ url, method, + headers, + ...FAIL_ON_STATUS_CODE, body, }) } From 31b7388b7a16a70d9f4af893711a724d3a566459 Mon Sep 17 00:00:00 2001 From: suman123 Date: Fri, 3 Mar 2023 13:42:50 +0530 Subject: [PATCH 2/2] Updated custom commnds for RESTAPI logs --- CHANGELOG.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9d0921e8..38e4a49b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,5 @@ ## [Unreleased] -## [2.4.1] - 2023-03-03 - ### Added - [ENGINEERS-1065] Updated logs for restAPI