View | Details | Raw Unified | Return to bug 32898
Collapse All | Expand All

(-)a/t/cypress/integration/Agreements_spec.ts (-1 / +1 lines)
Lines 123-129 describe("Agreement CRUD operations", () => { Link Here
123
    });
123
    });
124
124
125
    beforeEach(() => {
125
    beforeEach(() => {
126
        cy.login("koha", "koha");
126
        cy.login();
127
        cy.title().should("eq", "Koha staff interface");
127
        cy.title().should("eq", "Koha staff interface");
128
    });
128
    });
129
129
(-)a/t/cypress/integration/Licenses_spec.ts (-1 / +1 lines)
Lines 39-45 describe("License CRUD operations", () => { Link Here
39
    });
39
    });
40
40
41
    beforeEach(() => {
41
    beforeEach(() => {
42
        cy.login("koha", "koha");
42
        cy.login();
43
        cy.title().should("eq", "Koha staff interface");
43
        cy.title().should("eq", "Koha staff interface");
44
    });
44
    });
45
45
(-)a/t/cypress/integration/Packages_spec.ts (-1 / +1 lines)
Lines 30-36 describe("Package CRUD operations", () => { Link Here
30
    });
30
    });
31
31
32
    beforeEach(() => {
32
    beforeEach(() => {
33
        cy.login("koha", "koha");
33
        cy.login();
34
        cy.title().should("eq", "Koha staff interface");
34
        cy.title().should("eq", "Koha staff interface");
35
    });
35
    });
36
36
(-)a/t/cypress/integration/Titles_spec.ts (-1 / +1 lines)
Lines 73-79 describe("Title CRUD operations", () => { Link Here
73
    });
73
    });
74
74
75
    beforeEach(() => {
75
    beforeEach(() => {
76
        cy.login("koha", "koha");
76
        cy.login();
77
        cy.title().should("eq", "Koha staff interface");
77
        cy.title().should("eq", "Koha staff interface");
78
    });
78
    });
79
79
(-)a/t/cypress/support/commands.js (-5 / +12 lines)
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
function get_fallback_login_value(param) {
28
29
    var env_var = param == 'username' ? 'KOHA_USER' : 'KOHA_PASS';
30
31
    return typeof Cypress.env(env_var) === 'undefined' ? 'koha' : Cypress.env(env_var);
32
}
27
33
28
Cypress.Commands.add('login', (username, password) => {
34
Cypress.Commands.add('login', (username, password) => {
35
    var user = typeof username === 'undefined' ? get_fallback_login_value('username') : username;
36
    var pass = typeof password === 'undefined' ? get_fallback_login_value('password') : password;
29
    cy.visit('/cgi-bin/koha/mainpage.pl?logout.x=1')
37
    cy.visit('/cgi-bin/koha/mainpage.pl?logout.x=1')
30
    cy.get("#userid").type(username)
38
    cy.get("#userid").type(user)
31
    cy.get("#password").type(password)
39
    cy.get("#password").type(pass)
32
    cy.get("#submit-button").click()
40
    cy.get("#submit-button").click()
33
})
41
})
34
42
Lines 49-55 Cypress.Commands.add('set_ERM_sys_pref_value', (enable) => { Link Here
49
})
57
})
50
58
51
Cypress.Commands.add('fetch_initial_ERM_sys_pref_value', () => {
59
Cypress.Commands.add('fetch_initial_ERM_sys_pref_value', () => {
52
    cy.login("koha", "koha");
60
    cy.login();
53
    cy.visit('/cgi-bin/koha/admin/admin-home.pl')
61
    cy.visit('/cgi-bin/koha/admin/admin-home.pl')
54
    cy.get("h4").contains("Global system preferences").click();
62
    cy.get("h4").contains("Global system preferences").click();
55
    cy.get("a[title^=E-resource]").contains("E-resource management").click();
63
    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
})
67
})
60
68
61
Cypress.Commands.add('reset_initial_ERM_sys_pref_value', () => {
69
Cypress.Commands.add('reset_initial_ERM_sys_pref_value', () => {
62
    cy.login("koha", "koha");
70
    cy.login();
63
    cy.set_ERM_sys_pref_value(Cypress.env("initial_ERM_Module_sys_pref_value"));
71
    cy.set_ERM_sys_pref_value(Cypress.env("initial_ERM_Module_sys_pref_value"));
64
})
72
})
65
- 

Return to bug 32898