diff options
| author | mo khan <mo@mokhan.ca> | 2025-03-12 12:17:21 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-03-12 12:17:21 -0600 |
| commit | be5f3951f2d8a0d53dfc329b083f0cef86cbd184 (patch) | |
| tree | 63113fb63e42cf4bda8ccd6fa3c9d8fb68ec794a /test | |
| parent | 165c21995a6d26304a42655555ec1a3c81d2a6ca (diff) | |
test: fix the e2e test to enter username/password
Diffstat (limited to 'test')
| -rw-r--r-- | test/e2e_test.go | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/e2e_test.go b/test/e2e_test.go index a0d87ff..12e28ed 100644 --- a/test/e2e_test.go +++ b/test/e2e_test.go @@ -35,15 +35,12 @@ func TestAuthx(t *testing.T) { }() t.Run("SAML", func(t *testing.T) { - t.Run("GET http://idp.example.com:8080/saml/metadata.xml", func(t *testing.T) { - response := x.Must(http.Get("http://idp.example.com:8080/saml/metadata.xml")) - assert.Equal(t, http.StatusOK, response.StatusCode) - }) - - t.Run("GET http://ui.example.com:8080/saml/metadata.xml", func(t *testing.T) { - response := x.Must(http.Get("http://ui.example.com:8080/saml/metadata.xml")) - assert.Equal(t, http.StatusOK, response.StatusCode) - }) + for _, url := range []string{"http://idp.example.com:8080/saml/metadata.xml", "http://ui.example.com:8080/saml/metadata.xml"} { + t.Run("GET "+url, func(t *testing.T) { + response := x.Must(http.Get(url)) + assert.Equal(t, http.StatusOK, response.StatusCode) + }) + } t.Run("GET http://ui.example.com:8080/saml/new", func(t *testing.T) { x.Must(page.Goto("http://ui.example.com:8080/saml/new")) @@ -51,6 +48,10 @@ func TestAuthx(t *testing.T) { assert.Equal(t, "http://idp.example.com:8080/saml/new", action) assert.NoError(t, page.Locator("#submit-button").Click()) + page.Locator("#username").Fill("username1") + page.Locator("#password").Fill("password1") + assert.NoError(t, page.Locator("#login-button").Click()) + action = x.Must(page.Locator("#postback-form").GetAttribute("action")) assert.Equal(t, "http://ui.example.com:8080/saml/assertions", action) assert.NoError(t, page.Locator("#submit-button").Click()) |
