From 0a03263a6584826c033efa6e3f4c86fe177687e9 Mon Sep 17 00:00:00 2001 From: yodigos Date: Mon, 5 Aug 2024 11:56:54 +0300 Subject: [PATCH 1/8] Check Tests run e2e with elements --- frontend/webapp/cypress.config.ts | 10 ++++------ frontend/webapp/cypress/e2e/firstTest.cy.ts | 14 ++++++++++---- frontend/webapp/cypress/e2e/secondTest.cy.ts | 8 ++++++++ 3 files changed, 22 insertions(+), 10 deletions(-) create mode 100644 frontend/webapp/cypress/e2e/secondTest.cy.ts diff --git a/frontend/webapp/cypress.config.ts b/frontend/webapp/cypress.config.ts index 579ad00cb..d0297dcb6 100644 --- a/frontend/webapp/cypress.config.ts +++ b/frontend/webapp/cypress.config.ts @@ -1,10 +1,8 @@ -import { defineConfig } from 'cypress'; +import {defineConfig} from 'cypress'; export default defineConfig({ - projectId: 'aydhz4', - e2e: { - setupNodeEvents(on, config) { - // implement node event listeners here + e2e: { + setupNodeEvents(on, config) { + }, }, - }, }); diff --git a/frontend/webapp/cypress/e2e/firstTest.cy.ts b/frontend/webapp/cypress/e2e/firstTest.cy.ts index 5c7536e30..ddf2c702b 100644 --- a/frontend/webapp/cypress/e2e/firstTest.cy.ts +++ b/frontend/webapp/cypress/e2e/firstTest.cy.ts @@ -1,6 +1,12 @@ - describe('Basic UI Tests', () => { - it('Main page loads', () => { - cy.visit('localhost:3000') - }) + it('Main page loads', () => { + cy.visit('localhost:3000/overview') + cy.get('[data-id="namespace-0"]').should('have.text', 'defaultcoupon') + cy.get('[data-id="namespace-1"]').should('have.text', 'defaultfrontend') + cy.get('[data-id="namespace-2"]').should('have.text', 'defaultinventory') + cy.get('[data-id="namespace-3"]').should('have.text', 'defaultmembership') + cy.get('[data-id="namespace-4"]').should('have.text', 'defaultpricing') + cy.get('[data-id="destination-0"]').should('have.text', 'e2e-testsTempo') + }) + }) diff --git a/frontend/webapp/cypress/e2e/secondTest.cy.ts b/frontend/webapp/cypress/e2e/secondTest.cy.ts new file mode 100644 index 000000000..16688d8fe --- /dev/null +++ b/frontend/webapp/cypress/e2e/secondTest.cy.ts @@ -0,0 +1,8 @@ +describe('Basic UI Tests', () => { + it('Main page loads', () => { + cy.visit('localhost:3000') + cy.get('[data-id="namespace-0"]').should('have.text', 'defaultcouponnn') + cy.get('[data-id="destination-0"]').should('have.text', 'FDSAElasticsearchnfgfsdg') + }) + +}) From 0021e2dfb18ec4c383ea613e9a1688bebae16191 Mon Sep 17 00:00:00 2001 From: yodigos Date: Mon, 5 Aug 2024 12:17:52 +0300 Subject: [PATCH 2/8] Check Tests run e2e with elements --- .../webapp/cypress/e2e/{firstTest.cy.ts => testOverview.cy.ts} | 2 +- tests/common/ui-tests/run_cypress_tests.sh | 2 +- tests/common/ui-tests/start_odigos_ui.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) rename frontend/webapp/cypress/e2e/{firstTest.cy.ts => testOverview.cy.ts} (92%) diff --git a/frontend/webapp/cypress/e2e/firstTest.cy.ts b/frontend/webapp/cypress/e2e/testOverview.cy.ts similarity index 92% rename from frontend/webapp/cypress/e2e/firstTest.cy.ts rename to frontend/webapp/cypress/e2e/testOverview.cy.ts index ddf2c702b..b921874d3 100644 --- a/frontend/webapp/cypress/e2e/firstTest.cy.ts +++ b/frontend/webapp/cypress/e2e/testOverview.cy.ts @@ -1,6 +1,6 @@ describe('Basic UI Tests', () => { it('Main page loads', () => { - cy.visit('localhost:3000/overview') + cy.visit('localhost:3000') cy.get('[data-id="namespace-0"]').should('have.text', 'defaultcoupon') cy.get('[data-id="namespace-1"]').should('have.text', 'defaultfrontend') cy.get('[data-id="namespace-2"]').should('have.text', 'defaultinventory') diff --git a/tests/common/ui-tests/run_cypress_tests.sh b/tests/common/ui-tests/run_cypress_tests.sh index 95dcaac62..48315a1f9 100755 --- a/tests/common/ui-tests/run_cypress_tests.sh +++ b/tests/common/ui-tests/run_cypress_tests.sh @@ -2,7 +2,7 @@ echo "Running Cypress tests" cd ../../../frontend/webapp || exit -npx cypress run +npx cypress run --spec "cypress/e2e/testOverview.cy.ts" status_cypress=$? if [ $status_cypress -ne 0 ]; then diff --git a/tests/common/ui-tests/start_odigos_ui.sh b/tests/common/ui-tests/start_odigos_ui.sh index 8af830620..e0f8afe62 100755 --- a/tests/common/ui-tests/start_odigos_ui.sh +++ b/tests/common/ui-tests/start_odigos_ui.sh @@ -5,7 +5,7 @@ set -e echo "Running odigos UI setup" cd ../../../frontend/webapp -yarn dev > ../../odigos-ui.log 2>&1 & +odigos ui > ../../odigos-ui.log 2>&1 & # Capture the process ID echo $! > odigos-ui.pid From 50b0b42d626c2242c4a265ab0ed83545fb30ce98 Mon Sep 17 00:00:00 2001 From: yodigos Date: Mon, 5 Aug 2024 12:18:02 +0300 Subject: [PATCH 3/8] Check Tests run e2e with elements --- frontend/webapp/cypress/e2e/secondTest.cy.ts | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 frontend/webapp/cypress/e2e/secondTest.cy.ts diff --git a/frontend/webapp/cypress/e2e/secondTest.cy.ts b/frontend/webapp/cypress/e2e/secondTest.cy.ts deleted file mode 100644 index 16688d8fe..000000000 --- a/frontend/webapp/cypress/e2e/secondTest.cy.ts +++ /dev/null @@ -1,8 +0,0 @@ -describe('Basic UI Tests', () => { - it('Main page loads', () => { - cy.visit('localhost:3000') - cy.get('[data-id="namespace-0"]').should('have.text', 'defaultcouponnn') - cy.get('[data-id="destination-0"]').should('have.text', 'FDSAElasticsearchnfgfsdg') - }) - -}) From ceac05f98815ec3581546570a31f308e23c1b4e4 Mon Sep 17 00:00:00 2001 From: yodigos Date: Mon, 5 Aug 2024 12:37:30 +0300 Subject: [PATCH 4/8] Check Tests run e2e with elements --- tests/common/ui-tests/start_odigos_ui.sh | 3 +-- tests/common/ui-tests/stop_ui_and_clean.sh | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/common/ui-tests/start_odigos_ui.sh b/tests/common/ui-tests/start_odigos_ui.sh index e0f8afe62..17c93fa4b 100755 --- a/tests/common/ui-tests/start_odigos_ui.sh +++ b/tests/common/ui-tests/start_odigos_ui.sh @@ -4,8 +4,7 @@ set -e echo "Running odigos UI setup" -cd ../../../frontend/webapp -odigos ui > ../../odigos-ui.log 2>&1 & +../../../cli/odigos ui > ../../odigos-ui.log 2>&1 & # Capture the process ID echo $! > odigos-ui.pid diff --git a/tests/common/ui-tests/stop_ui_and_clean.sh b/tests/common/ui-tests/stop_ui_and_clean.sh index 7cd625bbc..76e1e81d2 100755 --- a/tests/common/ui-tests/stop_ui_and_clean.sh +++ b/tests/common/ui-tests/stop_ui_and_clean.sh @@ -4,7 +4,7 @@ set -e echo "Killing Odigos UI process" -cd ../../../frontend/webapp +#cd ../../../frontend/webapp kill "$(cat odigos-ui.pid)" rm odigos-ui.pid rm ../../odigos-ui.log \ No newline at end of file From a2953f63721f41ede620c19cff77a19f5333e68f Mon Sep 17 00:00:00 2001 From: yodigos Date: Mon, 5 Aug 2024 14:19:49 +0300 Subject: [PATCH 5/8] Check Tests run e2e with elements --- frontend/webapp/cypress/e2e/testOverview.cy.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/frontend/webapp/cypress/e2e/testOverview.cy.ts b/frontend/webapp/cypress/e2e/testOverview.cy.ts index b921874d3..321f10409 100644 --- a/frontend/webapp/cypress/e2e/testOverview.cy.ts +++ b/frontend/webapp/cypress/e2e/testOverview.cy.ts @@ -1,11 +1,18 @@ -describe('Basic UI Tests', () => { - it('Main page loads', () => { +describe('Overview Page Tests', () => { + it('Overview page loads', () => { cy.visit('localhost:3000') + cy.url().should('eq', 'http://localhost:3000/overview'); + }) + + it('Test Sources exists correctly', () => { cy.get('[data-id="namespace-0"]').should('have.text', 'defaultcoupon') cy.get('[data-id="namespace-1"]').should('have.text', 'defaultfrontend') cy.get('[data-id="namespace-2"]').should('have.text', 'defaultinventory') cy.get('[data-id="namespace-3"]').should('have.text', 'defaultmembership') cy.get('[data-id="namespace-4"]').should('have.text', 'defaultpricing') + }) + + it('Check Destination exist correctly', () => { cy.get('[data-id="destination-0"]').should('have.text', 'e2e-testsTempo') }) From f4294ae75b5bd21504daed42f28997e2f14fc711 Mon Sep 17 00:00:00 2001 From: yodigos Date: Mon, 5 Aug 2024 14:21:35 +0300 Subject: [PATCH 6/8] Check Tests run e2e with elements --- frontend/webapp/cypress/e2e/testOverview.cy.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/frontend/webapp/cypress/e2e/testOverview.cy.ts b/frontend/webapp/cypress/e2e/testOverview.cy.ts index 321f10409..70a51d013 100644 --- a/frontend/webapp/cypress/e2e/testOverview.cy.ts +++ b/frontend/webapp/cypress/e2e/testOverview.cy.ts @@ -5,6 +5,8 @@ describe('Overview Page Tests', () => { }) it('Test Sources exists correctly', () => { + cy.visit('localhost:3000') + cy.get('[data-id="namespace-0"]').should('have.text', 'defaultcoupon') cy.get('[data-id="namespace-1"]').should('have.text', 'defaultfrontend') cy.get('[data-id="namespace-2"]').should('have.text', 'defaultinventory') @@ -13,6 +15,8 @@ describe('Overview Page Tests', () => { }) it('Check Destination exist correctly', () => { + cy.visit('localhost:3000') + cy.get('[data-id="destination-0"]').should('have.text', 'e2e-testsTempo') }) From dd14459374f62c66f87043a14f89733f262958b9 Mon Sep 17 00:00:00 2001 From: yodigos Date: Mon, 5 Aug 2024 14:35:27 +0300 Subject: [PATCH 7/8] Check Tests run e2e with elements --- .../cypress/e2e/{testOverview.cy.ts => test-overview.cy.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename frontend/webapp/cypress/e2e/{testOverview.cy.ts => test-overview.cy.ts} (100%) diff --git a/frontend/webapp/cypress/e2e/testOverview.cy.ts b/frontend/webapp/cypress/e2e/test-overview.cy.ts similarity index 100% rename from frontend/webapp/cypress/e2e/testOverview.cy.ts rename to frontend/webapp/cypress/e2e/test-overview.cy.ts From 81c9bf4e4c460c7e31aa7947b5bf69ea240ba833 Mon Sep 17 00:00:00 2001 From: yodigos Date: Mon, 5 Aug 2024 14:45:30 +0300 Subject: [PATCH 8/8] Check Tests run e2e with elements --- frontend/webapp/cypress/e2e/test-overview.cy.ts | 14 +++++++------- tests/common/ui-tests/run_cypress_tests.sh | 2 +- tests/common/ui-tests/stop_ui_and_clean.sh | 1 - 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/frontend/webapp/cypress/e2e/test-overview.cy.ts b/frontend/webapp/cypress/e2e/test-overview.cy.ts index 70a51d013..2f79ee754 100644 --- a/frontend/webapp/cypress/e2e/test-overview.cy.ts +++ b/frontend/webapp/cypress/e2e/test-overview.cy.ts @@ -1,12 +1,14 @@ describe('Overview Page Tests', () => { - it('Overview page loads', () => { + + beforeEach(() => { cy.visit('localhost:3000') + }); + + it('should overview page redirect correctly', () => { cy.url().should('eq', 'http://localhost:3000/overview'); }) - it('Test Sources exists correctly', () => { - cy.visit('localhost:3000') - + it('should Sources exists', () => { cy.get('[data-id="namespace-0"]').should('have.text', 'defaultcoupon') cy.get('[data-id="namespace-1"]').should('have.text', 'defaultfrontend') cy.get('[data-id="namespace-2"]').should('have.text', 'defaultinventory') @@ -14,9 +16,7 @@ describe('Overview Page Tests', () => { cy.get('[data-id="namespace-4"]').should('have.text', 'defaultpricing') }) - it('Check Destination exist correctly', () => { - cy.visit('localhost:3000') - + it('should Destinations exists', () => { cy.get('[data-id="destination-0"]').should('have.text', 'e2e-testsTempo') }) diff --git a/tests/common/ui-tests/run_cypress_tests.sh b/tests/common/ui-tests/run_cypress_tests.sh index 48315a1f9..29e684771 100755 --- a/tests/common/ui-tests/run_cypress_tests.sh +++ b/tests/common/ui-tests/run_cypress_tests.sh @@ -2,7 +2,7 @@ echo "Running Cypress tests" cd ../../../frontend/webapp || exit -npx cypress run --spec "cypress/e2e/testOverview.cy.ts" +npx cypress run --spec "cypress/e2e/test-overview.cy.ts" status_cypress=$? if [ $status_cypress -ne 0 ]; then diff --git a/tests/common/ui-tests/stop_ui_and_clean.sh b/tests/common/ui-tests/stop_ui_and_clean.sh index 76e1e81d2..c848a3e14 100755 --- a/tests/common/ui-tests/stop_ui_and_clean.sh +++ b/tests/common/ui-tests/stop_ui_and_clean.sh @@ -4,7 +4,6 @@ set -e echo "Killing Odigos UI process" -#cd ../../../frontend/webapp kill "$(cat odigos-ui.pid)" rm odigos-ui.pid rm ../../odigos-ui.log \ No newline at end of file