blob: 2033f060c5ff670e537675b7716b4a9779ecbad9 [file] [log] [blame]
Ittay Stern6f900cc2018-08-29 17:01:32 +03001declare namespace Cypress {
2 interface Chainable {
3 assertComponentInfoTitleLabelsAndValues: typeof assertComponentInfoTitleLabelsAndValues
4 }
5}
6
7
8
9function assertComponentInfoTitleLabelsAndValues(expectedTitle: string, labelsAndValues: string[][]) : void{
10 cy.getElementByDataTestsId('component-info-section-title').should('have.text', expectedTitle);
11 labelsAndValues.forEach((tuple: string[], index: number, array: string[][]) => {
12 let label = tuple[0];
13 let value = tuple[1];
14 cy.getElementByDataTestsId('model-item-label-' + label).should('have.text', label);
15 cy.getElementByDataTestsId('model-item-value-' + label).should('have.text', value);
16 });
17}
18
19
20
21
22Cypress.Commands.add('assertComponentInfoTitleLabelsAndValues', assertComponentInfoTitleLabelsAndValues);