diff --git a/acceptanceTests/Makefile b/acceptanceTests/Makefile index 9e7c7f0e0..28160f211 100644 --- a/acceptanceTests/Makefile +++ b/acceptanceTests/Makefile @@ -1,2 +1,3 @@ test: ## Run acceptance tests. + @npm install cypress@10.0.1 -y @go test ./... -timeout 1h -v diff --git a/acceptanceTests/cypress.config.js b/acceptanceTests/cypress.config.js new file mode 100644 index 000000000..aaa620128 --- /dev/null +++ b/acceptanceTests/cypress.config.js @@ -0,0 +1,31 @@ +const { defineConfig } = require('cypress') + +module.exports = defineConfig({ + watchForFileChanges: false, + viewportWidth: 1920, + viewportHeight: 1080, + video: false, + screenshotOnRunFailure: false, + defaultCommandTimeout: 6000, + env: { + testUrl: 'http://localhost:8899/', + redactHeaderContent: 'User-Header[REDACTED]', + redactBodyContent: '{ "User": "[REDACTED]" }', + regexMaskingBodyContent: '[REDACTED]', + greenFilterColor: 'rgb(210, 250, 210)', + redFilterColor: 'rgb(250, 214, 220)', + bodyJsonClass: '.hljs', + mizuWidth: 1920, + normalMizuHeight: 1080, + hugeMizuHeight: 3500, + }, + e2e: { + // We've imported your old cypress plugins here. + // You may want to clean this up later by importing these. + // setupNodeEvents(on, config) { + // return require('./cypress/plugins/index.js')(on, config) + // }, + specPattern: 'cypress/e2e/tests/*.js', + supportFile: false + }, +}) diff --git a/acceptanceTests/cypress.json b/acceptanceTests/cypress.json deleted file mode 100644 index d6757fcb3..000000000 --- a/acceptanceTests/cypress.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "watchForFileChanges":false, - "viewportWidth": 1920, - "viewportHeight": 1080, - "video": false, - "screenshotOnRunFailure": false, - "defaultCommandTimeout": 6000, - "testFiles": [ - "tests/GuiPort.js", - "tests/MultipleNamespaces.js", - "tests/Redact.js", - "tests/NoRedact.js", - "tests/Regex.js", - "tests/RegexMasking.js", - "tests/IgnoredUserAgents.js", - "tests/UiTest.js", - "tests/Redis.js", - "tests/Rabbit.js", - "tests/serviceMapFunction.js" - ], - - "env": { - "testUrl": "http://localhost:8899/", - "redactHeaderContent": "User-Header[REDACTED]", - "redactBodyContent": "{ \"User\": \"[REDACTED]\" }", - "regexMaskingBodyContent": "[REDACTED]", - "greenFilterColor": "rgb(210, 250, 210)", - "redFilterColor": "rgb(250, 214, 220)", - "bodyJsonClass": ".hljs", - "mizuWidth": 1920, - "normalMizuHeight": 1080, - "hugeMizuHeight": 3500 - } -} diff --git a/acceptanceTests/cypress/integration/testHelpers/StatusBarHelper.js b/acceptanceTests/cypress/e2e/testHelpers/StatusBarHelper.js similarity index 100% rename from acceptanceTests/cypress/integration/testHelpers/StatusBarHelper.js rename to acceptanceTests/cypress/e2e/testHelpers/StatusBarHelper.js diff --git a/acceptanceTests/cypress/integration/testHelpers/TrafficHelper.js b/acceptanceTests/cypress/e2e/testHelpers/TrafficHelper.js similarity index 99% rename from acceptanceTests/cypress/integration/testHelpers/TrafficHelper.js rename to acceptanceTests/cypress/e2e/testHelpers/TrafficHelper.js index 4d38fe7bf..30b85445b 100644 --- a/acceptanceTests/cypress/integration/testHelpers/TrafficHelper.js +++ b/acceptanceTests/cypress/e2e/testHelpers/TrafficHelper.js @@ -4,8 +4,6 @@ export const valueTabs = { none: null } -const maxEntriesInDom = 13; - export function isValueExistsInElement(shouldInclude, content, domPathToContainer){ it(`should ${shouldInclude ? '' : 'not'} include '${content}'`, function () { cy.get(domPathToContainer).then(htmlText => { diff --git a/acceptanceTests/cypress/integration/tests/GuiPort.js b/acceptanceTests/cypress/e2e/tests/GuiPort.js similarity index 100% rename from acceptanceTests/cypress/integration/tests/GuiPort.js rename to acceptanceTests/cypress/e2e/tests/GuiPort.js diff --git a/acceptanceTests/cypress/integration/tests/IgnoredUserAgents.js b/acceptanceTests/cypress/e2e/tests/IgnoredUserAgents.js similarity index 100% rename from acceptanceTests/cypress/integration/tests/IgnoredUserAgents.js rename to acceptanceTests/cypress/e2e/tests/IgnoredUserAgents.js diff --git a/acceptanceTests/cypress/integration/tests/MultipleNamespaces.js b/acceptanceTests/cypress/e2e/tests/MultipleNamespaces.js similarity index 100% rename from acceptanceTests/cypress/integration/tests/MultipleNamespaces.js rename to acceptanceTests/cypress/e2e/tests/MultipleNamespaces.js diff --git a/acceptanceTests/cypress/integration/tests/NoRedact.js b/acceptanceTests/cypress/e2e/tests/NoRedact.js similarity index 100% rename from acceptanceTests/cypress/integration/tests/NoRedact.js rename to acceptanceTests/cypress/e2e/tests/NoRedact.js diff --git a/acceptanceTests/cypress/integration/tests/Rabbit.js b/acceptanceTests/cypress/e2e/tests/Rabbit.js similarity index 100% rename from acceptanceTests/cypress/integration/tests/Rabbit.js rename to acceptanceTests/cypress/e2e/tests/Rabbit.js diff --git a/acceptanceTests/cypress/integration/tests/Redact.js b/acceptanceTests/cypress/e2e/tests/Redact.js similarity index 100% rename from acceptanceTests/cypress/integration/tests/Redact.js rename to acceptanceTests/cypress/e2e/tests/Redact.js diff --git a/acceptanceTests/cypress/integration/tests/Redis.js b/acceptanceTests/cypress/e2e/tests/Redis.js similarity index 100% rename from acceptanceTests/cypress/integration/tests/Redis.js rename to acceptanceTests/cypress/e2e/tests/Redis.js diff --git a/acceptanceTests/cypress/integration/tests/Regex.js b/acceptanceTests/cypress/e2e/tests/Regex.js similarity index 100% rename from acceptanceTests/cypress/integration/tests/Regex.js rename to acceptanceTests/cypress/e2e/tests/Regex.js diff --git a/acceptanceTests/cypress/integration/tests/RegexMasking.js b/acceptanceTests/cypress/e2e/tests/RegexMasking.js similarity index 100% rename from acceptanceTests/cypress/integration/tests/RegexMasking.js rename to acceptanceTests/cypress/e2e/tests/RegexMasking.js diff --git a/acceptanceTests/cypress/integration/tests/UiTest.js b/acceptanceTests/cypress/e2e/tests/UiTest.js similarity index 100% rename from acceptanceTests/cypress/integration/tests/UiTest.js rename to acceptanceTests/cypress/e2e/tests/UiTest.js diff --git a/acceptanceTests/extensions_test.go b/acceptanceTests/extensions_test.go index 8e0da9d30..f4f8d4a15 100644 --- a/acceptanceTests/extensions_test.go +++ b/acceptanceTests/extensions_test.go @@ -105,7 +105,7 @@ func TestRedis(t *testing.T) { } } - RunCypressTests(t, "npx cypress@9.5.4 run --spec \"cypress/integration/tests/Redis.js\"") + RunCypressTests(t, "npx cypress run --spec \"cypress/e2e/tests/Redis.js\"") } func TestAmqp(t *testing.T) { @@ -236,5 +236,5 @@ func TestAmqp(t *testing.T) { ch.Close() } - RunCypressTests(t, "npx cypress@9.5.4 run --spec \"cypress/integration/tests/Rabbit.js\"") + RunCypressTests(t, "npx cypress run --spec \"cypress/e2e/tests/Rabbit.js\"") } diff --git a/acceptanceTests/tap_test.go b/acceptanceTests/tap_test.go index f140fde1a..b71210bbb 100644 --- a/acceptanceTests/tap_test.go +++ b/acceptanceTests/tap_test.go @@ -78,7 +78,7 @@ func basicTapTest(t *testing.T, shouldCheckSrcAndDest bool, extraArgs... string) expectedPodsStr += fmt.Sprintf("Name:%vNamespace:%v", expectedPods[i].Name, expectedPods[i].Namespace) } - RunCypressTests(t, fmt.Sprintf("npx cypress@9.5.4 run --spec \"cypress/integration/tests/UiTest.js\" --env entriesCount=%d,arrayDict=%v,shouldCheckSrcAndDest=%v", + RunCypressTests(t, fmt.Sprintf("npx cypress run --spec \"cypress/e2e/tests/UiTest.js\" --env entriesCount=%d,arrayDict=%v,shouldCheckSrcAndDest=%v", entriesCount, expectedPodsStr, shouldCheckSrcAndDest)) }) } @@ -135,7 +135,7 @@ func TestTapGuiPort(t *testing.T) { } } - RunCypressTests(t, fmt.Sprintf("npx cypress@9.5.4 run --spec \"cypress/integration/tests/GuiPort.js\" --env name=%v,namespace=%v,port=%d", + RunCypressTests(t, fmt.Sprintf("npx cypress run --spec \"cypress/e2e/tests/GuiPort.js\" --env name=%v,namespace=%v,port=%d", "httpbin", "mizu-tests", guiPort)) }) } @@ -182,7 +182,7 @@ func TestTapAllNamespaces(t *testing.T) { return } - RunCypressTests(t, fmt.Sprintf("npx cypress@9.5.4 run --spec \"cypress/integration/tests/MultipleNamespaces.js\" --env name1=%v,name2=%v,name3=%v,namespace1=%v,namespace2=%v,namespace3=%v", + RunCypressTests(t, fmt.Sprintf("npx cypress run --spec \"cypress/e2e/tests/MultipleNamespaces.js\" --env name1=%v,name2=%v,name3=%v,namespace1=%v,namespace2=%v,namespace3=%v", expectedPods[0].Name, expectedPods[1].Name, expectedPods[2].Name, expectedPods[0].Namespace, expectedPods[1].Namespace, expectedPods[2].Namespace)) } @@ -231,7 +231,7 @@ func TestTapMultipleNamespaces(t *testing.T) { return } - RunCypressTests(t, fmt.Sprintf("npx cypress@9.5.4 run --spec \"cypress/integration/tests/MultipleNamespaces.js\" --env name1=%v,name2=%v,name3=%v,namespace1=%v,namespace2=%v,namespace3=%v", + RunCypressTests(t, fmt.Sprintf("npx cypress run --spec \"cypress/e2e/tests/MultipleNamespaces.js\" --env name1=%v,name2=%v,name3=%v,namespace1=%v,namespace2=%v,namespace3=%v", expectedPods[0].Name, expectedPods[1].Name, expectedPods[2].Name, expectedPods[0].Namespace, expectedPods[1].Namespace, expectedPods[2].Namespace)) } @@ -277,7 +277,7 @@ func TestTapRegex(t *testing.T) { return } - RunCypressTests(t, fmt.Sprintf("npx cypress@9.5.4 run --spec \"cypress/integration/tests/Regex.js\" --env name=%v,namespace=%v", + RunCypressTests(t, fmt.Sprintf("npx cypress run --spec \"cypress/e2e/tests/Regex.js\" --env name=%v,namespace=%v", expectedPods[0].Name, expectedPods[0].Namespace)) } @@ -376,7 +376,7 @@ func TestTapRedact(t *testing.T) { } } - RunCypressTests(t, "npx cypress@9.5.4 run --spec \"cypress/integration/tests/Redact.js\"") + RunCypressTests(t, "npx cypress run --spec \"cypress/e2e/tests/Redact.js\"") } func TestTapNoRedact(t *testing.T) { @@ -426,7 +426,7 @@ func TestTapNoRedact(t *testing.T) { } } - RunCypressTests(t, "npx cypress@9.5.4 run --spec \"cypress/integration/tests/NoRedact.js\"") + RunCypressTests(t, "npx cypress run --spec \"cypress/e2e/tests/NoRedact.js\"") } func TestTapRegexMasking(t *testing.T) { @@ -479,7 +479,7 @@ func TestTapRegexMasking(t *testing.T) { } } - RunCypressTests(t, "npx cypress@9.5.4 run --spec \"cypress/integration/tests/RegexMasking.js\"") + RunCypressTests(t, "npx cypress run --spec \"cypress/e2e/tests/RegexMasking.js\"") } @@ -541,7 +541,7 @@ func TestTapIgnoredUserAgents(t *testing.T) { } } - RunCypressTests(t, "npx cypress@9.5.4 run --spec \"cypress/integration/tests/IgnoredUserAgents.js\"") + RunCypressTests(t, "npx cypress run --spec \"cypress/e2e/tests/IgnoredUserAgents.js\"") } func TestTapDumpLogs(t *testing.T) {