This commit is contained in:
2020-03-31 21:58:18 +00:00
parent 1d6c6e2486
commit 3b5ce306b3
3 changed files with 20 additions and 2 deletions

View File

@@ -18,12 +18,14 @@
v-bind:rules="rules" v-bind:rules="rules"
readonly readonly
:error="!!error" :error="!!error"
:data-cy="'dtfpick:' + testId"
></v-text-field> ></v-text-field>
</template> </template>
<v-date-picker <v-date-picker
v-model="dateOnly" v-model="dateOnly"
@input="dlgdate = false" @input="dlgdate = false"
:locale="defaultLocale" :locale="defaultLocale"
:data-cy="'dpick:' + testId"
> >
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn text color="primary" @click="dlgdate = false">{{ <v-btn text color="primary" @click="dlgdate = false">{{
@@ -55,6 +57,7 @@
ampm-in-title ampm-in-title
:format="hour12 ? 'ampm' : '24hr'" :format="hour12 ? 'ampm' : '24hr'"
v-model="timeOnly" v-model="timeOnly"
:data-cy="'tpick:' + testId"
> >
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-btn text color="primary" @click="dlgtime = false">{{ <v-btn text color="primary" @click="dlgtime = false">{{
@@ -98,7 +101,8 @@ export default {
error: { error: {
type: String, type: String,
required: false required: false
} },
testId: String
}, },
methods: { methods: {
t(tKey) { t(tKey) {

View File

@@ -101,6 +101,7 @@
:readonly="formState.readOnly" :readonly="formState.readOnly"
ref="startDate" ref="startDate"
data-cy="startDate" data-cy="startDate"
testId="startDate"
:error-messages="form().serverErrors(this, 'startDate')" :error-messages="form().serverErrors(this, 'startDate')"
@input="fieldValueChanged('startDate')" @input="fieldValueChanged('startDate')"
></gz-date-time-picker> ></gz-date-time-picker>
@@ -114,7 +115,7 @@
v-model="obj.endDate" v-model="obj.endDate"
:readonly="formState.readOnly" :readonly="formState.readOnly"
ref="endDate" ref="endDate"
data-cy="endDate" testId="endDate"
@input="fieldValueChanged('endDate')" @input="fieldValueChanged('endDate')"
></gz-date-time-picker> ></gz-date-time-picker>
</v-col> </v-col>

View File

@@ -31,6 +31,19 @@ describe("WIDGET", () => {
cy.get("[data-cy=dollarAmount]").type("123.45"); cy.get("[data-cy=dollarAmount]").type("123.45");
cy.contains("Price is a required field").should("not.exist"); 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 // // we should be redirected to /dashboard
// cy.url().should("include", "/home-dashboard"); // cy.url().should("include", "/home-dashboard");