mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-09 16:52:51 +01:00
Upgrade Cypress (#245)
This commit is contained in:
32
ui/cypress/e2e/catalyst.cy.js
Normal file
32
ui/cypress/e2e/catalyst.cy.js
Normal file
@@ -0,0 +1,32 @@
|
||||
describe('user', () => {
|
||||
it('open ticket', () => {
|
||||
cy.visit('/');
|
||||
|
||||
if (Cypress.env('AUTH') === 'simple') {
|
||||
cy.login();
|
||||
} else if (Cypress.env('AUTH') === 'keycloak') {
|
||||
cy.get("#username").type("bob");
|
||||
cy.get("#password").type("bob");
|
||||
cy.get("#kc-login").click();
|
||||
}
|
||||
|
||||
cy.getCookie('user').should('exist');
|
||||
|
||||
cy.intercept('GET', '/api/userdata/demo', { fixture: 'userdata_demo.json' })
|
||||
cy.intercept('GET', '/api/users/demo', { fixture: 'user_demo.json' })
|
||||
|
||||
cy.visit('http://localhost/ui/tickets');
|
||||
|
||||
// clear caql
|
||||
cy.get("#caqlbar > div > div > div > div > div:nth-child(2) > div > button").click();
|
||||
|
||||
// open ticket
|
||||
cy.contains("live zebra").click()
|
||||
|
||||
// assert url
|
||||
cy.url().should('eq', "http://localhost/ui/tickets/8123")
|
||||
|
||||
// assert title
|
||||
cy.get("h1").should("have.text", " Incident #8123: live zebra ")
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user