This commit is contained in:
37
ayanova/tests/e2e/specs/search-form.js
Normal file
37
ayanova/tests/e2e/specs/search-form.js
Normal file
@@ -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");
|
||||
|
||||
//-----
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user