diff --git a/ayanova/src/components/date-time-control.vue b/ayanova/src/components/date-time-control.vue index 6eb63692..8d31dab7 100644 --- a/ayanova/src/components/date-time-control.vue +++ b/ayanova/src/components/date-time-control.vue @@ -50,6 +50,7 @@ @click:prepend="dlgtime = true" readonly :error="!!error" + :data-cy="'ttfpick:' + testId" > { '[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");