This commit is contained in:
@@ -12,7 +12,9 @@ todo: take a look at front end cypress testing etc again, it's going to be the b
|
||||
See where it's at, is any of it usable?
|
||||
Even just a single test that logs in, creates a widget using every field, edits it and deletes it would be a good smoke test
|
||||
Ideally:
|
||||
Run all tests is all that's required
|
||||
Smoke test runnable, visits every page and CRUD widget
|
||||
It should confirm each page has loaded, right now it just checks the url bar but that's not the same as erroring or not
|
||||
Runs against release mode
|
||||
need data-cy in release mode so changes need to be made to main dev and etc, perhaps it's just a default to add cy no if statement
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ describe("Login", () => {
|
||||
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.get("[data-cy=navicon]").click();
|
||||
cy.get("[data-cy=logout]").click();
|
||||
cy.url().should("include", "/login");
|
||||
});
|
||||
});
|
||||
65
ayanova/tests/e2e/OLD/customize-form.js
Normal file
65
ayanova/tests/e2e/OLD/customize-form.js
Normal file
@@ -0,0 +1,65 @@
|
||||
|
||||
//################# COMMENTED OUT BECAUSE TOO PROBLEMATIC TO TEST, HAS SIDE EFFECTS AND IF IT FAILS THEN NEEDS TO BE REVERSED TO RE-RUN THE TEST AGAIN
|
||||
//BAH
|
||||
|
||||
// // https://docs.cypress.io/api/introduction/api.html
|
||||
|
||||
// describe("CUSTOMIZE", () => {
|
||||
// it("Edits and works", () => {
|
||||
// cy.visit("/login");
|
||||
|
||||
// cy.get("input[name=username]")
|
||||
// .clear()
|
||||
// .type(Cypress.env("adminusername"));
|
||||
|
||||
// // {enter} causes the form to submit
|
||||
// cy.get("input[name=password]")
|
||||
// .clear()
|
||||
// .type(`${Cypress.env("adminpassword")}{enter}`);
|
||||
|
||||
// cy.visit("/widgets/1");
|
||||
// cy.url().should("include", "/widgets/1");
|
||||
// //check serial field is present, then hide it and check it's gone then re-show it again
|
||||
// cy.get("[data-cy=serial]").should("exist");
|
||||
// cy.get("[data-cy=WidgetCustom8]").should("not.exist");
|
||||
|
||||
// cy.wait(100);
|
||||
// cy.get("[data-cy=contextmenu]").click();
|
||||
// cy.get('[data-cy="app:customize"]').click();
|
||||
// cy.url().should("include", "/customize/Widget");
|
||||
|
||||
// //hide serial
|
||||
// cy.get("[data-cy=SerialVisible]").uncheck({ force: true });
|
||||
// cy.wait(10);
|
||||
|
||||
// //show widget 8 and set it to a type
|
||||
// cy.get("[data-cy=WidgetCustom8]").scrollIntoView();
|
||||
// cy.get("[data-cy=WidgetCustom8Visible]").check({ force: true });
|
||||
// cy.get("[data-cy=WidgetCustom8SelectType]").type("tr{enter}", {
|
||||
// force: true
|
||||
// });
|
||||
|
||||
// cy.get('[data-cy="customize:save"] > .v-btn__content > .v-icon').click();
|
||||
|
||||
// cy.go("back");
|
||||
// //check customize worked
|
||||
// cy.get("[data-cy=serial]").should("not.exist");
|
||||
// cy.get("[data-cy=WidgetCustom8]").should("exist");
|
||||
|
||||
// //reverse
|
||||
// cy.wait(100);
|
||||
// cy.get("[data-cy=contextmenu]").click();
|
||||
// cy.get('[data-cy="app:customize"]').click();
|
||||
// cy.url().should("include", "/customize/Widget");
|
||||
// cy.get("[data-cy=SerialVisible]").check({ force: true });
|
||||
// cy.get("[data-cy=WidgetCustom8Visible]").uncheck({ force: true });
|
||||
// cy.get("[data-cy=WidgetCustom8SelectType]").type("te{enter}", {
|
||||
// force: true
|
||||
// });
|
||||
// cy.get('[data-cy="customize:save"] > .v-btn__content > .v-icon').click();
|
||||
// cy.go("back");
|
||||
// cy.get("[data-cy=serial]").should("exist");
|
||||
// cy.get("[data-cy=WidgetCustom8]").should("not.exist");
|
||||
// //-----
|
||||
// });
|
||||
// });
|
||||
@@ -85,8 +85,8 @@ describe("GZ-DATA-TABLE", () => {
|
||||
// cy.get("[data-cy=home]").click();
|
||||
// cy.get("[data-cy='nav/home-user-settings']").click();
|
||||
//
|
||||
// cy.get("[data-cy=contextmenu]").click();
|
||||
// cy.get("[data-cy='app:logout']").click();
|
||||
// cy.url().should("include", "/login");
|
||||
cy.get("[data-cy=navicon]").click();
|
||||
cy.get("[data-cy=logout]").click();
|
||||
cy.url().should("include", "/login");
|
||||
});
|
||||
});
|
||||
@@ -1,59 +0,0 @@
|
||||
// https://docs.cypress.io/api/introduction/api.html
|
||||
|
||||
describe("CUSTOMIZE", () => {
|
||||
it("Edits and works", () => {
|
||||
cy.visit("/login");
|
||||
|
||||
cy.get("input[name=username]")
|
||||
.clear()
|
||||
.type(Cypress.env("adminusername"));
|
||||
|
||||
// {enter} causes the form to submit
|
||||
cy.get("input[name=password]")
|
||||
.clear()
|
||||
.type(`${Cypress.env("adminpassword")}{enter}`);
|
||||
cy.url().should("include", "/home-dashboard");
|
||||
|
||||
cy.visit("/widgets/0");
|
||||
cy.url().should("include", "/widgets/0");
|
||||
//check serial field is present, then hide it and check it's gone then re-show it again
|
||||
cy.get("[data-cy=serial]").should("exist");
|
||||
cy.get("[data-cy=WidgetCustom8]").should("not.exist");
|
||||
|
||||
cy.wait(100);
|
||||
cy.get("[data-cy=contextmenu]").click();
|
||||
cy.get('[data-cy="app:customize"]').click();
|
||||
cy.url().should("include", "/customize/Widget");
|
||||
|
||||
//hide serial
|
||||
cy.get("[data-cy=SerialVisible]").uncheck({ force: true });
|
||||
|
||||
//show widget 8 and set it to a type
|
||||
cy.get("[data-cy=WidgetCustom8]").scrollIntoView();
|
||||
cy.get("[data-cy=WidgetCustom8Visible]").check({ force: true });
|
||||
cy.get("[data-cy=WidgetCustom8SelectType]").type("tr{enter}", {
|
||||
force: true
|
||||
});
|
||||
cy.get('[data-cy="customize:save"] > .v-btn__content > .v-icon').click();
|
||||
cy.go("back");
|
||||
//check customize worked
|
||||
cy.get("[data-cy=serial]").should("not.exist");
|
||||
cy.get("[data-cy=WidgetCustom8]").should("exist");
|
||||
|
||||
//reverse
|
||||
cy.wait(100);
|
||||
cy.get("[data-cy=contextmenu]").click();
|
||||
cy.get('[data-cy="app:customize"]').click();
|
||||
cy.url().should("include", "/customize/Widget");
|
||||
cy.get("[data-cy=SerialVisible]").check({ force: true });
|
||||
cy.get("[data-cy=WidgetCustom8Visible]").uncheck({ force: true });
|
||||
cy.get("[data-cy=WidgetCustom8SelectType]").type("te{enter}", {
|
||||
force: true
|
||||
});
|
||||
cy.get('[data-cy="customize:save"] > .v-btn__content > .v-icon').click();
|
||||
cy.go("back");
|
||||
cy.get("[data-cy=serial]").should("exist");
|
||||
cy.get("[data-cy=WidgetCustom8]").should("not.exist");
|
||||
//-----
|
||||
});
|
||||
});
|
||||
@@ -1,7 +1,7 @@
|
||||
// Basic smoke test, visit every form to ensure they load
|
||||
|
||||
describe("SMOKE", () => {
|
||||
it("About form works for all default languages", () => {
|
||||
it("Every form opens without error", () => {
|
||||
cy.visit("/login");
|
||||
|
||||
cy.get("input[name=username]")
|
||||
|
||||
@@ -14,8 +14,7 @@ describe("TRANSLATION", () => {
|
||||
.clear()
|
||||
.type("fr{enter}");
|
||||
|
||||
// we should be redirected to /dashboard
|
||||
// cy.url().should("include", "/home-dashboard");
|
||||
cy.wait(25);
|
||||
|
||||
//nav to about form
|
||||
cy.get("[data-cy=contextmenu]").click();
|
||||
@@ -34,8 +33,8 @@ describe("TRANSLATION", () => {
|
||||
cy.url().should("include", "/applog");
|
||||
|
||||
//LOGOUT
|
||||
cy.get("[data-cy=contextmenu]").click();
|
||||
cy.get("[data-cy='app:logout']").click();
|
||||
cy.get("[data-cy=navicon]").click();
|
||||
cy.get("[data-cy=logout]").click();
|
||||
cy.url().should("include", "/login");
|
||||
//-----------------------------------------------------
|
||||
//SPANISH
|
||||
@@ -48,8 +47,7 @@ describe("TRANSLATION", () => {
|
||||
.clear()
|
||||
.type("es{enter}");
|
||||
|
||||
// we should be redirected to /dashboard
|
||||
// cy.url().should("include", "/home-dashboard");
|
||||
cy.wait(25);
|
||||
|
||||
//nav to about form
|
||||
cy.get("[data-cy=contextmenu]").click();
|
||||
@@ -62,8 +60,8 @@ describe("TRANSLATION", () => {
|
||||
cy.contains("Navegador");
|
||||
|
||||
//LOGOUT
|
||||
cy.get("[data-cy=contextmenu]").click();
|
||||
cy.get("[data-cy='app:logout']").click();
|
||||
cy.get("[data-cy=navicon]").click();
|
||||
cy.get("[data-cy=logout]").click();
|
||||
cy.url().should("include", "/login");
|
||||
|
||||
//-------------------------
|
||||
@@ -78,8 +76,7 @@ describe("TRANSLATION", () => {
|
||||
.clear()
|
||||
.type("de{enter}");
|
||||
|
||||
// we should be redirected to /dashboard
|
||||
// cy.url().should("include", "/home-dashboard");
|
||||
cy.wait(25);
|
||||
|
||||
//nav to about form
|
||||
cy.get("[data-cy=contextmenu]").click();
|
||||
@@ -92,8 +89,8 @@ describe("TRANSLATION", () => {
|
||||
cy.contains("Registrierter Benutzer");
|
||||
|
||||
//LOGOUT
|
||||
cy.get("[data-cy=contextmenu]").click();
|
||||
cy.get("[data-cy='app:logout']").click();
|
||||
cy.get("[data-cy=navicon]").click();
|
||||
cy.get("[data-cy=logout]").click();
|
||||
cy.url().should("include", "/login");
|
||||
|
||||
//-----------------------------------------------------
|
||||
@@ -121,8 +118,8 @@ describe("TRANSLATION", () => {
|
||||
cy.get("[data-cy='aboutlicensedoptions]").should("not.exist");
|
||||
|
||||
//LOGOUT
|
||||
cy.get("[data-cy=contextmenu]").click();
|
||||
cy.get("[data-cy='app:logout']").click();
|
||||
cy.get("[data-cy=navicon]").click();
|
||||
cy.get("[data-cy=logout]").click();
|
||||
cy.url().should("include", "/login");
|
||||
|
||||
//-----------------------------------------------------
|
||||
|
||||
@@ -42,7 +42,8 @@ describe("WIDGET FORM", () => {
|
||||
cy.contains("Name is a required field").should("not.exist");
|
||||
|
||||
cy.get("[data-cy=count]").type("123");
|
||||
cy.get("[data-cy=dollarAmount]").type("123.45");
|
||||
cy.get("[data-cy=dollarAmount]").type("123.45{enter}");
|
||||
//cy.wait(25);
|
||||
cy.contains("Price is a required field").should("not.exist");
|
||||
|
||||
//start date
|
||||
@@ -89,12 +90,13 @@ describe("WIDGET FORM", () => {
|
||||
cy.get("[data-cy=name]").should("have.value", name);
|
||||
|
||||
//delete the record
|
||||
cy.get("[data-cy=contextmenu]").click();
|
||||
cy.get('[data-cy="widget-edit:delete"]').click();
|
||||
cy.get('[data-cy="gzconfirm:yesbutton"]').click();
|
||||
|
||||
// //LOGOUT
|
||||
// cy.get("[data-cy=contextmenu]").click();
|
||||
// cy.get("[data-cy='app:logout']").click();
|
||||
// cy.url().should("include", "/login");
|
||||
cy.get("[data-cy=navicon]").click();
|
||||
cy.get("[data-cy=logout]").click();
|
||||
cy.url().should("include", "/login");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user