Allow platform multi-selection for VNF in modern UI
[vid.git] / vid-webpack-master / cypress / support / steps / genericForm / genericFormAction.steps.ts
1 declare namespace Cypress {
2   interface Chainable {
3     genericFormSubmitForm: typeof genericFormSubmitForm
4     selelctPlatformValue: typeof selelctPlatformValue
5   }
6 }
7
8
9
10
11 function selelctPlatformValue(isDropdown: boolean, selectOption: string){
12   if (isDropdown) {
13     cy.selectDropdownOptionByText('platform', selectOption);
14   } else {
15     cy.getElementByDataTestsId("multi-selectPlatform").get('.c-btn').click({force: true})
16       .getElementByDataTestsId(`multi-selectPlatform-${selectOption}`).click()
17       .getElementByDataTestsId("multi-selectPlatform").get('.c-btn').click({force: true});
18
19   }
20 }
21
22
23 function genericFormSubmitForm(): Chainable<any> {
24   return cy.getElementByDataTestsId('form-set').click({force: true});
25 }
26
27
28 Cypress.Commands.add('genericFormSubmitForm', genericFormSubmitForm);
29 Cypress.Commands.add('selelctPlatformValue', selelctPlatformValue);