mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-06 15:22:47 +01:00
32 lines
991 B
JavaScript
32 lines
991 B
JavaScript
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 ")
|
|
})
|
|
}) |