20dde50ed3
* web/add webdriverIO testing layer This commit adds WebdriverIO as an end-to-end solution to unit testing. WebdriverIO can be run both locally and remotely, supports strong integration with web components, and is generally robust for use in pipelines. I'll confess to working through a tutorial on how to do this for web components, and this is just chapter 2 (I think there are 5 or so chapters...). There's a makefile, with help! If you just run `make` it tells you: ``` Specify a command. The choices are: help Show this help node_modules Runs `npm install` to prepare this feature precommit Run the precommit: spell check all comments, eslint with sonarJS, prettier-write test-good-login Test that we can log into the server. Requires a running instance of the server. test-bad-login Test that bad usernames and passwords create appropriate error messages ``` ... because Makefiles are documentation, and documentation belongs in Makefiles. I've chosen to go with a PageObject-oriented low-level DSL; what that means is that for each major components (a page, a form, a wizard), there's a class that provides human-readable names for human-interactable and human-viewable objects on the page. The LoginPage object, for example, has selectors for the username, password, submit button, and the failure alert; accessing those allows us to test for items as expected., and to write a DSL for "a good login" that's as straightforward as: ``` await LoginPage.open(); await LoginPage.login("ken@goauthentik.io", "eat10bugs"); await expect(UserLibraryPage.pageHeader).toHaveText("My applications"); ``` There was a *lot* of messing around with the LoginPage to get the username and password into the system. For example, I had to do this with all the `waitForClickable` and `waitForEnable` because we both keep the buttons inaccessible until the form has something and we "black out" the page (put a darkening filter over it) while accessing the flow, meaning there was a race condition such that the test would attempt to interact with the username or password field before it was accessible. But this works now, which is very nice. ``` JavaScript get inputUsername() { return $('>>>input[name="uidField"]'); } get btnSubmit() { return $('>>>button[type="submit"]'); } async username(username: string) { await this.inputUsername.waitForClickable(); await this.inputUsername.setValue(username); await this.btnSubmit.waitForEnabled(); await this.btnSubmit.click(); } ``` The bells & whistles of *Prettier*, *Eslint*, and *Codespell* have also been enabled. I do like my guardrails. * web/adding tests: added comments and cleaned up some administrative features. * web/test: changed the name of one test to reflect it's 'good' status * web: improve testing by adding test admin user via blueprint * fix blueprints Signed-off-by: Jens Langhammer <jens@goauthentik.io> * update package name Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add dependabot Signed-off-by: Jens Langhammer <jens@goauthentik.io> * prettier run Signed-off-by: Jens Langhammer <jens@goauthentik.io> * add basic CI Signed-off-by: Jens Langhammer <jens@goauthentik.io> * remove hooks Signed-off-by: Jens Langhammer <jens@goauthentik.io> --------- Signed-off-by: Jens Langhammer <jens@goauthentik.io> Co-authored-by: Jens Langhammer <jens@goauthentik.io>
119 lines
2.4 KiB
YAML
119 lines
2.4 KiB
YAML
version: 2
|
|
updates:
|
|
- package-ecosystem: "github-actions"
|
|
directory: "/"
|
|
schedule:
|
|
interval: daily
|
|
time: "04:00"
|
|
open-pull-requests-limit: 10
|
|
commit-message:
|
|
prefix: "ci:"
|
|
labels:
|
|
- dependencies
|
|
- package-ecosystem: gomod
|
|
directory: "/"
|
|
schedule:
|
|
interval: daily
|
|
time: "04:00"
|
|
open-pull-requests-limit: 10
|
|
commit-message:
|
|
prefix: "core:"
|
|
labels:
|
|
- dependencies
|
|
- package-ecosystem: npm
|
|
directory: "/web"
|
|
schedule:
|
|
interval: daily
|
|
time: "04:00"
|
|
labels:
|
|
- dependencies
|
|
open-pull-requests-limit: 10
|
|
commit-message:
|
|
prefix: "web:"
|
|
# TODO: deduplicate these groups
|
|
groups:
|
|
sentry:
|
|
patterns:
|
|
- "@sentry/*"
|
|
babel:
|
|
patterns:
|
|
- "@babel/*"
|
|
- "babel-*"
|
|
eslint:
|
|
patterns:
|
|
- "@typescript-eslint/eslint-*"
|
|
- "eslint"
|
|
- "eslint-*"
|
|
storybook:
|
|
patterns:
|
|
- "@storybook/*"
|
|
- "*storybook*"
|
|
esbuild:
|
|
patterns:
|
|
- "@esbuild/*"
|
|
- package-ecosystem: npm
|
|
directory: "/tests/wdio"
|
|
schedule:
|
|
interval: daily
|
|
time: "04:00"
|
|
labels:
|
|
- dependencies
|
|
open-pull-requests-limit: 10
|
|
commit-message:
|
|
prefix: "web:"
|
|
# TODO: deduplicate these groups
|
|
groups:
|
|
sentry:
|
|
patterns:
|
|
- "@sentry/*"
|
|
babel:
|
|
patterns:
|
|
- "@babel/*"
|
|
- "babel-*"
|
|
eslint:
|
|
patterns:
|
|
- "@typescript-eslint/eslint-*"
|
|
- "eslint"
|
|
- "eslint-*"
|
|
storybook:
|
|
patterns:
|
|
- "@storybook/*"
|
|
- "*storybook*"
|
|
esbuild:
|
|
patterns:
|
|
- "@esbuild/*"
|
|
- package-ecosystem: npm
|
|
directory: "/website"
|
|
schedule:
|
|
interval: daily
|
|
time: "04:00"
|
|
open-pull-requests-limit: 10
|
|
commit-message:
|
|
prefix: "website:"
|
|
labels:
|
|
- dependencies
|
|
groups:
|
|
docusaurus:
|
|
patterns:
|
|
- "@docusaurus/*"
|
|
- package-ecosystem: pip
|
|
directory: "/"
|
|
schedule:
|
|
interval: daily
|
|
time: "04:00"
|
|
open-pull-requests-limit: 10
|
|
commit-message:
|
|
prefix: "core:"
|
|
labels:
|
|
- dependencies
|
|
- package-ecosystem: docker
|
|
directory: "/"
|
|
schedule:
|
|
interval: daily
|
|
time: "04:00"
|
|
open-pull-requests-limit: 10
|
|
commit-message:
|
|
prefix: "core:"
|
|
labels:
|
|
- dependencies
|