Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
ihorivna007 committed Jul 24, 2023
1 parent 757d487 commit 6dea333
Show file tree
Hide file tree
Showing 12 changed files with 31,822 additions and 943 deletions.
1 change: 0 additions & 1 deletion cypress.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"baseUrl": "http://localhost:3000",
"defaultCommandTimeout": 2000,
"video": true,
"viewportHeight": 1920,
"viewportWidth": 1080,
Expand Down
8 changes: 0 additions & 8 deletions cypress/support/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1 @@
import '@mate-academy/cypress-tools/support';

declare global {
namespace Cypress {
interface Chainable<Subject> {
byDataCy(name: string, text: string): Chainable<JQuery>;
}
}
}
18 changes: 0 additions & 18 deletions cypress/support/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1 @@
require('@mate-academy/cypress-tools/support');

Cypress.Commands.add(
'byDataCy',
{ prevSubject: 'optional' },

(subject, name, text = '') => {
const target = subject || cy;
const selector = `[data-cy="${name}"]`;

if (text) {
return target.contain(selector, text);
}

return subject
? subject.find(selector)
: cy.get(selector);
},
);
Loading

0 comments on commit 6dea333

Please sign in to comment.