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-355: Enhance Relation helpers and fix ts typings (#23)
* feat: LEAP-355: Enhance Relation helpers and fix ts typings * Enhance ToolBar with additional helper methods Added more detailed commentary to the existing functions in ToolBar.ts. Furthermore, enhanced the functionalities by introducing new functions for interacting with annotation elements. These new features and methods will help in interacting with the annotations dropdown, creating new annotations, and selecting specific annotations from the list. * Rename Relation methods for clarity The 'relation' function was renamed to 'getRelation', and the hover/unhover functions were renamed to 'hoverOverRelation' and 'stopHoveringOverRelation'. This was done to improve readability and better express the functionalities of these methods in the LSF Relations helper file. * Add blur event after filing relation lebel input
- Loading branch information
Showing
4 changed files
with
259 additions
and
7 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
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,10 +1,62 @@ | ||
export const ToolBar = { | ||
get root() { | ||
/** | ||
* Represents the root HTML element. | ||
* @returns {Cypress.Chainable<JQuery<HTMLElement>>} Cypress object which represents the root HTML element. | ||
*/ | ||
get root(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return cy.get('.lsf-topbar'); | ||
}, | ||
|
||
get submitBtn() { | ||
/** | ||
* Represents the submit button HTML element. | ||
* @returns {Cypress.Chainable<JQuery<HTMLElement>>} Cypress object which represents the submit button HTML element. | ||
*/ | ||
get submitBtn(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.root | ||
.find('[aria-label="submit"]'); | ||
}, | ||
/** | ||
* Represents the annotations dropdown toggle HTML element. | ||
* @returns {Cypress.Chainable<JQuery<HTMLElement>>} Cypress object which represents the annotations toggle HTML element. | ||
*/ | ||
get annotationsToggle(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.root | ||
.find('.lsf-annotations-list'); | ||
}, | ||
/** | ||
* Represents the create annotation button HTML element. | ||
* @returns {Cypress.Chainable<JQuery<HTMLElement>>} Cypress object which represents the create annotation button HTML element. | ||
*/ | ||
get createAnnotationButton(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.root | ||
.find('.lsf-annotations-list__create'); | ||
}, | ||
/** | ||
* Represents the list of annotation HTML elements in the dropdown. | ||
* @returns {Cypress.Chainable<JQuery<HTMLElement>>} Cypress object which represents the list of annotation HTML elements in the dropdown. | ||
*/ | ||
get annotationsList(): Cypress.Chainable<JQuery<HTMLElement>> { | ||
return this.root.find('.lsf-annotations-list__list'); | ||
}, | ||
/** | ||
* Toggles the display of the annotations list. | ||
*/ | ||
toggleAnnotationsList(): void { | ||
this.annotationsToggle.click(); | ||
}, | ||
/** | ||
* Triggers the creation of a new annotation. | ||
*/ | ||
createNewAnnotation(): void { | ||
this.createAnnotationButton.click(); | ||
}, | ||
/** | ||
* Triggers a click event on a specific annotation in the list. | ||
* @param annotationIndex {number} - The index of the annotation in the list. | ||
*/ | ||
selectAnnotation(annotationIndex: number): void { | ||
this.annotationsList | ||
.find('.lsf-annotations-list__entity') | ||
.eq(annotationIndex) | ||
.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