Merge from ecomp 718fd196 - Modern UI
[vid.git] / vid-webpack-master / cypress / support / steps / drawingBoard / drawingBoardComponentInfo.steps.ts
1 declare namespace Cypress {
2   interface Chainable {
3     assertComponentInfoTitleLabelsAndValues: typeof assertComponentInfoTitleLabelsAndValues
4   }
5 }
6
7
8
9 function assertComponentInfoTitleLabelsAndValues(expectedTitle: string, labelsAndValues: string[][]) : void{
10   cy.getElementByDataTestsId('component-info-section-title').should('have.text', expectedTitle);
11   cy.get('.componentInfoItem').should('have.length', labelsAndValues.length);
12   labelsAndValues.forEach((tuple: string[], index: number, array: string[][]) => {
13     let label = tuple[0];
14     let value = tuple[1];
15     cy.getElementByDataTestsId('model-item-label-' + label).should('have.text', label);
16     cy.getElementByDataTestsId('model-item-value-' + label).should('have.text', value);
17   });
18 }
19
20
21
22
23 Cypress.Commands.add('assertComponentInfoTitleLabelsAndValues', assertComponentInfoTitleLabelsAndValues);