From 64c70b66cff865fa955eefed86f3e2bd5a2d7a55 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 9 Apr 2020 20:29:30 +0000 Subject: [PATCH] --- ayanova/tests/e2e/specs/search-form.js | 37 ++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ayanova/tests/e2e/specs/search-form.js diff --git a/ayanova/tests/e2e/specs/search-form.js b/ayanova/tests/e2e/specs/search-form.js new file mode 100644 index 00000000..0029a73f --- /dev/null +++ b/ayanova/tests/e2e/specs/search-form.js @@ -0,0 +1,37 @@ +// https://docs.cypress.io/api/introduction/api.html + +describe("SEARCH", () => { + it("Search works properly", () => { + 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}`); + + // we should be redirected to /dashboard + cy.url().should("include", "/home-dashboard"); + + cy.visit("/home-search"); + cy.url().should("include", "/home-search"); + + cy.get("[data-cy=phrase]").type("we{enter}"); + cy.get("[data-cy=btnexcerpt1]").click(); + //note: it doesn';t show in the test but it's there + cy.get("[data-cy=btnopenitem1] > .v-list-item__subtitle").should("exist"); + //check that the cache is working + //nav to about form + cy.get("[data-cy=contextmenu]").click(); + cy.get('[data-cy="app:nav:abt"]').click(); + cy.url().should("include", "/about"); + cy.go("back"); + + cy.get("[data-cy=btnopenitem1] > .v-list-item__subtitle").should("exist"); + + //----- + }); +});