Skip to content

Commit

Permalink
fix issue with timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
tnrich committed Jun 28, 2024
1 parent 3350d76 commit d14a4f3
Showing 1 changed file with 3 additions and 77 deletions.
80 changes: 3 additions & 77 deletions packages/ove/cypress/support/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -331,19 +331,19 @@ Cypress.Commands.add("deleteSelection", () => {

Cypress.Commands.add("waitForDialogClose", ({ timeout } = {}) => {
cy.get(".bp3-dialog", {
timeout
timeout: timeout || 40000
}).should("not.exist");
});

Cypress.Commands.add("waitForMenuClose", ({ timeout } = {}) => {
cy.get(".bp3-menu", {
timeout
timeout: timeout || 40000
}).should("not.exist");
});

Cypress.Commands.add("closeDialog", ({ timeout } = {}) => {
cy.get(".bp3-dialog-close-button").click();
cy.waitForDialogClose({ timeout });
cy.waitForDialogClose({ timeout: timeout || 40000 });
});
Cypress.Commands.add("hideMenu", () => {
cy.get(".bp3-popover").invoke("hide");
Expand All @@ -354,77 +354,3 @@ Cypress.Commands.add("closeToasts", () => {
win.__tgClearAllToasts();
});
});

// Cypress.Commands.overwrite(
// "type",
// (originalFn, subject, text, options = {}) => {
// return originalFn(subject, text, options);
// // cy.wait(0).then({ timeout: options.timeout || 40000 }, () => {
// // return originalFn(subject, text, options);
// // });
// }
// );

// Cypress.Commands.overwrite(
// "type",
// (originalFn, subject, text, options = {}) => {
// if (text === "{selectall}{del}") {
// return originalFn(subject, text, options); //pass thru .clear() calls
// } else if (options.passThru) {
// return originalFn(subject, text, options); //pass thru .clear() calls
// } else {
// cy.wrap(subject, { log: false })
// .invoke("val")
// .then((prevValue) => {
// if (
// options.passThru ||
// options.parseSpecialCharSequences === false ||
// (text.includes && text.includes("{")) //if special chars are getting used just pass them thru
// ) {
// // eslint-disable-next-line cypress/no-unnecessary-waiting
// cy.wait(0, { log: false }).then(
// { timeout: options.timeout || 40000 },
// () => originalFn(subject, text, options)
// );
// } else {
// // eslint-disable-next-line cypress/no-unnecessary-waiting
// cy.wait(0, { log: false }).then(
// { timeout: options.timeout || 40000 },
// () => originalFn(subject, text, options)
// );

// const valToCheck =
// options.assertVal ||
// `${options.noPrevValue ? "" : prevValue}${text}`;
// if (options.containsSelector) {
// cy.contains(options.containsSelector, valToCheck);
// } else {
// // Adds guarding that asserts that the value is typed.
// cy.wrap(subject, { log: false }).then(($el) => {
// // $el is a wrapped jQuery element
// if (!($el.val() === valToCheck)) {
// if (options.runCount > 5) {
// //if the type fails more than 5 times then throw an error
// console.error("Error! Tried re-typing 5 times to no avail");
// throw new Error(
// "Error! Tried re-typing 5 times to no avail"
// );
// } else {
// //if the type failed, retry it again up to 5 times
// cy.wrap(subject)
// .clear()
// .type(valToCheck, {
// ...options,
// runCount: (options.runCount || 0) + 1
// });
// }
// } else {
// //continue on, the type completed successfully!
// }
// });
// }
// }
// });
// }
// }
// );

0 comments on commit d14a4f3

Please sign in to comment.