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

(-)a/cypress.config.ts (-4 / +5 lines)
Lines 15-23 export default defineConfig({ Link Here
15
        baseUrl: "http://localhost:8081",
15
        baseUrl: "http://localhost:8081",
16
        specPattern: "t/cypress/integration/**/*.*",
16
        specPattern: "t/cypress/integration/**/*.*",
17
        supportFile: "t/cypress/support/e2e.js",
17
        supportFile: "t/cypress/support/e2e.js",
18
    },
18
        env: {
19
    env: {
19
            opacBaseUrl: process.env.KOHA_OPAC_URL || "http://localhost:8080",
20
        apiUsername: "koha",
20
            apiUsername: "koha",
21
        apiPassword: "koha",
21
            apiPassword: "koha",
22
        },
22
    },
23
    },
23
});
24
});
(-)a/t/cypress/support/e2e.js (-1 / +19 lines)
Lines 32-37 function get_fallback_login_value(param) { Link Here
32
        : Cypress.env(env_var);
32
        : Cypress.env(env_var);
33
}
33
}
34
34
35
Cypress.Commands.add("visitOpac", path => {
36
    cy.visit(Cypress.env("opacBaseUrl") + path);
37
});
38
35
Cypress.Commands.add("login", (username, password) => {
39
Cypress.Commands.add("login", (username, password) => {
36
    var user =
40
    var user =
37
        typeof username === "undefined"
41
        typeof username === "undefined"
Lines 47-52 Cypress.Commands.add("login", (username, password) => { Link Here
47
    cy.get("#submit-button").click();
51
    cy.get("#submit-button").click();
48
});
52
});
49
53
54
Cypress.Commands.add("loginOpac", (username, password) => {
55
    var user =
56
        typeof username === "undefined"
57
            ? get_fallback_login_value("username")
58
            : username;
59
    var pass =
60
        typeof password === "undefined"
61
            ? get_fallback_login_value("password")
62
            : password;
63
    cy.visitOpac("/cgi-bin/koha/opac-main.pl?logout.x=1");
64
    cy.get("#userid").type(user);
65
    cy.get("#password").type(pass);
66
    cy.get("#auth .action").contains("Log in").click();
67
});
68
50
Cypress.Commands.add("left_menu_active_item_is", label => {
69
Cypress.Commands.add("left_menu_active_item_is", label => {
51
    cy.get(".sidebar_menu a.current:not(.disabled)")
70
    cy.get(".sidebar_menu a.current:not(.disabled)")
52
        .should("have.length", 1)
71
        .should("have.length", 1)
53
- 

Return to bug 40346