summaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/cypress/support/steps/drawingBoard/drawingBoardComponentInfo.steps.ts
blob: 2033f060c5ff670e537675b7716b4a9779ecbad9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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);
  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);