blob: 7854899f83bb7b8fcb2cf4e48bcfe2b4c4cbfda8 [file] [log] [blame]
Ittay Stern6f900cc2018-08-29 17:01:32 +03001declare namespace Cypress {
2 interface Chainable {
3 drawingBoardPressAddButtonByElementName: typeof drawingBoardPressAddButtonByElementName,
4 drawingBoardNumberOfExistingElementsShouldContains: typeof drawingBoardNumberOfExistingElementsShouldContains
Ittay Sternf7926712019-07-07 19:23:03 +03005 getDrawingBoardDeployBtn: typeof getDrawingBoardDeployBtn
Ittay Stern6f900cc2018-08-29 17:01:32 +03006 }
7}
8
9function drawingBoardPressAddButtonByElementName(elementName : string) : Chainable<any> {
10 return cy.getElementByDataTestsId(elementName + '-add-btn');
11}
12
13function drawingBoardNumberOfExistingElementsShouldContains(expectedElements : number) : void {
14 cy.getElementByDataTestsId('numberButton').contains(expectedElements);
15}
16
Ittay Sternf7926712019-07-07 19:23:03 +030017function getDrawingBoardDeployBtn() : Chainable<any> {
18 return cy.getElementByDataTestsId('deployBtn');
19}
20
Ittay Stern6f900cc2018-08-29 17:01:32 +030021Cypress.Commands.add('drawingBoardPressAddButtonByElementName', drawingBoardPressAddButtonByElementName);
22Cypress.Commands.add('drawingBoardNumberOfExistingElementsShouldContains', drawingBoardNumberOfExistingElementsShouldContains);
Ittay Sternf7926712019-07-07 19:23:03 +030023Cypress.Commands.add('getDrawingBoardDeployBtn', getDrawingBoardDeployBtn);