-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
64 changed files
with
2,133 additions
and
169 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,22 @@ import { defineConfig } from 'cypress'; | |
|
||
export default defineConfig({ | ||
requestTimeout: 15000, | ||
e2e: { | ||
env: { | ||
api: 'http://0.0.0.0:33000/graphql', | ||
keycloak: 'http://0.0.0.0:38088', | ||
url: 'http://0.0.0.0:3000', | ||
user_guest: '[email protected]', | ||
user_reporter: '[email protected]', | ||
user_developer: '[email protected]', | ||
user_maintainer: '[email protected]', | ||
user_owner: '[email protected]', | ||
// orgs | ||
user_orguser: '[email protected]', | ||
user_orgviewer: '[email protected]', | ||
user_orgowner: '[email protected]', | ||
// top level user for all default tests | ||
user_platformowner: '[email protected]', | ||
}, | ||
}, | ||
}); |
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,36 @@ | ||
import BackupsAction from 'cypress/support/actions/backups/BackupsAction'; | ||
import { aliasMutation, registerIdleHandler } from 'cypress/utils/aliasQuery'; | ||
|
||
const backups = new BackupsAction(); | ||
|
||
describe('Backups page', () => { | ||
beforeEach(() => { | ||
cy.login(Cypress.env('user_owner'), Cypress.env('user_owner')); | ||
registerIdleHandler('idle'); | ||
}); | ||
|
||
it('Retrieves a backup', () => { | ||
cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main/backups`); | ||
|
||
cy.intercept('POST', Cypress.env('api'), req => { | ||
aliasMutation(req, 'addRestore'); | ||
}); | ||
|
||
backups.doRetrieveBackup(); | ||
}); | ||
|
||
it('Changes shown results', () => { | ||
cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main/deployments`); | ||
|
||
cy.waitForNetworkIdle('@idle', 500); | ||
backups.doResultsLimitedchangeCheck(10); | ||
cy.waitForNetworkIdle('@idle', 500); | ||
backups.doResultsLimitedchangeCheck(25); | ||
cy.waitForNetworkIdle('@idle', 500); | ||
backups.doResultsLimitedchangeCheck(50); | ||
cy.waitForNetworkIdle('@idle', 500); | ||
backups.doResultsLimitedchangeCheck(100); | ||
cy.waitForNetworkIdle('@idle', 500); | ||
backups.doResultsLimitedchangeCheck('all'); | ||
}); | ||
}); |
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,40 @@ | ||
import deploymentAction from 'cypress/support/actions/deployment/DeploymentAction'; | ||
import { aliasMutation, registerIdleHandler } from 'cypress/utils/aliasQuery'; | ||
|
||
const deployment = new deploymentAction(); | ||
|
||
describe('Deployment page', () => { | ||
beforeEach(() => { | ||
cy.login(Cypress.env('user_owner'), Cypress.env('user_owner')); | ||
registerIdleHandler('idle'); | ||
}); | ||
|
||
it('Cancels a deployment', () => { | ||
cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main/deployments`); | ||
|
||
cy.intercept('POST', Cypress.env('api'), req => { | ||
aliasMutation(req, 'cancelDeployment'); | ||
}); | ||
cy.waitForNetworkIdle('@idle', 500); | ||
|
||
deployment.navigateToRunningDeployment(); | ||
deployment.doCancelDeployment(); | ||
}); | ||
|
||
it('Toggles logviewer parsed/raw', () => { | ||
cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main/deployments`); | ||
|
||
cy.waitForNetworkIdle('@idle', 500); | ||
|
||
deployment.navigateToRunningDeployment(); | ||
deployment.doToggleLogViewer(); | ||
}); | ||
|
||
it('Checks accordion headings toggling content', () => { | ||
cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main/deployments`); | ||
|
||
cy.waitForNetworkIdle('@idle', 500); | ||
deployment.navigateToRunningDeployment(); | ||
deployment.doLogViewerCheck(); | ||
}); | ||
}); |
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,47 @@ | ||
import DeploymentsAction from 'cypress/support/actions/deployments/DeploymentsAction'; | ||
import { aliasMutation, registerIdleHandler } from 'cypress/utils/aliasQuery'; | ||
|
||
const deployments = new DeploymentsAction(); | ||
|
||
describe('Deployments page', () => { | ||
beforeEach(() => { | ||
cy.login(Cypress.env('user_owner'), Cypress.env('user_owner')); | ||
registerIdleHandler('idle'); | ||
}); | ||
|
||
it('Does a deployment', () => { | ||
cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main/deployments`); | ||
|
||
cy.intercept('POST', Cypress.env('api'), req => { | ||
aliasMutation(req, 'deployEnvironmentLatest'); | ||
}); | ||
|
||
deployments.doDeployment(); | ||
}); | ||
it('Cancels a deployment', () => { | ||
cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main/deployments`); | ||
|
||
cy.intercept('POST', Cypress.env('api'), req => { | ||
aliasMutation(req, 'cancelDeployment'); | ||
}); | ||
cy.waitForNetworkIdle('@idle', 500); | ||
|
||
deployments.doCancelDeployment(); | ||
}); | ||
|
||
it('Changes shown results', () => { | ||
cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main/deployments`); | ||
|
||
cy.waitForNetworkIdle('@idle', 500); | ||
|
||
deployments.doResultsLimitedchangeCheck(10); | ||
cy.waitForNetworkIdle('@idle', 500); | ||
deployments.doResultsLimitedchangeCheck(25); | ||
cy.waitForNetworkIdle('@idle', 500); | ||
deployments.doResultsLimitedchangeCheck(50); | ||
cy.waitForNetworkIdle('@idle', 500); | ||
deployments.doResultsLimitedchangeCheck(100); | ||
cy.waitForNetworkIdle('@idle', 500); | ||
deployments.doResultsLimitedchangeCheck('all'); | ||
}); | ||
}); |
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,59 +1,30 @@ | ||
import { testData } from 'cypress/fixtures/variables'; | ||
import EnvironmentAction from 'cypress/support/actions/environment/EnvironmentAction'; | ||
import ProjectAction from 'cypress/support/actions/project/ProjectAction'; | ||
import EnvOverviewAction from 'cypress/support/actions/envOverview/EnvOverviewAction'; | ||
import { aliasMutation } from 'cypress/utils/aliasQuery'; | ||
|
||
const project = new ProjectAction(); | ||
|
||
const environment = new EnvironmentAction(); | ||
const environmentOverview = new EnvOverviewAction(); | ||
|
||
describe('Environment page', () => { | ||
beforeEach(() => { | ||
cy.login(Cypress.env().CY_EMAIL, Cypress.env().CY_PASSWORD); | ||
|
||
cy.wait(500); | ||
cy.log('Full user navigation from /projects page'); | ||
|
||
cy.visit(Cypress.env().CY_URL); | ||
|
||
project.doNavigateToFirst(); | ||
|
||
environment.doEnvNavigation(); | ||
cy.login(Cypress.env('user_owner'), Cypress.env('user_owner')); | ||
}); | ||
|
||
it('Toggles Hide/Show values', () => { | ||
environment.doHideShowToggle(); | ||
|
||
cy.log('show all values'); | ||
it('Checks environment details', () => { | ||
cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main`); | ||
|
||
environment.doValueToggle(); | ||
environmentOverview.doEnvTypeCheck(); | ||
environmentOverview.doDeployTypeCheck(); | ||
|
||
cy.log('disable show/edit buttons'); | ||
environmentOverview.doSourceCheck(); | ||
|
||
environment.doHideShowToggle(); | ||
environmentOverview.doRoutesCheck(); | ||
}); | ||
it('Deletes the environment', () => { | ||
cy.visit(`${Cypress.env('url')}/projects/lagoon-demo/lagoon-demo-main`); | ||
|
||
it('Adds or updates a variable', () => { | ||
const { name, value } = testData.variables[0]; | ||
|
||
environment.doAddVariable(name, value); | ||
|
||
cy.intercept('POST', Cypress.env().CY_API).as('addRequest'); | ||
|
||
cy.wait('@addRequest'); | ||
|
||
cy.log('check if variable was created'); | ||
cy.get('.data-table > .data-row').should('contain', name); | ||
}); | ||
|
||
it('Deletes a variable', () => { | ||
const { name } = testData.variables[0]; | ||
|
||
environment.doDeleteVariable(name); | ||
|
||
cy.intercept('POST', Cypress.env().CY_API).as('deleteRequest'); | ||
|
||
cy.wait('@deleteRequest'); | ||
cy.intercept('POST', Cypress.env('api'), req => { | ||
aliasMutation(req, 'deleteEnvironment'); | ||
}); | ||
|
||
cy.get('.data-table > .data-row').should('not.contain', name); | ||
environmentOverview.doDeleteEnvironment('main'); | ||
}); | ||
}); |
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
Oops, something went wrong.