From df7784610f7aa6d125eec661425367f9fc10a90b Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Thu, 9 Apr 2020 20:46:26 +0000 Subject: [PATCH] --- ayanova/tests/e2e/specs/search-form.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ayanova/tests/e2e/specs/search-form.js b/ayanova/tests/e2e/specs/search-form.js index 0029a73f..1fc7fb4c 100644 --- a/ayanova/tests/e2e/specs/search-form.js +++ b/ayanova/tests/e2e/specs/search-form.js @@ -29,8 +29,27 @@ describe("SEARCH", () => { 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"); + //get the text in the subtitle + + //save the start url for later + let sub = null; + //funcs are async so need to get result via then + + // cy.url().then(url => { + // startUrl = url; + // }); + + cy.get("[data-cy=btnopenitem1] > .v-list-item__title") + .invoke("text") + .then((t) => { + sub = t; + //nave to first result form + cy.get("[data-cy=btnopenitem1]").click(); + cy.url().should("include", "/widget"); + //name field should contain whatever was shown in search results list + cy.contains(sub).should("exist"); + }); //----- });