mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-28 22:08:34 +00:00
24 lines
932 B
JavaScript
24 lines
932 B
JavaScript
const inHeader = 'User-Header[REDACTED]';
|
|
const inBody = '{ "User": "[REDACTED]" }';
|
|
const shouldExist = Cypress.env('shouldExist');
|
|
|
|
it('Loading Mizu', function () {
|
|
cy.visit(Cypress.env('testUrl'));
|
|
})
|
|
|
|
it(`should ${shouldExist ? '' : 'not'} include ${inHeader}`, function () {
|
|
cy.get('.CollapsibleContainer', { timeout : 15 * 1000}).first().next().then(headerElements => { //TODO change the path and refactor the body and head functions
|
|
const allText = headerElements.text();
|
|
if (allText.includes(inHeader) !== shouldExist)
|
|
throw new Error(`The headers panel doesnt include ${inHeader}`);
|
|
});
|
|
});
|
|
|
|
it(`should ${shouldExist ? '' : 'not'} include ${inBody}`, function () {
|
|
cy.get('.hljs').then(bodyElement => {
|
|
const line = bodyElement.text();
|
|
if (line.includes(inBody) !== shouldExist)
|
|
throw new Error(`The body panel doesnt include ${inBody}`);
|
|
});
|
|
});
|