Allow platform multi-selection for VNF in modern UI
[vid.git] / vid-webpack-master / cypress / support / steps / genericForm / genericFormAction.steps.ts
index 9786369..41784da 100644 (file)
@@ -1,12 +1,29 @@
 declare namespace Cypress {
   interface Chainable {
     genericFormSubmitForm: typeof genericFormSubmitForm
+    selelctPlatformValue: typeof selelctPlatformValue
   }
 }
 
-function genericFormSubmitForm() : Chainable<any>  {
-  return  cy.getElementByDataTestsId('form-set').click({force: true});
+
+
+
+function selelctPlatformValue(isDropdown: boolean, selectOption: string){
+  if (isDropdown) {
+    cy.selectDropdownOptionByText('platform', selectOption);
+  } else {
+    cy.getElementByDataTestsId("multi-selectPlatform").get('.c-btn').click({force: true})
+      .getElementByDataTestsId(`multi-selectPlatform-${selectOption}`).click()
+      .getElementByDataTestsId("multi-selectPlatform").get('.c-btn').click({force: true});
+
+  }
+}
+
+
+function genericFormSubmitForm(): Chainable<any> {
+  return cy.getElementByDataTestsId('form-set').click({force: true});
 }
 
 
 Cypress.Commands.add('genericFormSubmitForm', genericFormSubmitForm);
+Cypress.Commands.add('selelctPlatformValue', selelctPlatformValue);