-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GEN-1927]: Cypress test for onboarding-flow (#1930)
- Loading branch information
1 parent
6e60978
commit 3199daf
Showing
10 changed files
with
88 additions
and
152 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
describe('Root Connection', () => { | ||
it('Should fetch a config with GraphQL. A redirect of any kind confirms Frontend + Backend connections.', () => { | ||
cy.visit('/'); | ||
|
||
// If GraphQL failed to fetch the config, the app will remain on "/", thereby failing the test. | ||
cy.location().should((loc) => { | ||
expect(loc.pathname).to.be.oneOf(['/choose-sources', '/overview']); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,28 @@ | ||
describe('Onboarding', () => { | ||
it('Visiting the root path fetches a config with GraphQL. A fresh install will result in a redirect to the start of onboarding, confirming Front + Back connections', () => { | ||
cy.visit('/'); | ||
// If backend connection failed for any reason, teh default redirect would be "/overview" | ||
cy.location('pathname').should('eq', '/choose-sources'); | ||
it('Should contain at least a "default" namespace', () => { | ||
cy.visit('/choose-sources'); | ||
|
||
cy.get('#no-data').should('not.exist'); | ||
cy.get('#namespace-default').should('exist'); | ||
}); | ||
|
||
it('Should contain at least a "Jaeger" destination', () => { | ||
cy.visit('/choose-destination'); | ||
|
||
cy.get('button').contains('ADD DESTINATION').click(); | ||
cy.get('#no-data').should('not.exist'); | ||
|
||
cy.get('input').should('have.attr', 'placeholder', 'Search...').type('Jaeger'); | ||
cy.get('#destination-jaeger').should('exist'); | ||
}); | ||
|
||
it('Should allow the user to pass every step, and end-up on the Overview page.', () => { | ||
cy.visit('/choose-sources'); | ||
|
||
cy.get('button').contains('NEXT').click(); | ||
cy.location('pathname').should('eq', '/choose-destination'); | ||
|
||
cy.get('button').contains('DONE').click(); | ||
cy.location('pathname').should('eq', '/overview'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,11 @@ | |
"version": "0.1.0", | ||
"private": true, | ||
"scripts": { | ||
"back:build": "cd .. && go build -o ./odigos-backend", | ||
"back:start": "cd .. && ./odigos-backend --port 8085 --debug --address 0.0.0.0", | ||
"predev": "rm -rf .next", | ||
"dev": "next dev", | ||
"prebuild": "rm -rf out", | ||
"build": "next build", | ||
"start": "next start", | ||
"lint": "next lint --fix", | ||
"cy": "cypress run --e2e -q", | ||
"cy:run": "cypress run --e2e -q", | ||
"cy:open": "cypress open --e2e -b electron" | ||
}, | ||
"dependencies": { | ||
|
@@ -39,6 +35,5 @@ | |
"eslint-config-next": "15.0.3", | ||
"postcss": "^8.4.49", | ||
"typescript": "5.6.3" | ||
}, | ||
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,56 @@ | ||
apiVersion: chainsaw.kyverno.io/v1alpha1 | ||
kind: Test | ||
metadata: | ||
name: ui-cypress | ||
name: ui | ||
spec: | ||
description: Run E2E tests against Odigos UI using Cypress | ||
skipDelete: true | ||
steps: | ||
- name: Start the UI | ||
- name: Install Odigos CLI | ||
try: | ||
- script: | ||
timeout: 300s | ||
content: ../../common/odigos_ui.sh start | ||
- name: Test the UI | ||
timeout: 60s | ||
content: | | ||
../../../cli/odigos install --version e2e-test | ||
- name: Install App - Simple Demo | ||
try: | ||
- script: | ||
timeout: 300s | ||
content: ../../common/odigos_ui.sh test | ||
- name: End the UI | ||
timeout: 120s | ||
content: | | ||
kubectl apply -f https://raw.githubusercontent.com/odigos-io/simple-demo/main/kubernetes/deployment.yaml | ||
kubectl wait --for=condition=available --timeout=120s deployment --all -n default | ||
- name: Add Destination - Jaeger | ||
try: | ||
- script: | ||
timeout: 60s | ||
content: ../../common/odigos_ui.sh stop | ||
timeout: 120s | ||
content: | | ||
kubectl apply -f https://raw.githubusercontent.com/odigos-io/simple-demo/main/kubernetes/jaeger.yaml | ||
kubectl wait --for=condition=available --timeout=120s deployment/jaeger -n tracing | ||
- name: Start UI from CLI | ||
try: | ||
- script: | ||
timeout: 10s | ||
content: | | ||
nohup ../../../cli/odigos ui --beta > odigos-ui.log 2>&1 & | ||
sleep 5 | ||
- name: Wait for UI | ||
try: | ||
- script: | ||
timeout: 30s | ||
content: | | ||
for i in {1..10}; do | ||
curl -s http://localhost:3000 && break || sleep 2 | ||
done | ||
- name: Run Cypress tests | ||
try: | ||
- script: | ||
timeout: 300s | ||
content: | | ||
cd ../../../frontend/webapp | ||
yarn install | ||
yarn cy:run |