From bc200fb87bd39cd10d32eaabeab333930900c3d0 Mon Sep 17 00:00:00 2001
From: paf <philipp.franck@dainst.de>
Date: Tue, 21 Apr 2020 18:56:03 +0200
Subject: [PATCH] create user stories as guidelines for manual testing and
 automated e2e-test development

---
 e2e/user-stories/README.md      |  15 +++
 e2e/user-stories/about.md       |  11 ++
 e2e/user-stories/admin.md       | 172 ++++++++++++++++++++++++++++++++
 e2e/user-stories/super-admin.md | 163 ++++++++++++++++++++++++++++++
 e2e/user-stories/sys-check.md   |  37 +++++++
 e2e/user-stories/test-login.md  | 132 ++++++++++++++++++++++++
 e2e/user-stories/test-run.md    |  36 +++++++
 7 files changed, 566 insertions(+)
 create mode 100644 e2e/user-stories/README.md
 create mode 100644 e2e/user-stories/about.md
 create mode 100644 e2e/user-stories/admin.md
 create mode 100644 e2e/user-stories/super-admin.md
 create mode 100644 e2e/user-stories/sys-check.md
 create mode 100644 e2e/user-stories/test-login.md
 create mode 100644 e2e/user-stories/test-run.md

diff --git a/e2e/user-stories/README.md b/e2e/user-stories/README.md
new file mode 100644
index 00000000..e7f28594
--- /dev/null
+++ b/e2e/user-stories/README.md
@@ -0,0 +1,15 @@
+# User Stories
+These documents will be the basis for 
+* manually testing process
+* E2E-tests programming
+
+It will describe a set of basic paths through the application, 
+including crucial edge-cases. It aims to ensure a basic set of
+functionality but cannot exhaust every possible path. Testers 
+should use this as a minimal guideline what is to test, but
+should try out all edge-cases and variations they can imagine.
+The goal for E2E-tests is to *at least* test those user stories,
+other E2E-tests will follow.
+
+New functionality should never be implemented without test 
+E2E-Tests but must *at least* be described here.  
diff --git a/e2e/user-stories/about.md b/e2e/user-stories/about.md
new file mode 100644
index 00000000..78ca3249
--- /dev/null
+++ b/e2e/user-stories/about.md
@@ -0,0 +1,11 @@
+# about page
+## is accessible
+On the start page,
+
+* click "imprint"
+
+  * imprint-page appears
+  
+* click "back"
+
+  * start page appears again
diff --git a/e2e/user-stories/admin.md b/e2e/user-stories/admin.md
new file mode 100644
index 00000000..ebb0e788
--- /dev/null
+++ b/e2e/user-stories/admin.md
@@ -0,0 +1,172 @@
+# Admin
+## Login
+### with valid credentials of super-user
+On the start page,
+
+* insert credentials of admin-user (`super:user123`)
+
+  * "select workspace"-page appears
+  
+### with invalid credentials
+On the start page,
+
+* insert credentials of super-user (`super:user123`)
+  
+# select workspace   
+On "select workspace"-page
+
+* click on workspace
+
+  * "workspace overview"-page appears
+  * "files"-tab is open
+  * "sys-check-report"-tab available if sys-check in this workspace
+  * "results/answers"-tab available if booklet exists
+  * in headline: name of workspace and rights
+  
+# files tab
+
+On "files"-tab in "workspace overview"-page
+
+ * all files from workspace are listed.
+
+
+## validate button
+
+On "files"-tab in "workspace overview"-page
+
+* click on "validate workspace"-button
+
+  * validation results appear below the buttons.
+  
+## upload button shall upload XML File 
+  
+On "files"-tab in "workspace overview"-page
+
+* click on "upload"-button
+* select Unit-File from your hard drive
+
+  * the new file appears in filelist.
+
+
+## upload button shall not upload invalid XML File
+
+On "files"-tab in "workspace overview"-page
+
+* click on "upload"-button
+* select broken Unit-File from your hard drive
+
+  * XMl-error description appears below the buttons
+  * OK-button appears below error-text
+  
+* click OK-button
+
+  * XMl-error description disappears.
+  
+## upload button shall accept multiple files
+
+On "files"-tab in "workspace overview"-page
+
+* click on "upload"-button
+* select (use shift key) a broken and a valid unit file from your hard drive
+
+  * XMl-error description for the broken file appears below the buttons
+  * OK-button appears below error-text
+  * valid file appears in file-list.
+  
+* click OK-button
+
+  * XMl-error description disappears.
+
+## upload button shall accept zipped archive
+
+On "files"-tab in "workspace overview"-page
+
+* click on "upload"-button
+* select zip-archive with two valid files
+
+  * both files appears in file-list.
+  
+## delete button shall delete files
+
+On "files"-tab in "workspace overview"-page
+
+* check the boxes left to the names of two files
+* click the "delete file"-button
+
+ * "confirm deletion"-modal appears
+
+* click "ok"-button
+
+  * the two files disappear from file-list
+
+# sys-check tab
+
+On "SysCheck"-tab in "workspace overview"-page
+
+ * sys-check-report(s) appear in list
+ 
+## get report-data CSV
+
+* select sys-check-report(s) by checking the boxes left to the names
+* click the "download reports"-button
+
+  * download modal appears or downloads starts (browser dependant)
+  * download contains valid CSV
+  
+## delete reports
+
+* select a sys-check-report-set by checking the boxes left to the names
+* click the delete-button
+
+ * "confirm deletion"-modal appears
+
+* click "ok"-button
+   
+ * the list-entry of this report-set disappears from list.
+ 
+# results tab
+
+On "Results"-tab in "workspace overview"-page
+
+ * result-sets for groups appear in list
+ 
+## "download-answers"-button
+
+On "Results"-tab in "workspace overview"-page
+
+* select a result-set by checking the boxes left to the names
+* click the "download-answers"-button
+
+  * download modal appears or downloads starts (browser dependant)
+  * download contains valid CSV
+  
+## "download-logs"-button
+
+On "Results"-tab in "workspace overview"-page
+
+* select a result-set by checking the boxes left to the names
+* click the "download-logs"-button
+
+  * download modal appears or downloads starts (browser dependant)
+  * download contains valid CSV
+  
+## "download-comments"-button
+
+On "Results"-tab in "workspace overview"-page
+
+* select a result-set by checking the boxes left to the names
+* click the "download-comments"-button
+
+  * download modal appears or downloads starts (browser dependant)
+  * download contains valid CSV
+
+## delete results
+
+* select a result-set by checking the boxes left to the names
+* click the "delete"-button
+
+ * "confirm deletion"-modal appears
+
+* click "ok"-button
+   
+ * the list-entry of this report-set disappears from list.
diff --git a/e2e/user-stories/super-admin.md b/e2e/user-stories/super-admin.md
new file mode 100644
index 00000000..5f9ca754
--- /dev/null
+++ b/e2e/user-stories/super-admin.md
@@ -0,0 +1,163 @@
+# Super-Admin
+## Login
+### with valid credentials of super-user
+On the start page,
+
+* insert credentials of super-user (`super:user123`)
+
+  * "select workspace"-page appears
+  * "super-admin"-button appears
+  
+* click "super-admin"-button
+
+  * "super-user"-page appears
+  * tab "users" is selected
+  * tab "workspaces" exists
+  
+## "users"-tab 
+
+### "create user"-button
+
+On "users"-tab on "super-user"-page
+
+* click the "add user"-button (+)
+
+  * "new user"-modal appears.
+  * "save" button is disabled
+  
+* insert name and password
+
+  * save button is enabled
+  
+* click "save"-button
+
+  * new user appears in list.
+
+
+### change user's rights
+
+On "users"-tab on "super-user"-page
+
+* select a user *by clicking on his name* 
+
+  * all workspaces an this user's (`expired_user`) rights appear on the right side
+  
+* change/give rights by clicking one of the checkboxes
+* click the save-button. 
+  
+  * save confirmation appears.
+  
+* select another user *by clicking on his name*
+* select the first user again
+
+  * rights are still changed
+  
+### delete user
+
+* select a user *by clicking on his name or on the box left to his name*
+
+ * "confirm deletion"-modal appears
+
+* click "ok"-button
+
+ * user vanishes from list. 
+
+
+### change user's password
+
+On "users"-tab on "super-user"-page
+
+* select a user *by clicking on his name*
+* click on the "change-password"-button (the left of the two pen-icons)
+  
+  * "change password"-modal appears
+  
+  * insert new password
+
+* "password changed" confirmation appears.
+
+### change user's super-admin status
+
+On "users"-tab on "super-user"-page
+
+* select a user *by clicking on his name* (not to be confused with selection 
+by the checkbox left to the name)
+* click on the "change-super-admin-status"-button (the right of the 
+two pen-icons)
+
+  * "change-super-admin-status"-modal appears
+  
+* click OK
+
+  * "insert password" modal appears
+  
+* insert password
+
+  * user's super-admin status is gone (the asterisk behind his name vanished).
+  
+
+### don't change user's super-admin status without password
+
+On "users"-tab on "super-user"-page
+
+* select a user *by clicking on his name* (not to be confused with selection 
+by the checkbox left to the name)
+* click on the "change-super-admin-status"-button (the right of the 
+two pen-icons)
+
+  * "change-super-admin-status"-modal appears
+  
+* click OK
+
+  * "insert password" modal appears
+  
+* insert incorrect password
+
+ * warning appears.
+ 
+## "workspaces"-tab
+
+### add workspace
+
+On "workspaces"-tab on "super-user"-page
+
+* click the "add workspace"-button (+)
+
+  * "new workspace"-modal appears.
+  * "save" button is disabled
+  
+* insert name
+
+  * save button is enabled
+  
+* click "save"-button
+
+  * new workspace of this name appears in list.
+  
+### delete workspace 
+
+* select a user *by clicking on the box left to it's name or the box left to it*
+
+ * "confirm deletion"-modal appears
+
+* click "ok"-button
+
+ * workspace vanishes from list. 
+
+### change user's rights on workspace
+
+On "users"-tab on "super-user"-page
+
+* select a workspace *by clicking on it's name* 
+
+  * all users appear on the right side with their rights on this workspace
+  
+* change/give rights by clicking one of the checkboxes
+* click the save-button. 
+  
+  * save confirmation appears
+  
+* select another user *by clicking on his name*
+* select the first user again
+
+  * rights are still changed.
diff --git a/e2e/user-stories/sys-check.md b/e2e/user-stories/sys-check.md
new file mode 100644
index 00000000..05861196
--- /dev/null
+++ b/e2e/user-stories/sys-check.md
@@ -0,0 +1,37 @@
+# SysCheck
+## overview
+### with valid credentials
+On Start-Page,
+
+* click on SysCheck-Button
+
+  * SysCheck.Page-Appears with available SysChecks (`example SysCheck`)
+  
+## starts
+
+On Sys-Check-Overview
+
+* click on the Sys-check
+
+  * computer enviroment is visible in the top-right corner
+  * test starts with speedtest
+  * after speedtest test unit gets loaded
+  * right of that a questionaire
+
+## send report
+
+On ready Sys-Check
+
+* click on "send report"
+
+  * "send-report"-modal appears
+  * send-button is disabled
+  
+* insert password and title (`sendme`, `sometitle`)
+* click on "save"
+
+* check required questions
+  
+  
+
+  
diff --git a/e2e/user-stories/test-login.md b/e2e/user-stories/test-login.md
new file mode 100644
index 00000000..17676ceb
--- /dev/null
+++ b/e2e/user-stories/test-login.md
@@ -0,0 +1,132 @@
+# Test
+## Login
+### with valid credentials
+On the start page,
+
+* insert credentials (`test:user123`)
+
+  * "Insert Code" modal appears
+
+* insert correct code: (`xxx`)
+
+  * booklet overview appears and contains booklets: `Sample booklet`.
+
+### with invalid credentials
+
+On the start page,
+
+* insert invalid credentials (`test:blah`)
+
+  * "Invalid credentials"-message appears.
+
+### with correct credentials but wrong code
+On the start page,
+
+* insert credentials (`test:user123`)
+
+  * "Insert Code" modal appears
+
+* insert code: (`zzz`)
+
+  * booklet overview appears and contains booklets: `Sample booklet`.
+
+  * "Invalid code"-message appears.
+
+* insert correct code (`xxx`)
+* click "continue"
+
+  * booklet overview appears and contains booklets: `Sample booklet`.
+
+## login with codeless-login
+
+On the start page,
+
+* insert credentials of codeless login (`test-review:user123`)
+
+  * booklet overview appears and contains booklets: `Sample booklet`.
+
+## login with passwordless-login
+
+On the start page,
+
+* insert credentials of a login that does not require a password (`test-no-pw:`)
+
+  * booklet overview appears and contains booklets: `Sample booklet`.
+
+## login with expired login
+
+On the start page,
+
+* insert credentials of an expired login (`test-expired:`)
+
+  * "login expired"-warning appears
+  * login form stays
+ 
+* re-enter correct credentials (`test:user123`)
+
+  * booklet overview appears and contains booklets: `Sample booklet`.
+
+Known Bug: https://github.com/iqb-berlin/testcenter-iqb-ng/issues/107
+
+## login with login, that is no active right now
+
+On the start page,
+
+* insert credentials of a login, which is not active right now (`test-future:`)
+
+  * "login invalid"-warning appears
+  * login form stays
+
+* re-enter correct credentials (`test:user123`)
+
+  * booklet overview appears and contains booklets: `Sample booklet`.
+
+Known Bug: https://github.com/iqb-berlin/testcenter-iqb-ng/issues/108
+
+## login survives reload
+
+On the start page,
+
+* insert credentials (`test:user123`)
+
+  * "Insert Code" modal appears
+
+* reload page by pressing [F5] 
+
+  * "Insert Code" modal appears again
+  
+* insert correct code: (`xxx`)
+
+  * booklet overview appears and contains booklets: `Sample booklet`
+  
+* reload page by pressing [F5] 
+
+  * booklet overview appears again.
+
+## Forward/Back Buttons while login do their job
+
+Not implemented yet: https://github.com/iqb-berlin/testcenter-iqb-ng/issues/109
+
+## "login again"-button restarts login-process
+
+On the start page,
+
+* insert credentials (`test:user123`)
+
+  * "Insert Code" modal appears again
+  
+* click "login again"
+
+  * start page appears
+
+* insert credentials again (`test:user123`)
+
+  * "Insert Code" modal appears again
+
+* insert correct code: (`xxx`)
+
+  * booklet overview appears
+  
+* click "login again"
+
+  * start page appears
diff --git a/e2e/user-stories/test-run.md b/e2e/user-stories/test-run.md
new file mode 100644
index 00000000..3e001ca2
--- /dev/null
+++ b/e2e/user-stories/test-run.md
@@ -0,0 +1,36 @@
+# Test
+## Run
+### starts with release word
+
+On Test-Overview-Page,
+
+* click on test
+
+  * "please insert release word"
+  
+* insert correct release word (`sample`)
+
+  * click "continue"
+  
+TODO, has to be defined
+
+https://github.com/iqb-berlin/testcenter-iqb-ng/issues/112  
+
+### starts with first unit
+
+From there,
+
+* first unit appears
+
+* unit navigation works TODO
+
+* return to overview-button
+
+
+...
+
+### review modus
+
+* snackbar mMldungen im review modus
+
+* send comment
-- 
GitLab