Skip to content

Commit

Permalink
Improve rule to verify component position
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaudlabat authored and Dimitri Chauvel committed Aug 21, 2023
1 parent ebf6e40 commit 6eb4d3e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions cypress/support/step_definitions/html.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ Then('I expect {string} to be at position {int},{int}', (templateSelector, x, y)
expect(Math.trunc(parseInt(element.attr('x')))).eq(x);
expect(Math.trunc(parseInt(element.attr('y')))).eq(y);
});

});

Then('I expect {string} width is {int}', (templateSelector, width) => {
Expand All @@ -125,3 +126,11 @@ Then('I expect {string} appear {int} time(s) on screen', (templateSelector, coun
const selector = nunjucks.renderString(templateSelector, cy.context);
cy.get(selector).should('have.length', count);
});

Then('I expect {string} attribute {string} to be {string}', (templateSelector, attribute, value) => {
const selector = nunjucks.renderString(templateSelector, cy.context);

cy.get(selector).should((element) => {
expect(element.attr(attribute)).eq(value);
});
});

0 comments on commit 6eb4d3e

Please sign in to comment.