diff --git a/tests/ui/cypress_specs/multi_user_openid_connect.js b/tests/ui/cypress_specs/multi_user_openid_connect.js index 5783b748..24a076ad 100644 --- a/tests/ui/cypress_specs/multi_user_openid_connect.js +++ b/tests/ui/cypress_specs/multi_user_openid_connect.js @@ -16,7 +16,11 @@ let login_test_settings = [ describe('OpenID Connect users', () => { it('The correct login form is shown', () => { + cy.intercept('GET', '/api/v1/authorized').as('isAuthorized') + cy.intercept('GET', '/auth/login').as('getLoginURL') + cy.intercept('GET', /^http:\/\/localhost:1818\/authorize.+/).as('oidcLoginForm') cy.visit('/') + cy.wait(['@isAuthorized', '@getLoginURL', '@oidcLoginForm']) // make sure we haven't been redirected away from Krill (as would be the // case if an OpenID Connect login form were shown) @@ -70,7 +74,9 @@ describe('OpenID Connect users', () => { cy.get('#userinfo_table').contains(admin.u) // logout + cy.intercept('GET', /^http:\/\/localhost:1818\/logout.+/).as('oidcLogout') cy.get('.logout').click() + cy.wait('@oidcLogout').its('response.statusCode').should('eq', 302) // verify that we are shown the OpenID Connect provider login page cy.url().should('not.include', Cypress.config('baseUrl')) @@ -78,7 +84,7 @@ describe('OpenID Connect users', () => { cy.get('input[name="username"]') }) - it.skip('Login receives short-lived token that cannot be refreshed', () => { + it('Login receives short-lived token that cannot be refreshed', () => { cy.visit('/') cy.url().should('not.include', Cypress.config('baseUrl')) cy.contains('Mock OpenID Connect login form') diff --git a/tests/ui/mod.rs b/tests/ui/mod.rs index 6eca4c28..ce1ad083 100644 --- a/tests/ui/mod.rs +++ b/tests/ui/mod.rs @@ -42,6 +42,8 @@ async fn do_run_krill_ui_test(test_name: &str) { Command::new("docker") .arg("run") + .arg("--name") + .arg("cypress") .arg("--rm") .arg("--net=host") .arg("--ipc=host") @@ -49,7 +51,9 @@ async fn do_run_krill_ui_test(test_name: &str) { .arg(format!("{}:/e2e", env::current_dir().unwrap().display())) .arg("-w") .arg("/e2e") - .arg("cypress/included:5.5.0") + // .arg("-e") + // .arg("DEBUG=cypress:proxy:http:*") + .arg("cypress/included:6.1.0") .arg("--browser") .arg("chrome") .arg("--spec")