diff --git a/test-resources/ui/multi_user_openid_connect_provider_not_available.conf b/test-resources/ui/multi_user_openid_connect_provider_not_available.conf new file mode 100644 index 00000000..db80adc6 --- /dev/null +++ b/test-resources/ui/multi_user_openid_connect_provider_not_available.conf @@ -0,0 +1,12 @@ +data_dir = "/tmp/krill" +service_uri = "https://localhost:3000/" +log_level = "trace" +log_type = "stderr" + +auth_type = "openid-connect" +auth_token = "secret" + +[auth_openidconnect] +issuer_url = "http://localhost:1818" +client_id = "client-id-123" +client_secret = "some-secret" diff --git a/tests/multi_user_openid_connect_provider_not_available.rs b/tests/multi_user_openid_connect_provider_not_available.rs new file mode 100644 index 00000000..761b5d6f --- /dev/null +++ b/tests/multi_user_openid_connect_provider_not_available.rs @@ -0,0 +1,8 @@ +#[cfg(feature = "ui-tests")] +mod ui; + +#[tokio::test] +#[cfg(all(feature = "ui-tests", feature = "multi-user"))] +async fn multi_user_openid_connect_provider_not_available_test() { + ui::run_krill_ui_test("multi_user_openid_connect_provider_not_available", false, false).await +} \ No newline at end of file diff --git a/tests/ui/cypress_specs/multi_user_openid_connect_provider_not_available.js b/tests/ui/cypress_specs/multi_user_openid_connect_provider_not_available.js new file mode 100644 index 00000000..0f51c33e --- /dev/null +++ b/tests/ui/cypress_specs/multi_user_openid_connect_provider_not_available.js @@ -0,0 +1,19 @@ +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) + // cy.url().should('not.include', Cypress.config('baseUrl')) + + // // make sure that this is our mock OpenID Connect provider + // cy.contains('Mock OpenID Connect login form') + + // // check that a username input field is shown on the page + // cy.get('input[name="username"]') + }) +}) \ No newline at end of file