This commit is contained in:
@@ -51,6 +51,7 @@ CURRENT TODOs
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
todo: save new widget delete button missing after save, but refresh and it appears
|
||||||
|
|
||||||
todo: Client automated testing
|
todo: Client automated testing
|
||||||
- Need several as basis for all future, make sure it's right.
|
- Need several as basis for all future, make sure it's right.
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
// https://docs.cypress.io/api/introduction/api.html
|
// https://docs.cypress.io/api/introduction/api.html
|
||||||
|
//https://docs.cypress.io/guides/references/assertions.html#BDD-Assertions
|
||||||
describe("WIDGET", () => {
|
describe("WIDGET FORM", () => {
|
||||||
it("Performs all crud ops on widget", () => {
|
it("Performs all crud ops on widget successfully", () => {
|
||||||
let unique = new Date().getTime();
|
let unique = new Date().getTime();
|
||||||
cy.visit("/login");
|
cy.visit("/login");
|
||||||
|
|
||||||
cy.get("input[name=username]")
|
cy.get("input[name=username]")
|
||||||
.clear()
|
.clear()
|
||||||
.type(Cypress.env("adminusername"));
|
.type(Cypress.env("adminusername"));
|
||||||
@@ -17,6 +16,7 @@ describe("WIDGET", () => {
|
|||||||
cy.url().should("include", "/home-dashboard");
|
cy.url().should("include", "/home-dashboard");
|
||||||
cy.visit("/widgets/0");
|
cy.visit("/widgets/0");
|
||||||
cy.url().should("include", "/widgets/0");
|
cy.url().should("include", "/widgets/0");
|
||||||
|
|
||||||
//save the start url for later
|
//save the start url for later
|
||||||
let startUrl = null;
|
let startUrl = null;
|
||||||
//funcs are async so need to get result via then
|
//funcs are async so need to get result via then
|
||||||
@@ -30,7 +30,8 @@ describe("WIDGET", () => {
|
|||||||
cy.contains("Name is a required field");
|
cy.contains("Name is a required field");
|
||||||
cy.contains("Price is a required field");
|
cy.contains("Price is a required field");
|
||||||
//enter name
|
//enter name
|
||||||
cy.get("[data-cy=name]").type("E2E CRUD " + unique);
|
let name = "E2E CRUD " + unique;
|
||||||
|
cy.get("[data-cy=name]").type(name);
|
||||||
//confirm error went away
|
//confirm error went away
|
||||||
cy.contains("Name is a required field").should("not.exist");
|
cy.contains("Name is a required field").should("not.exist");
|
||||||
|
|
||||||
@@ -40,8 +41,7 @@ describe("WIDGET", () => {
|
|||||||
|
|
||||||
//start date
|
//start date
|
||||||
cy.get("[data-cy='dtfpick:startDate']").click();
|
cy.get("[data-cy='dtfpick:startDate']").click();
|
||||||
//second row first day (the first row first day is variable so not suitable)
|
//second row first day (the first row first day is variable (not always Monday) so not suitable)
|
||||||
//cy.get(':nth-child(2) > :nth-child(1) > .v-btn')
|
|
||||||
cy.get(
|
cy.get(
|
||||||
'[data-cy="dpick:startDate"] > .v-picker__body > :nth-child(1) > .v-date-picker-table > table > tbody > :nth-child(2) > :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();
|
).click();
|
||||||
@@ -74,7 +74,6 @@ describe("WIDGET", () => {
|
|||||||
//If need exact selector in future use Firefox, pick element and select Copy->CSS Selector to get accurate thing to select
|
//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();
|
cy.get("[data-cy='ttfpick:endDate']").click();
|
||||||
//click on 4
|
//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(
|
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)"
|
".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();
|
||||||
@@ -82,7 +81,6 @@ describe("WIDGET", () => {
|
|||||||
cy.get(
|
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)"
|
".v-dialog--active > div:nth-child(1) > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2)"
|
||||||
).click();
|
).click();
|
||||||
// cy.get(" div.v-picker__title__btn:nth-child(2) > :nth-child(1)").click();
|
|
||||||
//click on 20
|
//click on 20
|
||||||
cy.get(
|
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)"
|
".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)"
|
||||||
@@ -99,38 +97,21 @@ describe("WIDGET", () => {
|
|||||||
".v-autocomplete__content > .v-select-list > div:nth-child(2)"
|
".v-autocomplete__content > .v-select-list > div:nth-child(2)"
|
||||||
).click();
|
).click();
|
||||||
|
|
||||||
//select customer user
|
|
||||||
cy.get("[data-cy=usertype]").type("cu{enter}", { force: true });
|
cy.get("[data-cy=usertype]").type("cu{enter}", { force: true });
|
||||||
|
|
||||||
cy.get("[data-cy=notes]").type("Testing 1..2..3{enter}EOT");
|
cy.get("[data-cy=notes]").type("Testing 1..2..3{enter}EOT");
|
||||||
|
cy.get("[data-cy=tags] input[type=text] ").type("zone1{enter}{esc}"); //esc necessary to close tags control
|
||||||
cy.get("[data-cy=tags] input[type=text] ").type("zone1{enter}{esc}");
|
|
||||||
|
|
||||||
// cy.get("[data-cy=WidgetCustom2]").click(); //to close the tags above
|
|
||||||
cy.get("[data-cy=WidgetCustom2]").type(
|
cy.get("[data-cy=WidgetCustom2]").type(
|
||||||
"Custom text field testing a...b...c...{enter}EOT"
|
"Custom text field testing a...b...c...{enter}EOT"
|
||||||
);
|
);
|
||||||
|
|
||||||
//SAve the record
|
//SAve the record and ensure it's different
|
||||||
cy.get('[data-cy="widget-edit:save"]').click();
|
cy.get('[data-cy="widget-edit:save"]').click();
|
||||||
|
|
||||||
cy.url().should("not.eql", startUrl);
|
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
|
//confirm it's the same one
|
||||||
|
cy.get("[data-cy=name]").should("have.value", name);
|
||||||
|
|
||||||
//cy.get("[data-cy=tags]").type("zone1{enter}", { force: true });
|
//delete the record
|
||||||
|
cy.get('[data-cy="widget-edit:delete"]').click();
|
||||||
// // we should be redirected to /dashboard
|
|
||||||
// cy.url().should("include", "/home-dashboard");
|
|
||||||
|
|
||||||
// //navigate and confirm
|
|
||||||
// //open nav and home menu
|
|
||||||
// cy.get("[data-cy=navicon]").click();
|
|
||||||
// cy.get("[data-cy=home]").click();
|
|
||||||
// cy.get("[data-cy='nav/home-user-settings']").click();
|
|
||||||
// cy.url().should("include", "/home-user-settings");
|
|
||||||
// cy.get("[data-cy=contextmenu]").click();
|
|
||||||
// cy.get("[data-cy='app:logout']").click();
|
|
||||||
// cy.url().should("include", "/login");
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user