diff --git a/e2e/cypress/tests/integration/enterprise/ldap_group/channel_modes_spec.js b/e2e/cypress/tests/integration/enterprise/ldap_group/channel_modes_spec.ts similarity index 100% rename from e2e/cypress/tests/integration/enterprise/ldap_group/channel_modes_spec.js rename to e2e/cypress/tests/integration/enterprise/ldap_group/channel_modes_spec.ts diff --git a/e2e/cypress/tests/integration/enterprise/ldap_group/group_mentions_spec.js b/e2e/cypress/tests/integration/enterprise/ldap_group/group_mentions_spec.ts similarity index 100% rename from e2e/cypress/tests/integration/enterprise/ldap_group/group_mentions_spec.js rename to e2e/cypress/tests/integration/enterprise/ldap_group/group_mentions_spec.ts diff --git a/e2e/cypress/tests/integration/enterprise/ldap_group/groups_assign_roles_spec.js b/e2e/cypress/tests/integration/enterprise/ldap_group/groups_assign_roles_spec.ts similarity index 91% rename from e2e/cypress/tests/integration/enterprise/ldap_group/groups_assign_roles_spec.js rename to e2e/cypress/tests/integration/enterprise/ldap_group/groups_assign_roles_spec.ts index 248b66bbc516..249ef58ffef2 100644 --- a/e2e/cypress/tests/integration/enterprise/ldap_group/groups_assign_roles_spec.js +++ b/e2e/cypress/tests/integration/enterprise/ldap_group/groups_assign_roles_spec.ts @@ -69,7 +69,8 @@ describe('LDAP Group Sync', () => { if (el.text().includes('Edit')) { cy.get('#developers_edit').then((buttonEl) => { // # Get the Group ID and remove all the teams and channels currently attached to it then click the button - const groupId = buttonEl[0].href.match(/\/(?:.(?!\/))+$/)[0].substring(1); + const anchorElement = buttonEl[0] as HTMLAnchorElement; + const groupId = anchorElement.href.match(/\/(?:.(?!\/))+$/)[0].substring(1); getTeamsAssociatedToGroupAndUnlink(groupId); getChannelsAssociatedToGroupAndUnlink(groupId); cy.get('#developers_edit').click(); @@ -82,7 +83,8 @@ describe('LDAP Group Sync', () => { // # Get the Group ID and remove all the teams and channels currently attached to it then click the button cy.get('#developers_configure').then((buttonEl) => { - const groupId = buttonEl[0].href.match(/\/(?:.(?!\/))+$/)[0].substring(1); + const anchorElement = buttonEl[0] as HTMLAnchorElement; + const groupId = anchorElement.href.match(/\/(?:.(?!\/))+$/)[0].substring(1); getTeamsAssociatedToGroupAndUnlink(groupId); getChannelsAssociatedToGroupAndUnlink(groupId); cy.get('#developers_configure').click(); @@ -110,7 +112,8 @@ describe('LDAP Group Sync', () => { cy.get('#team_and_channel_membership_table').then((el) => { // * Ensure that the text in the roles column is Member as default text for each row - const name = el[0].rows[1].cells[0].innerText; + const table = el[0] as HTMLTableElement; + const name = table.rows[1].cells[0].innerText; cy.findByTestId(`${name}_current_role`).scrollIntoView().should('contain.text', 'Member'); // # Change the option to the admin roles (Channel Admin/Team Admin) for each row diff --git a/e2e/cypress/tests/integration/enterprise/ldap_group/invite_bot_spec.js b/e2e/cypress/tests/integration/enterprise/ldap_group/invite_bot_spec.ts similarity index 95% rename from e2e/cypress/tests/integration/enterprise/ldap_group/invite_bot_spec.js rename to e2e/cypress/tests/integration/enterprise/ldap_group/invite_bot_spec.ts index 57d3d485a26b..763539c3e372 100644 --- a/e2e/cypress/tests/integration/enterprise/ldap_group/invite_bot_spec.js +++ b/e2e/cypress/tests/integration/enterprise/ldap_group/invite_bot_spec.ts @@ -43,7 +43,12 @@ describe('Group Synced Team - Bot invitation flow', () => { // # Logout sysadmin and login as an LDAP Group synced user cy.apiLogout(); - cy.apiLogin({username: 'test.one', password: 'Password1'}); + + const user = { + username: 'test.one', + password: 'Password1', + } as Cypress.UserProfile; + cy.apiLogin(user); // # Visit the group constrained team cy.visit(`/${groupConstrainedTeam.name}`); diff --git a/e2e/cypress/tests/integration/enterprise/ldap_group/search_channels_spec.js b/e2e/cypress/tests/integration/enterprise/ldap_group/search_channels_spec.ts similarity index 100% rename from e2e/cypress/tests/integration/enterprise/ldap_group/search_channels_spec.js rename to e2e/cypress/tests/integration/enterprise/ldap_group/search_channels_spec.ts diff --git a/e2e/cypress/tests/integration/enterprise/ldap_group/team_and_channel_assign_roles_spec.js b/e2e/cypress/tests/integration/enterprise/ldap_group/team_and_channel_assign_roles_spec.ts similarity index 100% rename from e2e/cypress/tests/integration/enterprise/ldap_group/team_and_channel_assign_roles_spec.js rename to e2e/cypress/tests/integration/enterprise/ldap_group/team_and_channel_assign_roles_spec.ts diff --git a/e2e/cypress/tests/support/api/preference.d.ts b/e2e/cypress/tests/support/api/preference.d.ts index edcc7449fd46..31b1a01939cb 100644 --- a/e2e/cypress/tests/support/api/preference.d.ts +++ b/e2e/cypress/tests/support/api/preference.d.ts @@ -95,6 +95,13 @@ declare namespace Cypress { */ apiSaveCRTPreference(userId: string, value: string): Chainable; + /** + * Saves tutorial step of a user + * @param {string} userId - User ID + * @param {string} value - value of tutorial step, e.g. '999' (default, completed tutorial) + */ + apiSaveTutorialStep(userId: string, value: string): Chainable; + /** * Save cloud trial banner preference. * See https://api.mattermost.com/#tag/preferences/paths/~1users~1{user_id}~1preferences/put diff --git a/e2e/cypress/tests/support/api/team.d.ts b/e2e/cypress/tests/support/api/team.d.ts index ee0f5838b934..ce3bde2cd1d3 100644 --- a/e2e/cypress/tests/support/api/team.d.ts +++ b/e2e/cypress/tests/support/api/team.d.ts @@ -111,7 +111,7 @@ declare namespace Cypress { * // do something with teams * }); */ - apiGetAllTeams(queryParams: Record): Chainable; + apiGetAllTeams(queryParams?: Record): Chainable<{teams: Team[]}>; /** * Get a list of teams that a user is on.