n8n/cypress/e2e/0-smoke.cy.ts
कारतोफ्फेलस्क्रिप्ट™ e409813ea9
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
2022-11-24 18:32:00 +01:00

29 lines
727 B
TypeScript

import { DEFAULT_USER_EMAIL, DEFAULT_USER_PASSWORD } from '../constants';
import { randFirstName, randLastName } from '@ngneat/falso';
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(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(email, password);
});
});