This commit is contained in:
2020-04-01 15:00:42 +00:00
parent 4f08bcfbe2
commit 2e1b11a2bf
2 changed files with 19 additions and 5 deletions

View File

@@ -51,9 +51,13 @@ CURRENT TODOs
todo: Client automated testing
- Need several as basis for all future, make sure it's right.
todo: de-var-ification
- use const for unchanging values, let everywhere else, no var anywhere and test out before moving on
todo: new widget
- There should be a new option (in addition to duplicate) within the existing widget form because it makes sense to want to make a new one while editing previous one
- Plus you could have arrived there from anywhere, don't want to have to reload a big list just to add a new one

View File

@@ -2,7 +2,7 @@
describe("WIDGET", () => {
it("Performs all crud ops on widget", () => {
var unique = new Date().getTime();
let unique = new Date().getTime();
cy.visit("/login");
cy.get("input[name=username]")
@@ -17,6 +17,13 @@ describe("WIDGET", () => {
cy.url().should("include", "/home-dashboard");
cy.visit("/widgets/0");
cy.url().should("include", "/widgets/0");
//save the start url for later
let startUrl = null;
//funcs are async so need to get result via then
cy.url().then(url => {
startUrl = url;
});
//first edit to break the required rules
cy.get("[data-cy=active]").check({ force: true }); //have to force, for some reason it thinks it's covered
//now name and price sb required rule broken
@@ -33,9 +40,10 @@ describe("WIDGET", () => {
//start date
cy.get("[data-cy='dtfpick:startDate']").click();
//first row first day (the first of the month)
//second row first day (the first row first day is variable so not suitable)
//cy.get(':nth-child(2) > :nth-child(1) > .v-btn')
cy.get(
'[data-cy="dpick:startDate"] > .v-picker__body > :nth-child(1) > .v-date-picker-table > table > tbody > :nth-child(1) > :nth-child(1)'
'[data-cy="dpick:startDate"] > .v-picker__body > :nth-child(1) > .v-date-picker-table > table > tbody > :nth-child(2) > :nth-child(1)'
).click();
//Start time
@@ -56,9 +64,9 @@ describe("WIDGET", () => {
//end date
cy.get("[data-cy='dtfpick:endDate']").click();
//first row second day (the second of the month)
//second row second day (second row always has all days represented)
cy.get(
'[data-cy="dpick:endDate"] > .v-picker__body > :nth-child(1) > .v-date-picker-table > table > tbody > :nth-child(1) > :nth-child(2)'
'[data-cy="dpick:endDate"] > .v-picker__body > :nth-child(1) > .v-date-picker-table > table > tbody > :nth-child(2) > :nth-child(2)'
).click();
//End time
@@ -106,6 +114,8 @@ describe("WIDGET", () => {
//SAve the record
cy.get('[data-cy="widget-edit:save"]').click();
cy.url().should("not.eql", startUrl);
//cy.get("[data-cy=WidgetCustom4]").check({ force: true }); //have to force, for some reason it thinks it's covered
//cy.get("[data-cy=tags]").type("zone1{enter}", { force: true });