Skip to content

Commit

Permalink
#161 Test download of user import
Browse files Browse the repository at this point in the history
  • Loading branch information
lgorzitze committed Sep 6, 2024
1 parent c84119a commit b09923d
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 2 deletions.
30 changes: 30 additions & 0 deletions integrationTests/cypress/e2e/import_download.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
Feature: Tests for download user import result

Background:
Given the user "manager" exists
And the user "manager" is member of the group "cesManager"
And the user "manager" with password "newuserpassword1234A$" is logged in

@clean_before
@clear_downloadDir
@add_user
Scenario Outline: a user uploads a file
When the user opens the user import page
And the user uploads the file "userimport6.csv"
Then the user import page shows an import with the message "<message>" and the details "<details>"

Examples:
| message | details |
| Import completed with errors! | Created accounts (2) |
| Import completed with errors! | Updated accounts (1) |
| Import completed with errors! | Skipped data rows (1) |

Scenario: after uploading a file a user inspects the user import summaries page
When 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_user_import
Scenario: after uploading a file a user downloads the import overview
When 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"
10 changes: 9 additions & 1 deletion integrationTests/cypress/fixtures/userdata.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,13 @@
"surname": "test",
"displayName": "Tester",
"mail": "[email protected]"
},
{
"username": "mmustermann",
"password": "testuserpassword1234A$",
"givenname": "Max",
"surname": "Mustermann",
"displayName": "Max Mustermann",
"mail": "[email protected]"
}
]
]
5 changes: 5 additions & 0 deletions integrationTests/cypress/fixtures/userimport6.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
displayname,external,mail,pwdreset,surname,username,givenname
Max Test,TRUE,[email protected],TRUE,Mustermann,maxtest,Max
Maria Test,TRUE,[email protected],TRUE,Musterfrau,mariatest,Maria
Claus,TRUE,[email protected],TRUE,Claus,Claus,Carl
Mark Test,TRUE,[email protected],TRUE,Muster,mmustermann,Mark
9 changes: 8 additions & 1 deletion integrationTests/cypress/support/step_definitions/before.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,11 @@ Before({tags: "@clear_downloadDir"}, () => {
});
}
});
});
})

Before({tags: "@add_user"}, () => {
cy.log("add Test user Max Mustermann");
cy.withUser("mmustermann").then(userData => {
cy.usermgtCreateUser(userData.username, userData.givenname, userData.surname, userData.displayName, userData.mail, userData.password,false, [])
})
})

0 comments on commit b09923d

Please sign in to comment.