aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/steps
diff options
context:
space:
mode:
authorEylon Malin <eylon.malin@intl.att.com>2019-12-11 15:14:37 +0200
committerEylon Malin <eylon.malin@intl.att.com>2019-12-11 15:53:07 +0200
commitf06c7ce17569c67ff4e70b1a95964d843fccd45a (patch)
tree19a8339316f48780f73d94943d290213633b1e41 /vid-webpack-master/cypress/support/steps
parentbfd3b59b7caef3c65d306727fc6fe25a85e68ca2 (diff)
cypress test - default max instances of vfModule is unlimited
Issue-ID: VID-726 Change-Id: I9f4d8b8b07f02f30aab3488f011eb12ce71c0a68 Signed-off-by: Eylon Malin <eylon.malin@intl.att.com>
Diffstat (limited to 'vid-webpack-master/cypress/support/steps')
-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);