diff --git a/acceptanceTests/cypress/integration/testHelpers/TrafficHelper.js b/acceptanceTests/cypress/integration/testHelpers/TrafficHelper.js index b125271ac..94ff12a3a 100644 --- a/acceptanceTests/cypress/integration/testHelpers/TrafficHelper.js +++ b/acceptanceTests/cypress/integration/testHelpers/TrafficHelper.js @@ -142,7 +142,9 @@ function deepCheck(generalDict, protocolDict, methodDict, entry) { if (value) { if (value.tab === valueTabs.response) - cy.contains('Response').click(); + // temporary fix, change to some "data-cy" attribute, + // this will fix the issue that happen because we have "response:" in the header of the right side + cy.get('#rightSideContainer > :nth-child(3)').contains('Response').click(); cy.get(Cypress.env('bodyJsonClass')).then(text => { expect(text.text()).to.match(value.regex) }); diff --git a/acceptanceTests/cypress/integration/tests/UiTest.js b/acceptanceTests/cypress/integration/tests/UiTest.js index ec2395a17..9b5b4867a 100644 --- a/acceptanceTests/cypress/integration/tests/UiTest.js +++ b/acceptanceTests/cypress/integration/tests/UiTest.js @@ -40,32 +40,23 @@ it('filtering guide check', function () { }); it('right side sanity test', function () { - cy.get('#entryDetailedTitleBodySize').then(sizeTopLine => { - const sizeOnTopLine = sizeTopLine.text().replace(' B', ''); - cy.contains('Response').click(); - cy.contains('Body Size (bytes)').parent().next().then(size => { - const bodySizeByDetails = size.text(); - expect(sizeOnTopLine).to.equal(bodySizeByDetails, 'The body size in the top line should match the details in the response'); + cy.get('#entryDetailedTitleElapsedTime').then(timeInMs => { + const time = timeInMs.text(); + if (time < '0ms') { + throw new Error(`The time in the top line cannot be negative ${time}`); + } + }); - if (parseInt(bodySizeByDetails) < 0) { - throw new Error(`The body size cannot be negative. got the size: ${bodySizeByDetails}`) - } + // temporary fix, change to some "data-cy" attribute, + // this will fix the issue that happen because we have "response:" in the header of the right side + cy.get('#rightSideContainer > :nth-child(3)').contains('Response').click(); - cy.get('#entryDetailedTitleElapsedTime').then(timeInMs => { - const time = timeInMs.text(); - if (time < '0ms') { - throw new Error(`The time in the top line cannot be negative ${time}`); - } + cy.get('#rightSideContainer [title="Status Code"]').then(status => { + const statusCode = status.text(); + cy.contains('Status').parent().next().then(statusInDetails => { + const statusCodeInDetails = statusInDetails.text(); - cy.get('#rightSideContainer [title="Status Code"]').then(status => { - const statusCode = status.text(); - cy.contains('Status').parent().next().then(statusInDetails => { - const statusCodeInDetails = statusInDetails.text(); - - expect(statusCode).to.equal(statusCodeInDetails, 'The status code in the top line should match the status code in details'); - }); - }); - }); + expect(statusCode).to.equal(statusCodeInDetails, 'The status code in the top line should match the status code in details'); }); }); }); @@ -252,7 +243,9 @@ function deeperChcek(leftSidePath, rightSidePath, filterName, leftSideExpectedTe } function checkRightSideResponseBody() { - cy.contains('Response').click(); + // temporary fix, change to some "data-cy" attribute, + // this will fix the issue that happen because we have "response:" in the header of the right side + cy.get('#rightSideContainer > :nth-child(3)').contains('Response').click(); clickCheckbox('Decode Base64'); cy.get(`${Cypress.env('bodyJsonClass')}`).then(value => {