[Koha-bugs] [Bug 34076] [ALTERNATE] [DOCS] Automated screenshots using Cypress.io testing framework

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Dec 29 15:19:54 CET 2023


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=34076

--- Comment #32 from Philip Orr <philip.orr at lmscloud.de> ---
so, I did 10 random easy screenshots from the spreadsheet. It all worked. Here
is the code:
(Please tell me if I should add this as an attachment instead of as a comment!)

Screenshot for: About -> perl modules
´´´
describe("Libraries", function () {
    beforeEach(() => {
        cy.login();
        cy.set_cookie_lang();
    });

    /* ==== Test Created with Cypress Studio ==== */
    it('aboutperlmodules', function() {
        /* ==== Generated with Cypress Studio ==== */
        cy.get(':nth-child(2) > .biglinks-list > :nth-child(7) >
.icon_general').click();
        cy.get('#perl-tab > span').click();
       
cy.get('.tab-content').should('be.visible').screenshot("aboutperlmodules");
        /* ==== End Cypress Studio ==== */
    });
});
```

Screenshot for: Acquisitions -> Add Basket
´´´
describe("Libraries", function () {
    beforeEach(() => {
        cy.login();
        cy.set_cookie_lang();
    });

    /* ==== Test Created with Cypress Studio ==== */
    it('addbasket', function() {
        /* ==== Generated with Cypress Studio ==== */
        cy.get(':nth-child(2) > .biglinks-list > :nth-child(3) >
.icon_general').click();
        cy.get('p > .btn').click();
        cy.get('.btn > .caret').click();
        cy.get('.open > .dropdown-menu > :nth-child(1) > a').click();
        cy.get('.col-md-10').should('be.visible').screenshot("addbasket");
        /* ==== End Cypress Studio ==== */
    });
});
```

Screenshot for New Vendor -> Interfaces
´´´
describe("Libraries", function () {
    beforeEach(() => {
        cy.login();
        cy.set_cookie_lang();
    });

    /* ==== Test Created with Cypress Studio ==== */
    it('newvendor-interfaces', function() {
        /* ==== Generated with Cypress Studio ==== */
        cy.get(':nth-child(2) > .biglinks-list > :nth-child(3) >
.icon_general').click();
        cy.get('.btn-group > .btn').click();
        cy.get('#interfaces > .btn').click();
       
cy.get('#interfaces').should('be.visible').screenshot("newvendor-interfaces");
        /* ==== End Cypress Studio ==== */
    });
});
```

Screenshot for Acquisitions -> Currencies
´´´
describe("Libraries", function () {
    beforeEach(() => {
        cy.login();
        cy.set_cookie_lang();
    });

    /* ==== Test Created with Cypress Studio ==== */
    it('currencies', function() {
        /* ==== Generated with Cypress Studio ==== */
        cy.get(':nth-child(2) > .biglinks-list > :nth-child(3) >
.icon_general').click();
        cy.get(':nth-child(6) > :nth-child(3) > a').click();
        cy.get('.page-section').should('be.visible').screenshot("currencies");
        /* ==== End Cypress Studio ==== */
    });
});
```

Screenshot for Administration -> Z39.50/SRU Servers -> New Z39.50 Server
´´´
describe("Libraries", function () {
    beforeEach(() => {
        cy.login();
        cy.set_cookie_lang();
    });

    /* ==== Test Created with Cypress Studio ==== */
    it('newz39', function() {
        /* ==== Generated with Cypress Studio ==== */
        cy.get(':nth-child(2) > .biglinks-list > :nth-child(6) >
.icon_general').click();
        cy.get(':nth-child(2) > :nth-child(6) > :nth-child(3) > a').click();
       
cy.get('[href="/cgi-bin/koha/admin/z3950servers.pl?op=add&type=zed"]').click();
        cy.get('.rows').should('be.visible').screenshot("newz39");
        /* ==== End Cypress Studio ==== */
    });
});
```

Screenshot for Administration -> Debit Types -> Show all debit types
´´´
describe("Libraries", function () {
    beforeEach(() => {
        cy.login();
        cy.set_cookie_lang();
    });

    /* ==== Test Created with Cypress Studio ==== */
    it('alldebittypes', function() {
        /* ==== Generated with Cypress Studio ==== */
        cy.get(':nth-child(2) > .biglinks-list > :nth-child(6) >
.icon_general').click();
        cy.get(':nth-child(8) > :nth-child(1) > a').click();
        cy.get('#filter_system').click();
       
cy.get('#table_debit_types_wrapper').should('be.visible').screenshot("alldebittypes");
        /* ==== End Cypress Studio ==== */
    });
});
```

Screenshot for Administration -> Credit Types -> Show all credit types
´´´
describe("Libraries", function () {
    beforeEach(() => {
        cy.login();
        cy.set_cookie_lang();
    });

    /* ==== Test Created with Cypress Studio ==== */
    it('allcredittypes', function() {
        /* ==== Generated with Cypress Studio ==== */
        cy.get(':nth-child(2) > .biglinks-list > :nth-child(6) >
.icon_general').click();
        cy.get(':nth-child(8) > :nth-child(3) > a').click();
        cy.get('#filter_system').click();
        cy.get('.page-section').should('be.visible').screenshot("credittypes");
        /* ==== End Cypress Studio ==== */
    });
});
```

Screenshot for Acquisitions -> Budgets -> Close Budget (without unreceived
orders)
´´´
describe("Libraries", function () {
    beforeEach(() => {
        cy.login();
        cy.set_cookie_lang();
    });

    /* ==== Test Created with Cypress Studio ==== */
    it('nounreceivedorders', function() {
        /* ==== Generated with Cypress Studio ==== */
        cy.get(':nth-child(2) > .biglinks-list > :nth-child(3) >
.icon_general').click();
        cy.get(':nth-child(6) > :nth-child(1) > a').click();
        cy.get('#budgetmenu_1').click();
        cy.get('.btn-group > .dropdown-menu > :nth-child(4) > a').click();
       
cy.get('.col-sm-10').should('be.visible').screenshot("nounreceivedorders");
        /* ==== End Cypress Studio ==== */
    });
});
```

Screenshot for Acquisitions -> Budgets -> Main Budget -> Planning -> Months ->
Export CSV
´´´
describe("Libraries", function () {
    beforeEach(() => {
        cy.login();
        cy.set_cookie_lang();
    });

    /* ==== Test Created with Cypress Studio ==== */
    it('planningcsv', function() {
        /* ==== Generated with Cypress Studio ==== */
        cy.get(':nth-child(2) > .biglinks-list > :nth-child(3) >
.icon_general').click();
        cy.get(':nth-child(6) > :nth-child(1) > a').click();
        cy.get('.sorting_1 > a').click();
        cy.get(':nth-child(3) > .btn').click();
        cy.get('.open > .dropdown-menu > :nth-child(1) > a').click();
        cy.get('.col-sm-2 > aside:nth-child(1) >
form:nth-child(2)').should('be.visible').screenshot("planningcsv");
        /* ==== End Cypress Studio ==== */
    });
});
```
Note: the button "Submit" doesn't show up for some reason, even though it
should
be part of the form I selected.

Screenshot for Acquisitions -> Vendors -> My Vendor -> New Contract Form
´´´
describe("Libraries", function () {
    beforeEach(() => {
        cy.login();
        cy.set_cookie_lang();
    });

    /* ==== Test Created with Cypress Studio ==== */
    it('newcontractform', function() {
        /* ==== Generated with Cypress Studio ==== */
        cy.get(':nth-child(2) > .biglinks-list > :nth-child(3) >
.icon_general').click();
        cy.get('p > .btn').click();
        cy.get('.suppliername > :nth-child(1)').click();
        cy.get(':nth-child(1) > .btn').click();
        cy.get('.open > .dropdown-menu > :nth-child(2) > a').click();
       
cy.get('.page-section').should('be.visible').screenshot("newcontractform");
        /* ==== End Cypress Studio ==== */
    });
});
```

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list