feat: Make use of db:reset in all test suites (no-changelog) (#4739)

* feat: Make use of db:reset in all test suites

* refactor: Rename task to no longer use db: prefix

* feat: wrap cypress tasks into commands

* refactor: rename resetDatabase to resetAll

* fix: update test:e2e:all to use --headless
This commit is contained in:
Alex Grozav
2022-11-28 19:11:33 +02:00
committed by GitHub
parent aac207a947
commit 622118f983
11 changed files with 71 additions and 35 deletions

View File

@@ -1,15 +1,24 @@
import { NodeCreator } from '../pages/features/node-creator';
import { INodeTypeDescription } from '../../packages/workflow';
import CustomNodeFixture from '../fixtures/Custom_node.json';
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();
const nodeCreatorFeature = new NodeCreator();
describe('Node Creator', () => {
before(() => {
cy.task('db:reset');
})
cy.resetAll();
cy.setup({ email, firstName, lastName, password });
});
beforeEach(() => {
cy.signin({ email, password });
cy.intercept('GET', '/types/nodes.json', (req) => {
// Delete caching headers so that we can intercept the request
['etag', 'if-none-match', 'if-modified-since'].forEach(header => {delete req.headers[header]});
@@ -21,7 +30,8 @@ describe('Node Creator', () => {
nodes.push(CustomNodeFixture as INodeTypeDescription);
res.send(nodes)
})
}).as('nodesIntercept')
}).as('nodesIntercept');
cy.visit(nodeCreatorFeature.url);
});