summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardComponentInfo.steps.ts
blob: 26682775f31cf27e2c1883200548b749d9d2188e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
declare namespace Cypress {
  interface Chainable {
    assertComponentInfoTitleLabelsAndValues: typeof assertComponentInfoTitleLabelsAndValues
  }
}



function assertComponentInfoTitleLabelsAndValues(expectedTitle: string, labelsAndValues: string[][]) : void{
  cy.getElementByDataTestsId('component-info-section-title').should('have.text', expectedTitle);
  cy.get('.componentInfoItem').should('have.length', labelsAndValues.length);
  labelsAndValues.forEach((tuple: string[], index: number, array: string[][]) => {
    let label = tuple[0];
    let value = tuple[1];
    cy.getElementByDataTestsId('model-item-label-' + label).should('have.text', label);
    cy.getElementByDataTestsId('model-item-value-' + label).should('have.text', value);
  });
}




Cypress.Commands.add('assertComponentInfoTitleLabelsAndValues', assertComponentInfoTitleLabelsAndValues);