aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/steps/fill.vfModule.step.ts
diff options
context:
space:
mode:
Diffstat (limited to 'vid-webpack-master/cypress/support/steps/fill.vfModule.step.ts')
-rw-r--r--vid-webpack-master/cypress/support/steps/fill.vfModule.step.ts44
1 files changed, 41 insertions, 3 deletions
diff --git a/vid-webpack-master/cypress/support/steps/fill.vfModule.step.ts b/vid-webpack-master/cypress/support/steps/fill.vfModule.step.ts
index d2977832d..b87e773f9 100644
--- a/vid-webpack-master/cypress/support/steps/fill.vfModule.step.ts
+++ b/vid-webpack-master/cypress/support/steps/fill.vfModule.step.ts
@@ -1,10 +1,12 @@
declare namespace Cypress {
interface Chainable {
- fillVFModulePopup: typeof FillVFModulePopup
+ fillVFModulePopup: typeof fillVFModulePopup;
+ addALaCarteVfModule: typeof addALaCarteVfModule;
+ addMacroVfModule: typeof addMacroVfModule;
}
}
-function FillVFModulePopup(vnfName: string, vfModuleName: string, instanceName: string, lcpRegion: string, tenant: string, rollback: boolean, sdncPreLoad: boolean): Chainable<any> {
+function fillVFModulePopup(vnfName: string, vfModuleName: string, instanceName: string, lcpRegion: string, tenant: string, rollback: boolean, sdncPreLoad: boolean): Chainable<any> {
cy.getElementByDataTestsId('node-' + vnfName).click({force: true});
cy.getElementByDataTestsId('node-' + vfModuleName + '-add-btn').click({force: true});
cy.getElementByDataTestsId('instanceName').last().type(instanceName, {force: true});
@@ -21,4 +23,40 @@ function FillVFModulePopup(vnfName: string, vfModuleName: string, instanceName:
}
-Cypress.Commands.add('fillVFModulePopup', FillVFModulePopup);
+function addMacroVfModule(vnfName: string, vfModuleName: string, instanceName: string): Chainable<any> {
+ return cy.getElementByDataTestsId('node-' + vnfName).click({force: true}).then(() => {
+ cy.getElementByDataTestsId('node-' + vfModuleName + '-add-btn').click({force: true}).then(() => {
+ cy.getElementByDataTestsId('instanceName').clear().type(instanceName, {force: true}).then(() => {
+ cy.getElementByDataTestsId('form-set').click({force: true});
+ })
+ })
+ });
+}
+
+function addALaCarteVfModule(vnfName: string, vfModuleName: string, instanceName: string, lcpRegion: string, legacyRegion: string,
+ tenant: string, rollback: boolean, sdncPreLoad: boolean, deleteVgName: boolean): Chainable<any> {
+ return cy.getElementByDataTestsId('node-' + vnfName).click({force: true}).then(() => {
+ cy.getElementByDataTestsId('node-' + vfModuleName + '-add-btn').click({force: true}).then(() => {
+ cy.getElementByDataTestsId('instanceName').clear().type(instanceName, {force: true}).then(() => {
+ if (deleteVgName) {
+ cy.getElementByDataTestsId('volumeGroupName').clear();
+ }
+ }).then(() => {
+ cy.selectDropdownOptionByText('lcpRegion', lcpRegion);
+ if (legacyRegion) {
+ cy.typeToInput("lcpRegionText", legacyRegion);
+ }
+ cy.selectDropdownOptionByText('tenant', tenant);
+ cy.selectDropdownOptionByText('rollback', String(rollback));
+ if (sdncPreLoad) {
+ cy.getElementByDataTestsId('sdncPreLoad').check();
+ }
+ cy.getElementByDataTestsId('form-set').click({force: true});
+ });
+ });
+ });
+}
+
+Cypress.Commands.add('fillVFModulePopup', fillVFModulePopup);
+Cypress.Commands.add('addALaCarteVfModule', addALaCarteVfModule);
+Cypress.Commands.add('addMacroVfModule', addMacroVfModule);