Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: FE e2e tests #1423

Merged
merged 10 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions frontend/webapp/cypress.config.ts
Original file line number Diff line number Diff line change
@@ -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) {
},
},
},
});
6 changes: 0 additions & 6 deletions frontend/webapp/cypress/e2e/firstTest.cy.ts

This file was deleted.

23 changes: 23 additions & 0 deletions frontend/webapp/cypress/e2e/test-overview.cy.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
describe('Overview Page Tests', () => {

beforeEach(() => {
cy.visit('localhost:3000')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think you can put the url inside environment variables, and then if we switch route it will be only in one place
`export default defineConfig({

env: {
overview: 'http://localhost:3000/overview',
base_url: 'http://localhost:3000/'
},
})`

});

it('should overview page redirect correctly', () => {
cy.url().should('eq', 'http://localhost:3000/overview');
})

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')
cy.get('[data-id="namespace-3"]').should('have.text', 'defaultmembership')
cy.get('[data-id="namespace-4"]').should('have.text', 'defaultpricing')
})

it('should Destinations exists', () => {
cy.get('[data-id="destination-0"]').should('have.text', 'e2e-testsTempo')
})

})
2 changes: 1 addition & 1 deletion tests/common/ui-tests/run_cypress_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

echo "Running Cypress tests"
cd ../../../frontend/webapp || exit
npx cypress run
npx cypress run --spec "cypress/e2e/test-overview.cy.ts"

status_cypress=$?
if [ $status_cypress -ne 0 ]; then
Expand Down
3 changes: 1 addition & 2 deletions tests/common/ui-tests/start_odigos_ui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
set -e

echo "Running odigos UI setup"
cd ../../../frontend/webapp
yarn dev > ../../odigos-ui.log 2>&1 &
../../../cli/odigos ui > ../../odigos-ui.log 2>&1 &

# Capture the process ID
echo $! > odigos-ui.pid
Expand Down
1 change: 0 additions & 1 deletion tests/common/ui-tests/stop_ui_and_clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading