summaryrefslogtreecommitdiffstats
path: root/public/cypress/support
diff options
context:
space:
mode:
Diffstat (limited to 'public/cypress/support')
-rw-r--r--public/cypress/support/generalCommands.ts16
-rw-r--r--public/cypress/support/homeCommands.ts28
-rw-r--r--public/cypress/support/index.js28
-rw-r--r--public/cypress/support/ruleEngineCommands.ts85
4 files changed, 144 insertions, 13 deletions
diff --git a/public/cypress/support/generalCommands.ts b/public/cypress/support/generalCommands.ts
index fc87acc..35d2fa7 100644
--- a/public/cypress/support/generalCommands.ts
+++ b/public/cypress/support/generalCommands.ts
@@ -3,6 +3,7 @@ declare namespace Cypress {
httpGetDDLData: typeof httpGetDDLData;
fillNewMcForm: typeof fillNewMcForm;
httpCreateNewMc: typeof httpCreateNewMc;
+ httpCreateNewMcWithBooleanDDL: typeof httpCreateNewMcWithBooleanDDL;
}
}
@@ -44,7 +45,22 @@ function httpCreateNewMc() {
.as('newMC');
}
+function httpCreateNewMcWithBooleanDDL() {
+ cy.server();
+ cy
+ .route({
+ method: 'POST',
+ url: Cypress.env('backendUrl') + '/createMC',
+ response: 'fixture:createMcResWithBooleanDDL'
+ })
+ .as('newMCWithBooleanDDL');
+}
+
// Add cypress commands
Cypress.Commands.add('httpGetDDLData', httpGetDDLData);
Cypress.Commands.add('fillNewMcForm', fillNewMcForm);
Cypress.Commands.add('httpCreateNewMc', httpCreateNewMc);
+Cypress.Commands.add(
+ 'httpCreateNewMcWithBooleanDDL',
+ httpCreateNewMcWithBooleanDDL
+);
diff --git a/public/cypress/support/homeCommands.ts b/public/cypress/support/homeCommands.ts
index 6f3349c..d54f30e 100644
--- a/public/cypress/support/homeCommands.ts
+++ b/public/cypress/support/homeCommands.ts
@@ -17,25 +17,33 @@ declare namespace Cypress {
// functionality
function sdcIsOwnerFalse(): void {
cy.visit(
- 'home?userId=cs0008&userRole=DESIGNER&displayType=context&contextType=SERVICE&uuid=b1645734-b812-4cd7-a0cc-5b5843940ad6&lifecycleState=NOT_CERTIFIED_CHECKOUT&isOwner=false'
+ 'home?userId=cs0008&userRole=DESIGNER&displayType=context&contextType=SERVICES&uu' +
+ 'id=06c7d927-4e2f-47e1-a29d-b6ed229ebc0a&lifecycleState=NOT_CERTIFIED_CHECKOUT&is' +
+ 'Owner=false&version=0.1'
);
}
function sdcUserNotCheckout(): void {
cy.visit(
- 'home?userId=cs0008&userRole=DESIGNER&displayType=context&contextType=SERVICE&uuid=b1645734-b812-4cd7-a0cc-5b5843940ad6&lifecycleState=READY_FOR_CERTIFICATION&isOwner=true'
+ 'home?userId=cs0008&userRole=DESIGNER&displayType=context&contextType=SERVICES&uu' +
+ 'id=06c7d927-4e2f-47e1-a29d-b6ed229ebc0a&lifecycleState=READY_FOR_CERTIFICATION&i' +
+ 'sOwner=true&version=0.1'
);
}
function homePage(): void {
cy.visit(
- 'home?userId=cs0008&userRole=DESIGNER&displayType=context&contextType=SERVICES&uuid=06c7d927-4e2f-47e1-a29d-b6ed229ebc0a&lifecycleState=NOT_CERTIFIED_CHECKOUT&isOwner=true&version=0.1'
+ 'home?userId=cs0008&userRole=DESIGNER&displayType=context&contextType=SERVICES&uu' +
+ 'id=06c7d927-4e2f-47e1-a29d-b6ed229ebc0a&lifecycleState=NOT_CERTIFIED_CHECKOUT&is' +
+ 'Owner=true&version=0.1'
);
}
function homePageCertified(): void {
cy.visit(
- 'home?userId=cs0008&userRole=DESIGNER&displayType=context&contextType=SERVICES&uuid=06c7d927-4e2f-47e1-a29d-b6ed229ebc0a&lifecycleState=CERTIFIED_CHECKOUT&isOwner=true&version=0.1'
+ 'home?userId=cs0008&userRole=DESIGNER&displayType=context&contextType=SERVICES&uu' +
+ 'id=06c7d927-4e2f-47e1-a29d-b6ed229ebc0a&lifecycleState=CERTIFIED_CHECKOUT&isOwne' +
+ 'r=true&version=0.1'
);
}
@@ -46,7 +54,8 @@ function deleteMonitoringComponent(): void {
method: 'DELETE',
url:
Cypress.env('backendUrl') +
- '/SERVICES/06c7d927-4e2f-47e1-a29d-b6ed229ebc0a/vfb53dd48360ff4fa2b66e6ceb1961bd9b0/cba37ed8-94e1-406f-b4f5-b5edbc31ac85/deleteVfcmtReference',
+ '/SERVICES/06c7d927-4e2f-47e1-a29d-b6ed229ebc0a/vfb53dd48360ff4fa2b66e6ceb1961bd9' +
+ 'b0/cba37ed8-94e1-406f-b4f5-b5edbc31ac85/deleteVfcmtReference',
response: '{}'
})
.as('deleteMonitoringComponent');
@@ -59,7 +68,8 @@ function saveMonitoringComponent(): void {
method: 'POST',
url:
Cypress.env('backendUrl') +
- '/SERVICES/06c7d927-4e2f-47e1-a29d-b6ed229ebc0a/vfb53dd48360ff4fa2b66e6ceb1961bd9b0/saveComposition/cba37ed8-94e1-406f-b4f5-b5edbc31ac85',
+ '/SERVICES/06c7d927-4e2f-47e1-a29d-b6ed229ebc0a/vfb53dd48360ff4fa2b66e6ceb1961bd9' +
+ 'b0/saveComposition/cba37ed8-94e1-406f-b4f5-b5edbc31ac85',
response: '{}'
})
.as('saveMonitoringComponent');
@@ -72,7 +82,8 @@ function submitMonitoringComponent(): void {
method: 'POST',
url:
Cypress.env('backendUrl') +
- '/SERVICES/createBluePrint/cba37ed8-94e1-406f-b4f5-b5edbc31ac85/06c7d927-4e2f-47e1-a29d-b6ed229ebc0a/vfb53dd48360ff4fa2b66e6ceb1961bd9b0/',
+ '/SERVICES/createBluePrint/cba37ed8-94e1-406f-b4f5-b5edbc31ac85/06c7d927-4e2f-47e' +
+ '1-a29d-b6ed229ebc0a/vfb53dd48360ff4fa2b66e6ceb1961bd9b0/',
response: '{}'
})
.as('submitMonitoringComponent');
@@ -85,7 +96,8 @@ function deleteMonitoringComponentWithBlueprint(): void {
method: 'DELETE',
url:
Cypress.env('backendUrl') +
- '/SERVICES/teSt.__.monitoring---TempLATE.6hnc/06c7d927-4e2f-47e1-a29d-b6ed229ebc0a/dump0/64471437-8feb-40d9-a8b0-9407a81dd5c0/deleteVfcmtReference',
+ '/SERVICES/06c7d927-4e2f-47e1-a29d-b6ed229ebc0a/dump0/64471437-8feb-40d9-a8b0-940' +
+ '7a81dd5c0/deleteVfcmtReference',
response: '{}'
})
.as('deleteMonitoringComponentWithBlueprint');
diff --git a/public/cypress/support/index.js b/public/cypress/support/index.js
index 2f70722..7cac3de 100644
--- a/public/cypress/support/index.js
+++ b/public/cypress/support/index.js
@@ -15,9 +15,31 @@
// Import commands.js using ES2015 syntax:
import './commands';
-import './homeCommands';
import './generalCommands';
+import './homeCommands';
import './ruleEngineCommands';
-// Alternatively you can use CommonJS syntax:
-// require('./commands')
+// const istanbul = require('istanbul-lib-coverage');
+
+// const map = istanbul.createCoverageMap({});
+
+// Cypress.on('window:before:unload', e => {
+// const coverage = e.currentTarget.__coverage__;
+
+// if (coverage) {
+// map.merge(coverage);
+// }
+// });
+
+// after(() => {
+// cy.window().then(win => {
+// const coverage = win.__coverage__;
+
+// if (coverage) {
+// map.merge(coverage);
+// }
+
+// cy.writeFile('.nyc_output/out.json', JSON.stringify(map));
+// cy.exec('nyc report --reporter=html');
+// });
+// })
diff --git a/public/cypress/support/ruleEngineCommands.ts b/public/cypress/support/ruleEngineCommands.ts
index 2142e7f..51ddc2d 100644
--- a/public/cypress/support/ruleEngineCommands.ts
+++ b/public/cypress/support/ruleEngineCommands.ts
@@ -3,7 +3,12 @@ declare namespace Cypress {
emptyRuleEngine: typeof emptyRuleEngine;
httpTargetTree: typeof httpTargetTree;
doneSaveRule: typeof doneSaveRule;
+ doneSaveAndEditRule: typeof doneSaveAndEditRule;
+ deleteRule: typeof deleteRule;
+ doneSaveMapRule: typeof doneSaveMapRule;
+ doneSaveLogTextRule: typeof doneSaveLogTextRule;
httpTransalte: typeof httpTransalte;
+ httpGenerateMappingRulesFileName: typeof httpGenerateMappingRulesFileName;
}
}
@@ -45,12 +50,65 @@ function doneSaveRule() {
method: 'POST',
url:
Cypress.env('backendUrl') +
- '/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Type1',
+ '/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Typ' +
+ 'e1',
response: 'fixture:doneSaveSimpleCopy'
})
.as('doneSaveCopyRule');
}
+function deleteRule() {
+ cy.server();
+ cy
+ .route({
+ method: 'DELETE',
+ url:
+ Cypress.env('backendUrl') +
+ '/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Type1/f620724b-7170-43e1-8a8b-55e98cabe658',
+ response: '{}'
+ })
+ .as('deleteCopyRule');
+}
+
+function doneSaveAndEditRule() {
+ cy.server();
+ cy
+ .route({
+ method: 'POST',
+ url:
+ Cypress.env('backendUrl') +
+ '/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Type1',
+ response: 'fixture:doneSaveEditSimpleCopy'
+ })
+ .as('doneSaveAndEditRule');
+}
+
+function doneSaveMapRule() {
+ cy.server();
+ cy
+ .route({
+ method: 'POST',
+ url:
+ Cypress.env('backendUrl') +
+ '/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Type1',
+ response: 'fixture:doneSaveSimpleMap'
+ })
+ .as('doneSaveMapRule');
+}
+
+function doneSaveLogTextRule() {
+ cy.server();
+ cy
+ .route({
+ method: 'POST',
+ url:
+ Cypress.env('backendUrl') +
+ '/rule-editor/rule/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Type1',
+ response: 'fixture:doneSaveSimpleLogText'
+ })
+ .as('doneSaveLogTextRule');
+}
+
function httpTransalte() {
cy.server();
cy
@@ -58,14 +116,37 @@ function httpTransalte() {
method: 'GET',
url:
Cypress.env('backendUrl') +
- '/rule-editor/rule/translate/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1517823219961.0/Type1',
+ '/rule-editor/rule/translate/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.151782321' +
+ '9961.0/Type1',
response: 'fixture:TranslateSimpleCopy'
})
.as('TranslateSimpleCopy');
}
+function httpGenerateMappingRulesFileName() {
+ cy.server();
+ cy
+ .route({
+ method: 'GET',
+ url:
+ Cypress.env('backendUrl') +
+ '/rule-editor/getExistingRuleTargets/6d436c07-8006-4335-8c84-d65b4740f8d6/map/n.1' +
+ '517823219961.0',
+ response: ['Type1', 'json', 'name']
+ })
+ .as('TranslateSimpleCopy');
+}
+
// Add cypress commands
Cypress.Commands.add('emptyRuleEngine', emptyRuleEngine);
Cypress.Commands.add('httpTargetTree', httpTargetTree);
Cypress.Commands.add('doneSaveRule', doneSaveRule);
+Cypress.Commands.add('doneSaveAndEditRule', doneSaveAndEditRule);
+Cypress.Commands.add('doneSaveMapRule', doneSaveMapRule);
+Cypress.Commands.add('doneSaveLogTextRule', doneSaveLogTextRule);
+Cypress.Commands.add('deleteRule', deleteRule);
Cypress.Commands.add('httpTransalte', httpTransalte);
+Cypress.Commands.add(
+ 'httpGenerateMappingRulesFileName',
+ httpGenerateMappingRulesFileName
+);