Files
raven-client/ayanova/tests/e2e/OLD/gz-data-table.js

93 lines
2.7 KiB
JavaScript

describe("GZ-DATA-TABLE", () => {
it("Operations work", () => {
cy.visit("/login");
cy.get("input[name=username]")
.clear()
.type("BizAdmin");
// {enter} causes the form to submit
cy.get("input[name=password]")
.clear()
.type("BizAdmin{enter}");
//cy.url().should("include", "/home-dashboard");
cy.visit("/customers");
cy.url().should("include", "/customers");
cy.contains("Rows per page");
//select default customer list view
cy.get("[data-cy=selectlistview]").type("-{enter}", { force: true });
//confirm we see the data expected
cy.contains("Name");
cy.contains("Serial #");
cy.contains("Price");
//refresh
cy.get("[data-cy=refresh]").click();
//confirm the first column is the customer name
cy.get("thead > tr > th:nth-child(1) > span").contains("Name");
// cy.get('[aria-label="Next page"] > .v-btn__content > .v-icon').click();
// cy.get(".v-data-footer__select input:nth-child(2)").type("10{enter}", {
// force: true,
// });
// //confirm rows
// cy.get("tbody")
// .find("tr")
// .should("have.length", 10);
cy.get(".v-data-footer__select input:nth-child(2)").type("5{enter}", {
force: true
});
//confirm 5 rows
cy.get("tbody")
.find("tr")
.should("have.length", 5);
//filter
cy.get("[data-cy=filter]").click();
cy.contains("List view");
//move username to first position
cy.get(
'[data-cy="columncard:username"] > .v-card__text > .d-flex > :nth-child(1) > .v-btn__content > [data-cy=movestart]'
).click();
//go back to customerlist
cy.go("back");
//confirm the first column is now the username
cy.get("thead > tr > th:nth-child(1) > span").contains("User");
//switch back to default filter
cy.get("[data-cy=selectlistview]").type("-{enter}{esc}", { force: true });
//open a customer record
cy.wait(100);
cy.get("tbody > :nth-child(1) > :nth-child(1)").click();
//cy.get(":nth-child(1) > :nth-child(1) > .subtitle-1 > a").click();
//confirm on customer edit form
cy.get('[data-cy="customer-edit:delete"]');
//go back to customerlist
cy.go("back");
//new
cy.get("[data-cy='customer-list:new']").click();
cy.url().should("include", "/customers/0");
//cy.get("thead > tr > th:nth-child(1)").contains("User");
// //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.get("[data-cy=navicon]").click();
cy.get("[data-cy=logout]").click();
cy.url().should("include", "/login");
});
});