mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-16 09:36:44 +00:00
ci: Setup cypress tasks for resetting DB, and setting up an owner (#4717)
* ci: Setup cypress tasks for resetting DB, and setting up an owner * address Ivan's comments
This commit is contained in:
committed by
GitHub
parent
aec08275aa
commit
e409813ea9
@@ -1,23 +1,28 @@
|
||||
import {DEFAULT_USER_EMAIL, DEFAULT_USER_PASSWORD} from "../constants";
|
||||
import {randFirstName, randLastName} from "@ngneat/falso";
|
||||
import { DEFAULT_USER_EMAIL, DEFAULT_USER_PASSWORD } from '../constants';
|
||||
import { randFirstName, randLastName } from '@ngneat/falso';
|
||||
|
||||
const username = DEFAULT_USER_EMAIL;
|
||||
const email = DEFAULT_USER_EMAIL;
|
||||
const password = DEFAULT_USER_PASSWORD;
|
||||
const firstName = randFirstName();
|
||||
const lastName = randLastName();
|
||||
|
||||
describe('Authentication', () => {
|
||||
beforeEach(() => {
|
||||
cy.task('db:reset');
|
||||
});
|
||||
|
||||
it('should setup owner', () => {
|
||||
cy.signup(username, firstName, lastName, password);
|
||||
cy.signup(email, firstName, lastName, password);
|
||||
});
|
||||
|
||||
it('should sign user in', () => {
|
||||
cy.task('db:setup-owner', { email, password, firstName, lastName });
|
||||
cy.on('uncaught:exception', (err, runnable) => {
|
||||
expect(err.message).to.include('Not logged in');
|
||||
|
||||
return false;
|
||||
})
|
||||
});
|
||||
|
||||
cy.signin(username, password);
|
||||
cy.signin(email, password);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user