This commit is contained in:
2020-04-01 00:36:02 +00:00
parent 506cf7eb66
commit 0e8710acc7
3 changed files with 48 additions and 6 deletions

View File

@@ -50,6 +50,7 @@
@click:prepend="dlgtime = true"
readonly
:error="!!error"
:data-cy="'ttfpick:' + testId"
></v-text-field>
</template>
<v-time-picker

View File

@@ -100,7 +100,6 @@
v-model="obj.startDate"
:readonly="formState.readOnly"
ref="startDate"
data-cy="startDate"
testId="startDate"
:error-messages="form().serverErrors(this, 'startDate')"
@input="fieldValueChanged('startDate')"

View File

@@ -38,17 +38,59 @@ describe("WIDGET", () => {
'[data-cy="dpick:startDate"] > .v-picker__body > :nth-child(1) > .v-date-picker-table > table > tbody > :nth-child(1) > :nth-child(1)'
).click();
//end
//Start time
cy.get("[data-cy='ttfpick:startDate']").click();
//click on 4
cy.get(
"span.v-time-picker-clock__item:nth-child(6) > span:nth-child(1)"
).click();
//click on PM
cy.get(".v-time-picker-title__ampm > :nth-child(2)").click();
// cy.get(" div.v-picker__title__btn:nth-child(2) > :nth-child(1)").click();
//click on 20
cy.get(
"span.v-time-picker-clock__item:nth-child(6) > span:nth-child(1)"
).click();
//click on OK
cy.get('[data-cy="tpick:startDate"] > .v-picker__actions > .v-btn').click();
//end date
cy.get("[data-cy='dtfpick:endDate']").click();
//first row second day (the second of the month)
// cy.get(
// '[data-cy="dpick:endDate"] > .v-picker__body > :nth-child(1) > .v-date-picker-table > table > tbody > :nth-child(2) > :nth-child(1)'
// ).click();
cy.get(
'[data-cy="dpick:endDate"] > .v-picker__body > :nth-child(1) > .v-date-picker-table > table > tbody > :nth-child(1) > :nth-child(2)'
).click();
//End time
//NOTE: had to use some different selectors, maybe because of prior start date pick changing dom and causing duplicates
//If need exact selector in future use Firefox, pick element and select Copy->CSS Selector to get accurate thing to select
cy.get("[data-cy='ttfpick:endDate']").click();
//click on 4
//.v-dialog--active > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > span:nth-child(6) > span:nth-child(1)
cy.get(
".v-dialog--active > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > span:nth-child(6) > span:nth-child(1)"
).click();
//click on PM
cy.get(
".v-dialog--active > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2)"
).click();
// cy.get(" div.v-picker__title__btn:nth-child(2) > :nth-child(1)").click();
//click on 20
cy.get(
".v-dialog--active > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > span:nth-child(6) > span:nth-child(1)"
).click();
//click on OK
cy.get('[data-cy="tpick:endDate"] > .v-picker__actions > .v-btn').click();
//USER PICKLIST
//this is an assumption but it's pretty hard to imagine there not being a user that matches this
//if it's an issue can just generate a known user before this test runs directly to the api, it's a thing that's possible with cypress
cy.get("[data-cy=userid] > .v-input").type("a ..zone");
//select the second item, this assumes only one picklist at a time is dropped down because nothing ties the picklist control to the actual content list
cy.get(
".v-autocomplete__content > .v-select-list > div:nth-child(2)"
).click();
// // we should be redirected to /dashboard
// cy.url().should("include", "/home-dashboard");