Skip to content

Commit

Permalink
Add clearAndType method to RoomBoards class for improved input handling
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfganggreschus committed Dec 12, 2024
1 parent 10173cf commit a15876c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions cypress/support/pages/room_board/pageRoomBoards.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,17 @@ class RoomBoards {
static #dialogAddMultiColumnBoard = '[data-testid="dialog-add-multi-column-board"]';
static #boardLayoutDialogTitle = '[data-testid="board-layout-dialog-title"]';

clearAndType(selector, newTitle) {
cy.get(selector)
.first()
.then((element) => {
const currentTitle = element.val();
if (currentTitle) {
cy.wrap(element).type("{backspace}".repeat(currentTitle.length));
}
cy.wrap(element).type(newTitle);
});
}
seeColumnBoardDialogBox() {
cy.get(RoomBoards.#boardLayoutDialogTitle).should("be.visible");
}
Expand Down

0 comments on commit a15876c

Please sign in to comment.