aboutsummaryrefslogtreecommitdiffstats
path: root/cypress/e2e/settings/usersUtils.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cypress/e2e/settings/usersUtils.ts')
-rw-r--r--cypress/e2e/settings/usersUtils.ts21
1 files changed, 20 insertions, 1 deletions
diff --git a/cypress/e2e/settings/usersUtils.ts b/cypress/e2e/settings/usersUtils.ts
index 1e325fab47d..de0c28adcc4 100644
--- a/cypress/e2e/settings/usersUtils.ts
+++ b/cypress/e2e/settings/usersUtils.ts
@@ -22,17 +22,36 @@
/**
* Assert that `element` does not exist or is not visible
- *
* Useful in cases such as when NcModal is opened/closed rapidly
+ * @param element Element that is inspected
*/
export function assertNotExistOrNotVisible(element: JQuery<HTMLElement>) {
const doesNotExist = element.length === 0
const isNotVisible = !element.is(':visible')
+ // eslint-disable-next-line no-unused-expressions
expect(doesNotExist || isNotVisible, 'does not exist or is not visible').to.be.true
}
/**
+ * Get the settings users list
+ * @return Cypress chainable object
+ */
+export function getUserList() {
+ return cy.get('[data-test-id="userList"]')
+}
+
+/**
+ * Get the row entry for given userId within the settings users list
+ *
+ * @param userId the user to query
+ * @return Cypress chainable object
+ */
+export function getUserListRow(userId: string) {
+ return getUserList().find(`tr[data-test="${userId}"]`)
+}
+
+/**
* Handle the confirm password dialog (if needed)
* @param adminPassword The admin password for the dialog
*/