summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-03-12 10:49:35 -0600
committermo khan <mo@mokhan.ca>2025-03-12 10:49:35 -0600
commita06598e7bec98aa1f9912f6ce1ff6d59c7e9ea04 (patch)
tree60b944c3466c78b99c9fdca7c5ac47f6e0c88394
parent4f59ea126d0f3d4c6e51f9dc7579f5481135adc6 (diff)
chore: remove ./bin/e2e script
-rwxr-xr-xbin/e2e23
-rw-r--r--test/e2e_test.go38
2 files changed, 17 insertions, 44 deletions
diff --git a/bin/e2e b/bin/e2e
deleted file mode 100755
index fc7ca5b..0000000
--- a/bin/e2e
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-
-set -e
-BROWSER="w3m"
-
-if [ -n "${DEBUG}" ]; then
- set -x
- BROWSER="xdg-open"
-fi
-
-curl http://idp.example.com:8080/saml/metadata.xml
-curl http://idp.example.com:8080/.well-known/openid-configuration
-curl http://idp.example.com:8080/.well-known/oauth-authorization-server
-curl http://idp.example.com:8080/.well-known/webfinger
-
-curl http://ui.example.com:8080/saml/metadata.xml
-
-$BROWSER http://ui.example.com:8080/saml/new
-$BROWSER http://ui.example.com:8080/oidc/new
-
-curl http://api.example.com:8080/projects.json
-curl -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiI2YmYxZTlmMy02OGIwLTQ4NmYtOGVlZi0wODFmZTg2YjJlODMiLCJpYXQiOjE3NDEyOTAzMzJ9.e30=' -XPOST http://api.example.com:8080/projects --data '{"name": "gitlab"}'
-curl http://api.example.com:8080/projects.json
diff --git a/test/e2e_test.go b/test/e2e_test.go
index c4b03bd..a0d87ff 100644
--- a/test/e2e_test.go
+++ b/test/e2e_test.go
@@ -35,35 +35,31 @@ func TestAuthx(t *testing.T) {
}()
t.Run("SAML", func(t *testing.T) {
- t.Run("IdP", func(t *testing.T) {
- t.Run("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://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("SP", func(t *testing.T) {
- t.Run("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)
- })
+ 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)
+ })
- t.Run("ACS", func(t *testing.T) {
- x.Must(page.Goto("http://ui.example.com:8080/saml/new"))
- action := x.Must(page.Locator("#idp-form").GetAttribute("action"))
- assert.Equal(t, "http://idp.example.com:8080/saml/new", action)
- assert.NoError(t, page.Locator("#submit-button").Click())
+ 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"))
+ action := x.Must(page.Locator("#idp-form").GetAttribute("action"))
+ assert.Equal(t, "http://idp.example.com:8080/saml/new", action)
+ assert.NoError(t, page.Locator("#submit-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())
- assert.Contains(t, x.Must(page.Content()), "Received SAML Response")
- })
+ 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())
+ assert.Contains(t, x.Must(page.Content()), "Received SAML Response")
})
})
t.Run("OIDC", func(t *testing.T) {
- t.Run("login", func(t *testing.T) {
+ t.Run("GET http://ui.example.com:8080/oidc/new", func(t *testing.T) {
x.Must(page.Goto("http://ui.example.com:8080/oidc/new"))
assert.Contains(t, page.URL(), "http://idp.example.com:8080/oauth/authorize")
assert.NoError(t, page.Locator("#submit-button").Click())