Fix acceptance test (body size and right side pane changes) (#907)

This commit is contained in:
gadotroee 2022-03-22 09:56:34 +02:00 committed by GitHub
parent 308fa78955
commit 2a31739100
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 25 deletions

View File

@ -142,7 +142,9 @@ function deepCheck(generalDict, protocolDict, methodDict, entry) {
if (value) { if (value) {
if (value.tab === valueTabs.response) 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 => { cy.get(Cypress.env('bodyJsonClass')).then(text => {
expect(text.text()).to.match(value.regex) expect(text.text()).to.match(value.regex)
}); });

View File

@ -40,22 +40,16 @@ it('filtering guide check', function () {
}); });
it('right side sanity test', 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');
if (parseInt(bodySizeByDetails) < 0) {
throw new Error(`The body size cannot be negative. got the size: ${bodySizeByDetails}`)
}
cy.get('#entryDetailedTitleElapsedTime').then(timeInMs => { cy.get('#entryDetailedTitleElapsedTime').then(timeInMs => {
const time = timeInMs.text(); const time = timeInMs.text();
if (time < '0ms') { if (time < '0ms') {
throw new Error(`The time in the top line cannot be negative ${time}`); throw new Error(`The time in the top line cannot be negative ${time}`);
} }
});
// 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('#rightSideContainer [title="Status Code"]').then(status => { cy.get('#rightSideContainer [title="Status Code"]').then(status => {
const statusCode = status.text(); const statusCode = status.text();
@ -66,9 +60,6 @@ it('right side sanity test', function () {
}); });
}); });
}); });
});
});
});
checkIllegalFilter('invalid filter'); checkIllegalFilter('invalid filter');
@ -252,7 +243,9 @@ function deeperChcek(leftSidePath, rightSidePath, filterName, leftSideExpectedTe
} }
function checkRightSideResponseBody() { 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'); clickCheckbox('Decode Base64');
cy.get(`${Cypress.env('bodyJsonClass')}`).then(value => { cy.get(`${Cypress.env('bodyJsonClass')}`).then(value => {