' WHERE variable = 'IntranetNav'")
cy.login();
/* No specific padding defined */
cy.set_cookie_lang(lang);
});
it("IntranetNav", function () {
cy.visit("/cgi-bin/koha/mainpage.pl");
cy.waitForPageLoad();
cy.get(".navbar").should('be.visible').screenshot("IntranetNav");
});
});
});
afterEach(function () {
cy.query("UPDATE systempreferences SET value = '' WHERE variable = 'IntranetNav'")
Cypress.env('PADDING_BEFORE_SCREENSHOT', undefined);
// Set EN_TEST_FAILED if the 'en' test failed
if (this.currentTest.parent.title.includes('in en') && this.currentTest.state === 'failed') {
Cypress.env("EN_TEST_FAILED", true);
}
});
});
Spec data
Page
mainpage.pl
Interface
staff
Element selector
.navbar
Missing selector
Y
setup
sql UPDATE systempreferences SET value = '<li class="nav-item"><a class="nav-link" href="http://localhost:8080/" target="_blank">OPAC</a></li><li class="nav-item"><a class="nav-link" href="https://example.com/" target="_blank">Example</a></li>' WHERE variable = 'IntranetNav'
workflow
teardown
sql UPDATE systempreferences SET value = '' WHERE variable = 'IntranetNav'
CypressError: `cy.screenshot()` only works for a single element. You attempted to screenshot 2 elements.
https://on.cypress.io/screenshot
at screenshot (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:134836:70)
at originalFn (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:111055:30)
at overridden.fn (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:111060:21)
at wrapped (http://kohadev-intra.mydnsname.org:8081/__cypress/runner/cypress_runner.js:138387:19)
From Your Spec Code:
at Context.eval (webpack://koha/./cypress/integration/admin/globalprefs/IntranetNav.ts:19:55)