Lines 24-34
Link Here
|
24 |
// -- This will overwrite an existing command -- |
24 |
// -- This will overwrite an existing command -- |
25 |
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) |
25 |
// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) |
26 |
|
26 |
|
27 |
|
|
|
28 |
Cypress.Commands.add('login', (username, password) => { |
27 |
Cypress.Commands.add('login', (username, password) => { |
|
|
28 |
var user = typeof username === 'undefined' ? Cypress.env('KOHA_USER') : username; |
29 |
var pass = typeof password === 'undefined' ? Cypress.env('KOHA_PASS') : password; |
29 |
cy.visit('/cgi-bin/koha/mainpage.pl?logout.x=1') |
30 |
cy.visit('/cgi-bin/koha/mainpage.pl?logout.x=1') |
30 |
cy.get("#userid").type(username) |
31 |
cy.get("#userid").type(user) |
31 |
cy.get("#password").type(password) |
32 |
cy.get("#password").type(pass) |
32 |
cy.get("#submit-button").click() |
33 |
cy.get("#submit-button").click() |
33 |
}) |
34 |
}) |
34 |
|
35 |
|
Lines 49-55
Cypress.Commands.add('set_ERM_sys_pref_value', (enable) => {
Link Here
|
49 |
}) |
50 |
}) |
50 |
|
51 |
|
51 |
Cypress.Commands.add('fetch_initial_ERM_sys_pref_value', () => { |
52 |
Cypress.Commands.add('fetch_initial_ERM_sys_pref_value', () => { |
52 |
cy.login("koha", "koha"); |
53 |
cy.login(); |
53 |
cy.visit('/cgi-bin/koha/admin/admin-home.pl') |
54 |
cy.visit('/cgi-bin/koha/admin/admin-home.pl') |
54 |
cy.get("h4").contains("Global system preferences").click(); |
55 |
cy.get("h4").contains("Global system preferences").click(); |
55 |
cy.get("a[title^=E-resource]").contains("E-resource management").click(); |
56 |
cy.get("a[title^=E-resource]").contains("E-resource management").click(); |
Lines 59-64
Cypress.Commands.add('fetch_initial_ERM_sys_pref_value', () => {
Link Here
|
59 |
}) |
60 |
}) |
60 |
|
61 |
|
61 |
Cypress.Commands.add('reset_initial_ERM_sys_pref_value', () => { |
62 |
Cypress.Commands.add('reset_initial_ERM_sys_pref_value', () => { |
62 |
cy.login("koha", "koha"); |
63 |
cy.login(); |
63 |
cy.set_ERM_sys_pref_value(Cypress.env("initial_ERM_Module_sys_pref_value")); |
64 |
cy.set_ERM_sys_pref_value(Cypress.env("initial_ERM_Module_sys_pref_value")); |
64 |
}) |
65 |
}) |
65 |
- |
|
|