SUMMARY
integration/__main__.py is a CLI-based HTTP client that can interact
with Hostea Dashboard and Gitea.
Integration tests are run via integration/tests.sh, which is a
driver for the HTTP client at integration/__main__.py. The script is
capable of spinning up a test environment consisting of services
defined in docker-compose-dev-deps.yml and the Hostea Dashboard and
tearing it down after a successful run.
The credentials used to create various accounts and other parameters
are all defined in integration/tests.sh script it self. So it is
self contained.
CLIENT FUNCTIONALITY:
HOSTEA DASHBOARD:
- register user with email verification
- login
- create OIDC app
- visit support page
GITEA:
- Install Gitea(DB configuration, etc. The first form that's
presented to the visitor after a new instance is deployed)
- Register User
- Login User
- Create repository
- Configure OIDC SSO
- Login via SSO
STEPS
1. Register new user on dashboard
2. Confirm user email, link is received from email. maildev/maildev
is an SMTP server specifically built for testing emails locally.
It comes with a REST API[0], which is used to access emails
3. Sign in to Dashboard
4. Visit /support/new/ on dashboard to raise new support request
5. Redirection to Hostea Gitea support repository is done via
JavaScript, so we simply test to see if the support repository's
new issue page is present in the Dashboard response
6. Go to support repository's new issue page. Gitea will redirect to
sign in page
7. Parse sign in page, find OIDC SSO link in sign in page
8. Visit OIDC SSO link in sign in page, to be redirected to
authorization page
9. If OIDC integration on Dashboard is setup via `create_oidc`
management command, then auto-authorization will be enabled for
the integration. So user will be redirected to Gitea
10. For new OIDC logins, Gitea will present a form to choose
preferred username and enter email address. So fill that form
and submit it.
Please note the form submits to a different URL than the one at
which the form is available. See `Gitea.__link_acount` and
`Gitea.__link_acount_signup` and its usage in `Gitea._sso_login`
11. Verify user creation by GET /{username}, should respond HTTP 200
12. Visit new issue on support repository, should respond HTTP 200
RESOURCES
[0]: https://github.com/maildev/maildev/blob/master/docs/rest.md