ci: Reset DB only once per e2e test (no-changelog) (#6216)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2023-05-26 15:15:06 +00:00 committed by GitHub
parent b777f9031d
commit 7a7b884793
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 50 additions and 65 deletions

View file

@ -9,7 +9,6 @@ const multipleWorkflowsCount = 5;
describe('Workflows', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -10,7 +10,6 @@ const settingsLogStreamingPage = new SettingsLogStreamingPage();
describe('Log Streaming Settings', () => {
before(() => {
cy.resetAll();
cy.setup({ email, firstName, lastName, password });
});

View file

@ -11,7 +11,6 @@ const ndv = new NDV();
describe('Undo/Redo', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -4,7 +4,6 @@ const WorkflowPage = new WorkflowPageClass();
describe('Inline expression editor', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -12,7 +12,6 @@ import { WorkflowPage as WorkflowPageClass } from '../pages/workflow';
const WorkflowPage = new WorkflowPageClass();
describe('Canvas Actions', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -22,7 +22,6 @@ const RENAME_NODE_NAME = 'Something else';
describe('Canvas Node Manipulation and Navigation', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -11,7 +11,6 @@ const ndv = new NDV();
describe('Data pinning', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -5,7 +5,6 @@ const ndv = new NDV();
describe('Data transformation expressions', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -10,7 +10,6 @@ const ndv = new NDV();
describe('Data mapping', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -5,11 +5,14 @@ const workflowPage = new WorkflowPage();
const ndv = new NDV();
describe('Schedule Trigger node', async () => {
beforeEach(() => {
cy.resetAll();
before(() => {
cy.skipSetup();
});
beforeEach(() => {
workflowPage.actions.visit();
});
it('should execute and return the execution timestamp', () => {
workflowPage.actions.addInitialNodeToCanvas('Schedule Trigger');
workflowPage.actions.openNode('Schedule Trigger');

View file

@ -92,7 +92,6 @@ const simpleWebhookCall = (options: SimpleWebhookCallOptions) => {
describe('Webhook Trigger node', async () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -52,7 +52,6 @@ const users = [
describe('Sharing', () => {
before(() => {
cy.resetAll();
cy.setupOwner(instanceOwner);
});

View file

@ -2,51 +2,52 @@ import { WorkflowPage } from '../pages';
const wf = new WorkflowPage();
const TEST_TAGS = ['Tag 1', 'Tag 2', 'Tag 3'];
const TEST_TAGS = ['Tag 1', 'Tag 2', 'Tag 3', 'Tag 4', 'Tag 5'];
describe('Workflow tags', () => {
beforeEach(() => {
cy.resetAll();
before(() => {
cy.skipSetup();
});
beforeEach(() => {
wf.actions.visit();
});
it('should create and attach tags inline', () => {
wf.getters.createTagButton().click();
wf.actions.addTags(TEST_TAGS);
wf.getters.tagPills().should('have.length', TEST_TAGS.length);
wf.actions.addTags(TEST_TAGS.slice(0, 2));
wf.getters.tagPills().should('have.length', 2);
wf.getters.nthTagPill(1).click();
wf.actions.addTags('Tag 4');
wf.getters.tagPills().should('have.length', TEST_TAGS.length + 1);
wf.actions.addTags(TEST_TAGS[2]);
wf.getters.tagPills().should('have.length', 3);
wf.getters.isWorkflowSaved();
});
it('should create tags via modal', () => {
wf.actions.openTagManagerModal();
const [first, second] = TEST_TAGS;
cy.contains('Create a tag').click();
cy.getByTestId('tags-table').find('input').type(first).type('{enter}');
cy.contains('Add new').click();
cy.wait(300);
cy.getByTestId('tags-table').find('input').type(second).type('{enter}');
const tags = TEST_TAGS.slice(3);
for (const tag of tags) {
cy.contains('Add new').click();
cy.getByTestId('tags-table').find('input').type(tag).type('{enter}');
cy.wait(300);
}
cy.contains('Done').click();
wf.getters.createTagButton().click();
wf.getters.tagsInDropdown().should('have.length', 2); // two stored
wf.getters.tagsInDropdown().should('have.length', 5);
wf.getters.tagPills().should('have.length', 0); // none attached
});
it('should delete a tag via modal', () => {
it('should delete all tags via modal', () => {
wf.actions.openTagManagerModal();
const [first] = TEST_TAGS;
TEST_TAGS.forEach(() => {
cy.getByTestId('delete-tag-button').first().click({ force: true });
cy.contains('Delete tag').click();
cy.wait(300);
});
cy.contains('Create a tag').click();
cy.getByTestId('tags-table').find('input').type(first).type('{enter}');
cy.getByTestId('delete-tag-button').click({ force: true });
cy.wait(300);
cy.contains('Delete tag').click();
cy.contains('Done').click();
wf.getters.createTagButton().click();
wf.getters.tagsInDropdown().should('have.length', 0); // none stored

View file

@ -51,7 +51,6 @@ const personalSettingsPage = new PersonalSettingsPage();
describe('User Management', () => {
before(() => {
cy.resetAll();
cy.setupOwner(instanceOwner);
});

View file

@ -6,11 +6,14 @@ const workflowPage = new WorkflowPageClass();
const ndv = new NDV();
describe('Execution', () => {
beforeEach(() => {
cy.resetAll();
before(() => {
cy.skipSetup();
});
beforeEach(() => {
workflowPage.actions.visit();
});
it('should test manual workflow', () => {
cy.createFixtureWorkflow('Manual_wait_set.json', `Manual wait set ${uuid()}`);
@ -264,7 +267,6 @@ describe('Execution', () => {
.canvasNodeByName('Set')
.within(() => cy.get('.fa-check').should('not.exist'));
// Check canvas nodes after workflow stopped
workflowPage.getters
.canvasNodeByName('Webhook')

View file

@ -33,7 +33,6 @@ const NEW_CREDENTIAL_NAME = 'Something else';
describe('Credentials', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -7,7 +7,6 @@ const executionsTab = new WorkflowExecutionsTab();
// Test suite for executions tab
describe('Current Workflow Executions', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -14,7 +14,6 @@ const workflowPage = new WorkflowPage();
// We want to keep the other tests as fast as possible so we don't want to break the cache in those.
describe('Community Nodes', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
})
beforeEach(() => {

View file

@ -9,11 +9,11 @@ const userActivationSurveyModal = new UserActivationSurveyModal();
const BASE_WEBHOOK_URL = 'http://localhost:5678/webhook';
describe('User activation survey', () => {
it('Should show activation survey', () => {
cy.resetAll();
before(() => {
cy.skipSetup();
});
it('Should show activation survey', () => {
cy.intercept('GET', '/rest/settings', (req) => {
req.reply(SettingsWithActivationModalEnabled);
});

View file

@ -11,7 +11,6 @@ const lastName = randLastName();
describe('Variables', () => {
before(() => {
cy.resetAll();
cy.setup({ email, firstName, lastName, password });
});

View file

@ -6,10 +6,9 @@ const ndv = new NDV();
describe('NDV', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});
beforeEach(() => {
workflowPage.actions.visit();
workflowPage.actions.renameWorkflow(uuid());

View file

@ -15,9 +15,11 @@ function checkStickiesStyle( top: number, left: number, height: number, width: n
}
describe('Canvas Actions', () => {
beforeEach(() => {
cy.resetAll();
before(() => {
cy.skipSetup();
});
beforeEach(() => {
workflowPage.actions.visit();
cy.window().then(

View file

@ -9,7 +9,6 @@ const INVALID_CREDENTIALS_MESSAGE = 'Please check your credential';
describe('Resource Locator', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -35,7 +35,6 @@ const lastName = randLastName();
describe('Default owner', () => {
it('should be able to create workflows', () => {
cy.resetAll();
cy.skipSetup();
cy.createFixtureWorkflow('Test_workflow_1.json', `Test workflow`);

View file

@ -6,10 +6,8 @@ const nodeCreatorFeature = new NodeCreator();
const WorkflowPage = new WorkflowPageClass();
const NDVModal = new NDV();
describe('Node Creator', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -6,10 +6,9 @@ const ndv = new NDV();
describe('NDV', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});
beforeEach(() => {
workflowPage.actions.visit();
workflowPage.actions.renameWorkflow(uuid());

View file

@ -6,7 +6,6 @@ const ndv = new NDV();
describe('Code node', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -15,7 +15,6 @@ const WorkflowPage = new WorkflowPageClass();
describe('Workflow Actions', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});
@ -111,8 +110,6 @@ describe('Workflow Actions', () => {
});
it('should update workflow settings', () => {
cy.resetAll();
cy.skipSetup();
WorkflowPage.actions.visit();
// Open settings dialog
WorkflowPage.actions.saveWorkflowOnButtonClick();
@ -121,7 +118,7 @@ describe('Workflow Actions', () => {
WorkflowPage.getters.workflowMenuItemSettings().should('be.visible');
WorkflowPage.getters.workflowMenuItemSettings().click();
// Change all settings
WorkflowPage.getters.workflowSettingsErrorWorkflowSelect().find('li').should('have.length', 2);
WorkflowPage.getters.workflowSettingsErrorWorkflowSelect().find('li').should('have.length', 7);
WorkflowPage.getters
.workflowSettingsErrorWorkflowSelect()
.find('li')
@ -229,6 +226,7 @@ describe('Workflow Actions', () => {
it('should duplicate unsaved workflow', () => {
duplicateWorkflow();
});
it('should duplicate saved workflow', () => {
WorkflowPage.actions.saveWorkflowOnButtonClick();
duplicateWorkflow();

View file

@ -5,7 +5,6 @@ const ndv = new NDV();
describe('HTTP Request node', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -4,7 +4,6 @@ const WorkflowPage = new WorkflowPageClass();
describe('Expression editor modal', () => {
before(() => {
cy.resetAll();
cy.skipSetup();
});

View file

@ -15,6 +15,10 @@
import './commands';
before(() => {
cy.resetAll();
});
// Load custom nodes and credentials fixtures
beforeEach(() => {
cy.intercept('GET', '/rest/settings').as('loadSettings');
@ -25,6 +29,6 @@ beforeEach(() => {
statusCode: 200,
body: {
data: { status: 'success', message: 'Tested successfully' },
}
},
});
})
});