From 3b5ce306b320206862a8ba27eee672776e50d768 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Tue, 31 Mar 2020 21:58:18 +0000 Subject: [PATCH] --- ayanova/src/components/date-time-control.vue | 6 +++++- ayanova/src/views/widget.vue | 3 ++- ayanova/tests/e2e/specs/widget-crud.js | 13 +++++++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ayanova/src/components/date-time-control.vue b/ayanova/src/components/date-time-control.vue index 3d2fc211..6eb63692 100644 --- a/ayanova/src/components/date-time-control.vue +++ b/ayanova/src/components/date-time-control.vue @@ -18,12 +18,14 @@ v-bind:rules="rules" readonly :error="!!error" + :data-cy="'dtfpick:' + testId" > {{ @@ -55,6 +57,7 @@ ampm-in-title :format="hour12 ? 'ampm' : '24hr'" v-model="timeOnly" + :data-cy="'tpick:' + testId" > {{ @@ -98,7 +101,8 @@ export default { error: { type: String, required: false - } + }, + testId: String }, methods: { t(tKey) { diff --git a/ayanova/src/views/widget.vue b/ayanova/src/views/widget.vue index 23b44919..5f535914 100644 --- a/ayanova/src/views/widget.vue +++ b/ayanova/src/views/widget.vue @@ -101,6 +101,7 @@ :readonly="formState.readOnly" ref="startDate" data-cy="startDate" + testId="startDate" :error-messages="form().serverErrors(this, 'startDate')" @input="fieldValueChanged('startDate')" > @@ -114,7 +115,7 @@ v-model="obj.endDate" :readonly="formState.readOnly" ref="endDate" - data-cy="endDate" + testId="endDate" @input="fieldValueChanged('endDate')" > diff --git a/ayanova/tests/e2e/specs/widget-crud.js b/ayanova/tests/e2e/specs/widget-crud.js index 5d7a8afc..b065d336 100644 --- a/ayanova/tests/e2e/specs/widget-crud.js +++ b/ayanova/tests/e2e/specs/widget-crud.js @@ -31,6 +31,19 @@ describe("WIDGET", () => { cy.get("[data-cy=dollarAmount]").type("123.45"); cy.contains("Price is a required field").should("not.exist"); + //start date + cy.get("[data-cy='dtfpick:startDate']").click(); + //first row first day (the first of the month) + cy.get("tbody > :nth-child(1) > :nth-child(1) > .v-btn").click(); + + //end + cy.get("[data-cy='dtfpick:endDate']").click(); + //first row second day (the second of the month) + cy.get("tbody > :nth-child(1) > :nth-child(2) > .v-btn").click(); + + // cy.get("[data-cy=startDate]").click(); + // cy.get("tbody > :nth-child(1) > :nth-child(1) > .v-btn").click(); + // // we should be redirected to /dashboard // cy.url().should("include", "/home-dashboard");