Lines 35-41
Cypress.Commands.add('login', (username, password) => {
Link Here
|
35 |
Cypress.Commands.add('set_ERM_sys_pref_value', (enable) => { |
35 |
Cypress.Commands.add('set_ERM_sys_pref_value', (enable) => { |
36 |
cy.visit('/cgi-bin/koha/admin/admin-home.pl') |
36 |
cy.visit('/cgi-bin/koha/admin/admin-home.pl') |
37 |
cy.get("h4").contains("Global system preferences").click(); |
37 |
cy.get("h4").contains("Global system preferences").click(); |
38 |
cy.get("a[title^=E-Resource]").contains("E-Resource management").click(); |
38 |
cy.get("a[title^=E-resource]").contains("E-resource management").click(); |
39 |
cy.get('#pref_ERMModule').then(($select) => { |
39 |
cy.get('#pref_ERMModule').then(($select) => { |
40 |
// Only enable if currently disabled, or only disable if currently enabled |
40 |
// Only enable if currently disabled, or only disable if currently enabled |
41 |
let sys_pref_value = $select.find(":selected").text().trim(); |
41 |
let sys_pref_value = $select.find(":selected").text().trim(); |
Lines 52-58
Cypress.Commands.add('fetch_initial_ERM_sys_pref_value', () => {
Link Here
|
52 |
cy.login("koha", "koha"); |
52 |
cy.login("koha", "koha"); |
53 |
cy.visit('/cgi-bin/koha/admin/admin-home.pl') |
53 |
cy.visit('/cgi-bin/koha/admin/admin-home.pl') |
54 |
cy.get("h4").contains("Global system preferences").click(); |
54 |
cy.get("h4").contains("Global system preferences").click(); |
55 |
cy.get("a[title^=E-Resource]").contains("E-Resource management").click(); |
55 |
cy.get("a[title^=E-resource]").contains("E-resource management").click(); |
56 |
cy.get('#pref_ERMModule').then(($select) => { |
56 |
cy.get('#pref_ERMModule').then(($select) => { |
57 |
Cypress.env('initial_ERM_Module_sys_pref_value', $select.find(":selected").text().trim() == 'Enable'); |
57 |
Cypress.env('initial_ERM_Module_sys_pref_value', $select.find(":selected").text().trim() == 'Enable'); |
58 |
}) |
58 |
}) |
59 |
- |
|
|