Skip to content

Commit

Permalink
getId replaced with findByTestId
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Mucha <[email protected]>
  • Loading branch information
drptbl committed Dec 3, 2020
1 parent 05cbee7 commit 261fd8f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 14 deletions.
7 changes: 0 additions & 7 deletions support/commands.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
import '@testing-library/cypress/add-commands';
import 'cypress-wait-until';

Cypress.Commands.add('getId', name => {
if (name.includes('@')) {
return cy.get(`${name}`);
}
return cy.get(`[data-testid="${name}"]`).as(name);
});

Cypress.Commands.add('getDesktopSizes', () => {
return [
[1366, 768],
Expand Down
7 changes: 0 additions & 7 deletions support/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
declare namespace Cypress {
interface Chainable<Subject> {
/**
* Get element using data-testid and sets an alias for it
* @example
* cy.getId('dataTestId')
* cy.getId('alias')
*/
getId(testid: string): Chainable<Subject>;
/**
* Get the most popular desktop resolutions
* @example
Expand Down

0 comments on commit 261fd8f

Please sign in to comment.