mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 18:12:04 +00:00
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:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user