blob: 26682775f31cf27e2c1883200548b749d9d2188e [file] [log] [blame]
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);