This repository has been archived by the owner on Jul 26, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: LEAP-447: Add helper methods for Modals, Number, ToolBar (#24)
feat: LEAP-447: Add helper methods for warning modals, Number tag and toolbar
- Loading branch information
Showing
3 changed files
with
33 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,37 @@ | ||
/** | ||
* An object representing different methods for interacting with modals. | ||
*/ | ||
export const Modals = { | ||
/** | ||
* Gets the warning modal. | ||
* @returns {Cypress.Chainable<JQuery<HTMLElement>>} - The warning modal. | ||
*/ | ||
get warning() { | ||
return cy.get('.ant-modal.ant-modal-confirm-warning'); | ||
}, | ||
hasWarning(text) { | ||
|
||
/** | ||
* Checks if the warning modal contains certain text. | ||
* @param {string} text - The text to check for in the modal. | ||
*/ | ||
hasWarning(text: string) { | ||
this.warning.should('be.visible'); | ||
this.warning.contains('Warning').should('be.visible'); | ||
this.warning.contains(text).should('be.visible'); | ||
this.warning.contains('OK').should('be.visible'); | ||
}, | ||
|
||
/** | ||
* Checks that there are no warning modals. | ||
*/ | ||
hasNoWarnings() { | ||
this.warning.should('not.exist'); | ||
}, | ||
|
||
/** | ||
* Closes the warning modal. | ||
*/ | ||
closeWarning() { | ||
this.warning.find('.ant-modal-confirm-btns .ant-btn').contains('OK').click(); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,4 +59,8 @@ export const ToolBar = { | |
.eq(annotationIndex) | ||
.click(); | ||
}, | ||
|
||
clickSubmit() { | ||
this.submitBtn.click(); | ||
}, | ||
}; |