test: Add user type of admin to E2E tests (#7935)

## Summary
Extend existing user types in the E2E database. Currently, we have only
owner and member but we need also admin

---------

Co-authored-by: Val <68596159+valya@users.noreply.github.com>
This commit is contained in:
Csaba Tuncsik
2023-12-06 14:31:06 +01:00
committed by GitHub
parent 92bab72cff
commit c461025f70
5 changed files with 51 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
import { MainSidebar } from './../pages/sidebar/main-sidebar';
import { INSTANCE_OWNER, BACKEND_BASE_URL } from '../constants';
import { INSTANCE_OWNER, INSTANCE_ADMIN, BACKEND_BASE_URL } from '../constants';
import { SigninPage } from '../pages';
import { PersonalSettingsPage } from '../pages/settings-personal';
import { MfaLoginPage } from '../pages/mfa-login';
@@ -19,6 +19,16 @@ const user = {
mfaRecoveryCodes: [RECOVERY_CODE],
};
const admin = {
email: INSTANCE_ADMIN.email,
password: INSTANCE_ADMIN.password,
firstName: 'Admin',
lastName: 'B',
mfaEnabled: false,
mfaSecret: MFA_SECRET,
mfaRecoveryCodes: [RECOVERY_CODE],
};
const mfaLoginPage = new MfaLoginPage();
const signinPage = new SigninPage();
const personalSettingsPage = new PersonalSettingsPage();
@@ -30,6 +40,7 @@ describe('Two-factor authentication', () => {
cy.request('POST', `${BACKEND_BASE_URL}/rest/e2e/reset`, {
owner: user,
members: [],
admin,
});
cy.on('uncaught:exception', (err, runnable) => {
expect(err.message).to.include('Not logged in');