Skip to content

Commit

Permalink
#161 Implement review findings and update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lgorzitze committed Nov 4, 2024
1 parent b1dbac9 commit aa659c9
Show file tree
Hide file tree
Showing 15 changed files with 448 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export default function UsersImportErrorTable({content, ...props}: UsersImportEr
<Table.Body.Row.Column>
{content[i].lineNumber}
</Table.Body.Row.Column>
<Table.Body.Row.Column>
<Table.Body.Row.Column data-testid={"import-error-message"}>
{prepareMessage(content[i])}
</Table.Body.Row.Column>
</Table.Body.Row>
Expand Down
58 changes: 49 additions & 9 deletions integrationTests/cypress/e2e/import_PWDReset_false.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,79 @@ Feature: Tests for uploading file with user that has password reset disabled
@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: a user uploads a file
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_f.csv"
Then the user import page shows an import with the message "Import successfully completed!" and the details "Created accounts (1)"

@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: after uploading a file a user inspects the user import details page
When the user opens the user import details page
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_f.csv"
And the user opens the user import details page
And the user clicks on the details regarding the "created" user import
Then the table shows the information about the "created" user "testUser"

@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: after uploading a file a user downloads the import overview
When the user opens the user import details page
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_f.csv"
And the user opens the user import details page
And the user downloads the import overview
Then the import result is downloaded and contains information regarding "1" created, "0" updated and "0" skipped accounts in the file "tap_userimport_pwd_f.csv"

@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: after uploading a file a user inspects the users page
When the user opens the users page
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_f.csv"
And the user opens the users page
Then the new user "testUser" was added

@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: after uploading a file an imported user can be edited
When the user opens the users page
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_f.csv"
And the user opens the users page
And the user clicks on the edit-user button for the user "testUser"
Then the password reset flag is checked

@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: after uploading a file a user inspects the user import summaries page
When the user opens the user import summaries page
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_f.csv"
And the user opens the user import summaries page
Then a table with the import information "New: 1, Updated: 0, Skipped: 0" regarding the file "tap_userimport_pwd_f.csv" is shown

@clean_user_import
@clean_before
@clear_downloadDir
@clear_mails
Scenario: after the user import the newly created user receives an email
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_f.csv"
Then the user "testUser" receives an email with his user details

@clean_before
@clear_downloadDir
@clear_mails
Scenario: a newly created user tries to log in for the first time
When the user logs out by visiting the cas logout page
And the user "testUser" tries to log in with his generated password
Then the user is asked to change his password
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_f.csv"
And the user logs out by visiting the cas logout page
And the user "testUser" tries to log in with his generated password
Then the user is asked to change his password
61 changes: 54 additions & 7 deletions integrationTests/cypress/e2e/import_PWDReset_true.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,45 +13,92 @@ Feature: Tests for uploading file with user that has password reset enabled
@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: a user uploads a file
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_t.csv"
Then the user import page shows an import with the message "Import successfully completed!" and the details "Created accounts (1)"

@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: after uploading a file a user inspects the user import details page
When the user opens the user import details page
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_t.csv"
And the user opens the user import details page
And the user clicks on the details regarding the "created" user import
Then the table shows the information about the "created" user "testUser"

@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: after uploading a file a user downloads the import overview
When the user opens the user import details page
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_t.csv"
And the user opens the user import details page
And the user downloads the import overview
Then the import result is downloaded and contains information regarding "1" created, "0" updated and "0" skipped accounts in the file "tap_userimport_pwd_t.csv"

@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: after uploading a file a user inspects the users page
When the user opens the users page
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_t.csv"
And the user opens the users page
Then the new user "testUser" was added

@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: after uploading a file an imported user can be edited
When the user opens the users page
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_t.csv"
And the user opens the users page
And the user clicks on the edit-user button for the user "testUser"
Then the password reset flag is checked

@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: after uploading a file a user inspects the user import summaries page
When the user opens the user import summaries page
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_t.csv"
And the user opens the user import summaries page
Then a table with the import information "New: 1, Updated: 0, Skipped: 0" regarding the file "tap_userimport_pwd_t.csv" is shown

@clean_before
@clear_downloadDir
@clear_mails
@clean_user_import
Scenario: after the user import the newly created user receives an email
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_t.csv"
Then the user "testUser" receives an email with his user details

@clean_before
@clear_downloadDir
@clear_mails
Scenario: a newly created user tries to log in for the first time
When the user logs out by visiting the cas logout page
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_t.csv"
And the user logs out by visiting the cas logout page
And the user "testUser" tries to log in with his generated password
Then the user is asked to change his password

@clean_before
@clear_downloadDir
@clear_mails
Scenario: a newly created user logs in for the first time
When the user "testUser" tries to log in with his generated password
When the user opens the user import page
And the user uploads the file "tap_userimport_pwd_t.csv"
And the user logs out by visiting the cas logout page
And the user "testUser" tries to log in with his generated password
And the user sets the new password to "testuserpassword1234A$"
And the user "testUser" with password "testuserpassword1234A$" logs in
Then the account page for user "testUser" is shown
Expand Down
39 changes: 34 additions & 5 deletions integrationTests/cypress/e2e/import_delete.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,58 @@ Feature: Tests for deleting an user import after its upload
| Import completed with errors! | Updated accounts (1) |
| Import completed with errors! | Skipped data rows (1) |

@clean_before
@clear_downloadDir
@add_user
Scenario: after uploading a file a user inspects the user import summaries page
When the user opens the user import summaries page
When the user opens the user import page
And the user uploads the file "userimport6.csv"
And the user opens the user import summaries page
Then a table with the import information "New: 2, Updated: 1, Skipped: 1" regarding the file "userimport6.csv" is shown

@clean_before
@clear_downloadDir
@add_user
Scenario: after uploading a file a user can delete, download or show details of the import entry at the import summaries page
When the user opens the user import summaries page
When the user opens the user import page
And the user uploads the file "userimport6.csv"
And the user opens the user import summaries page
And the user opens the menu in the functions column
Then the import summaries page offers the possibility to delete, download or show details of the import entry

@clean_before
@clear_downloadDir
@add_user
Scenario: a user deletes the user import
When the user opens the user import summaries page
When the user opens the user import page
And the user uploads the file "userimport6.csv"
And the user opens the user import summaries page
And deletes the entry for the user import
Then the entry is removed and a message regarding the successful deletion of the entry is shown

@clean_before
@clear_downloadDir
@add_user
Scenario Outline: after deleting the user import a user inspects the users page regarding the added users
When the user opens the users page
When the user opens the user import page
And the user uploads the file "userimport6.csv"
And the user opens the user import summaries page
And deletes the entry for the user import
And the user opens the users page
Then the new user "<username>" was added

Examples:
| username |
| maxtest |
| mariatest |

@clean_before
@clear_downloadDir
@add_user
Scenario: after deleting the user import a user inspects the users page regarding the updated users
When the user opens the users page
When the user opens the user import page
And the user uploads the file "userimport6.csv"
And the user opens the user import summaries page
And deletes the entry for the user import
And the user opens the users page
Then the user "mmustermann" has his mail updated to "[email protected]" and his display name to "Mark Test"
35 changes: 30 additions & 5 deletions integrationTests/cypress/e2e/import_details.feature
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,32 @@ Feature: Tests for inspecting the result details of an user import
| Import completed with errors! | Updated accounts (1) |
| Import completed with errors! | Skipped data rows (1) |

@clean_before
@clear_downloadDir
@clean_user_import
Scenario: after uploading a file a user inspects the user import summaries page
When the user opens the user import summaries page
When the user opens the user import page
And the user uploads the file "userimport6.csv"
And the user opens the user import summaries page
Then a table with the import information "New: 2, Updated: 1, Skipped: 1" regarding the file "userimport6.csv" is shown

@clean_before
@clear_downloadDir
@clean_user_import
Scenario: after uploading a file a user can delete, download or show details of the import entry at the import summaries page
When the user opens the user import summaries page
When the user opens the user import page
And the user uploads the file "userimport6.csv"
And the user opens the user import summaries page
And the user opens the menu in the functions column
Then the import summaries page offers the possibility to delete, download or show details of the import entry

@clean_before
@clear_downloadDir
@clean_user_import
Scenario Outline: after uploading a file a user inspects the user import details page about the created accounts
When the user opens the user import details page
When the user opens the user import page
And the user uploads the file "userimport6.csv"
And the user opens the user import details page
And the user clicks on the details regarding the "created" user import
Then the table shows the information about the "created" user "<username>"

Expand All @@ -38,13 +53,23 @@ Feature: Tests for inspecting the result details of an user import
| maxtest |
| mariatest |

@clean_before
@clear_downloadDir
@clean_user_import
@add_user
Scenario: after uploading a file a user inspects the user import details page about the updated accounts
When the user opens the user import details page
When the user opens the user import page
And the user uploads the file "userimport6.csv"
And the user opens the user import details page
And the user clicks on the details regarding the "updated" user import
Then the table shows the information about the "updated" user "mmustermann"

@clean_before
@clear_downloadDir
@clean_user_import
Scenario: after uploading a file a user inspects the user import details page about the skipped accounts
When the user opens the user import details page
When the user opens the user import page
And the user uploads the file "userimport6.csv"
And the user opens the user import details page
And the user clicks on the details regarding the "skipped" user import
Then the table shows the error message "The following columns contained a value that is marked as unique and was already assigned: 'mail'."
16 changes: 14 additions & 2 deletions integrationTests/cypress/e2e/import_download.feature
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Feature: Tests for download user import result
@clean_before
@clear_downloadDir
@add_user
@clean_user_import
Scenario Outline: a user uploads a file
When the user opens the user import page
And the user uploads the file "userimport6.csv"
Expand All @@ -19,12 +20,23 @@ Feature: Tests for download user import result
| Import completed with errors! | Updated accounts (1) |
| Import completed with errors! | Skipped data rows (1) |

@clean_before
@clear_downloadDir
@add_user
@clean_user_import
Scenario: after uploading a file a user inspects the user import summaries page
When the user opens the user import summaries page
When the user opens the user import page
And the user uploads the file "userimport6.csv"
And the user opens the user import summaries page
Then a table with the import information "New: 2, Updated: 1, Skipped: 1" regarding the file "userimport6.csv" is shown

@clean_before
@clear_downloadDir
@add_user
@clean_user_import
Scenario: after uploading a file a user downloads the import overview
When the user opens the user import details page
When the user opens the user import page
And the user uploads the file "userimport6.csv"
And the user opens the user import details page
And the user downloads the import overview
Then the import result is downloaded and contains information regarding "2" created, "1" updated and "1" skipped accounts in the file "userimport6.csv"
Loading

0 comments on commit aa659c9

Please sign in to comment.