mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-09 06:21:57 +00:00
Cypress: new Redact and NoRedact tests (#618)
This commit is contained in:
23
acceptanceTests/cypress/integration/tests/RedactTests.js
Normal file
23
acceptanceTests/cypress/integration/tests/RedactTests.js
Normal file
@@ -0,0 +1,23 @@
|
||||
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}`);
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user