Skip to content

Commit

Permalink
Merge pull request #5253 from Sage/cypress_date_range
Browse files Browse the repository at this point in the history
test(date-range): refactor for cypress tests
  • Loading branch information
DlgSHi authored Jun 24, 2022
2 parents 7bd9a88 + e975f9e commit 9ea37a1
Show file tree
Hide file tree
Showing 6 changed files with 455 additions and 53 deletions.
20 changes: 0 additions & 20 deletions cypress/e2e/common/dateRange.feature

This file was deleted.

14 changes: 0 additions & 14 deletions cypress/fixtures/commonComponents/dateRange.json

This file was deleted.

11 changes: 6 additions & 5 deletions cypress/locators/date-range/index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import LABEL_PREVIEW from "./locators";
import { LABEL } from "../locators";
import DATE_RANGE from "./locators";

// component preview locators
const labelPreview = (index) =>
cy.get(LABEL_PREVIEW).find(`:nth-child(${index})`).find(LABEL);

export default labelPreview;
export const dateRange = (index) => cy.get(DATE_RANGE).children().eq(index);
export const dateRangeComponentLabel = (index) =>
cy.get(DATE_RANGE).find(LABEL).eq(index);
export const dateRangeComponentInput = (index) =>
cy.get(DATE_RANGE).find("input").eq(index);
4 changes: 2 additions & 2 deletions cypress/locators/date-range/locators.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// component preview locators
const LABEL_PREVIEW = 'div[data-component="date-range"]';
const DATE_RANGE = '[data-component="date-range"]';

export default LABEL_PREVIEW;
export default DATE_RANGE;
12 changes: 0 additions & 12 deletions cypress/support/step-definitions/date-range-steps.js

This file was deleted.

Loading

0 comments on commit 9ea37a1

Please sign in to comment.