graphql-engine/console/cypress/support/clearConsoleTextarea.ts
Stefano Magni b2103cda61 console: Refactoring the Mutation Actions-related E2E tests
PR-URL: https://github.com/hasura/graphql-engine-mono/pull/4482
GitOrigin-RevId: bd628911e607ab41399b31f7dd8fe9c361e0f052
2022-06-17 14:07:16 +00:00

12 lines
325 B
TypeScript

/**
* Clear a Console's textarea.
* Work around cy.clear sometimes not working in the Console's textareas.
*/
Cypress.Commands.add('clearConsoleTextarea', { prevSubject: 'element' }, el => {
cy.wrap(el).type('{selectall}', { force: true }).trigger('keydown', {
keyCode: 46,
which: 46,
force: true,
});
});