Skip to content

Commit

Permalink
Remove unreliable typeInSearchField function
Browse files Browse the repository at this point in the history
  • Loading branch information
felixhabib committed Mar 7, 2024
1 parent 94c75f8 commit c339afb
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions cypress/support/utils.js
Expand Up @@ -188,13 +188,6 @@ export const loadPlayroom = (initialCode) => {
});
};

const typeInSearchField = (text) =>
/*
force true is required because cypress incorrectly and intermittently
reports that search field is covered by another element
*/
cy.get('.CodeMirror-search-field').type(text, { force: true });

/**
* @param {string} term
*/
Expand All @@ -203,7 +196,7 @@ export const findInCode = (term) => {
cy.wait(200); // eslint-disable-line @finsit/cypress/no-unnecessary-waiting
typeCode(`{${cmdPlus('f')}}`);

typeInSearchField(`${term}{enter}`);
typeCode(`${term}{enter}`);
};

/**
Expand All @@ -214,9 +207,9 @@ export const replaceInCode = (term, replaceWith) => {
// Wait necessary to ensure code pane is focussed
cy.wait(200); // eslint-disable-line @finsit/cypress/no-unnecessary-waiting
typeCode(`{${cmdPlus('alt+f')}}`);
typeInSearchField(`${term}{enter}`);
typeCode(`${term}{enter}`);
if (replaceWith) {
typeInSearchField(`${replaceWith}{enter}`);
typeCode(`${replaceWith}{enter}`);
}
};

Expand Down

0 comments on commit c339afb

Please sign in to comment.