[MM-47303] Migrate /enterprise/extend_session/not_extended_when_disabled e2e tests to TypeScript (#28465)

Этот коммит содержится в:
Angel Mendez
2024-10-29 00:19:02 -06:00
коммит произвёл GitHub
родитель b4f337f191
Коммит 2aaa38b368
8 изменённых файлов: 65 добавлений и 42 удалений

Просмотреть файл

@@ -19,7 +19,7 @@ export function verifyExtendedSession(testUser, sessionLengthInDays, channelUrl)
// # Post a message to a channel
const now = Date.now();
cy.postMessage(now);
cy.postMessage(`${now}`);
// # Update user session which is to expire 20 sec from now
const soonToExpire = getExpirationFromNow(thirtySeconds);
@@ -53,7 +53,7 @@ export function verifyExtendedSession(testUser, sessionLengthInDays, channelUrl)
// # Post multiple times to check that the session continues and doesn't redirect to login page
Cypress._.times(20, (i) => {
cy.postMessage(i);
cy.postMessage(`${i}`);
});
});
});

Просмотреть файл

@@ -9,6 +9,7 @@
// Group: @channels @enterprise @not_cloud @extend_session
import {UserProfile} from '@mattermost/types/users';
import {verifyExtendedSession, verifyNotExtendedSession} from './helpers';
describe('Extended Session Length', () => {
@@ -16,10 +17,11 @@ describe('Extended Session Length', () => {
const setting = {
ServiceSettings: {
SessionLengthWebInHours: sessionLengthInHours,
ExtendSessionLengthWithActivity: false,
},
};
let emailUser;
let offTopicUrl;
let emailUser: UserProfile;
let offTopicUrl: string;
before(() => {
cy.shouldNotRunOnCloudEdition();

Просмотреть файл

@@ -9,6 +9,7 @@
// Group: @channels @enterprise @not_cloud @extend_session @ldap
import {UserProfile} from '@mattermost/types/users';
import ldapUsers from '../../../../../fixtures/ldap_users.json';
import {verifyExtendedSession, verifyNotExtendedSession} from './helpers';
@@ -18,10 +19,11 @@ describe('Extended Session Length', () => {
const setting = {
ServiceSettings: {
SessionLengthWebInHours: sessionLengthInHours,
ExtendSessionLengthWithActivity: false,
},
};
let testLdapUser;
let offTopicUrl;
let testLdapUser: UserProfile;
let offTopicUrl: string;
before(() => {
cy.shouldNotRunOnCloudEdition();

Просмотреть файл

@@ -14,9 +14,11 @@
// Group: @channels @enterprise @not_cloud @extend_session @ldap @saml @keycloak
import {UserProfile} from '@mattermost/types/users';
import {getKeycloakServerSettings} from '../../../../../utils/config';
import {verifyExtendedSession, verifyNotExtendedSession} from './helpers';
import {LdapUser} from 'tests/support/ldap_server_commands';
describe('Extended Session Length', () => {
const sessionLengthInDays = 1;
@@ -24,13 +26,14 @@ describe('Extended Session Length', () => {
const sessionConfig = {
ServiceSettings: {
SessionLengthSSOInDays: sessionLengthInDays,
ExtendSessionLengthWithActivity: false,
},
};
let testTeamId;
let testSamlUser;
let offTopicUrl;
let samlLdapUser;
let testTeamId: string;
let testSamlUser: UserProfile;
let offTopicUrl: string;
let samlLdapUser: LdapUser;
before(() => {
cy.shouldNotRunOnCloudEdition();