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
31 changed files with 50 additions and 65 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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