Bugzilla – Attachment 155120 Details for
Bug 34691
Active link in the menu is not always correctly styled - again
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34691: Add cypress tests
Bug-34691-Add-cypress-tests.patch (text/plain), 6.86 KB, created by
Jonathan Druart
on 2023-09-01 13:41:51 UTC
(
hide
)
Description:
Bug 34691: Add cypress tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2023-09-01 13:41:51 UTC
Size:
6.86 KB
patch
obsolete
>From ca7c2d61c33a8bcab9a3b5c4c2458f9d0ab72917 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Fri, 1 Sep 2023 13:31:23 +0000 >Subject: [PATCH] Bug 34691: Add cypress tests > >Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >--- > t/cypress/integration/ERM/Agreements_spec.ts | 3 +++ > t/cypress/integration/ERM/Licenses_spec.ts | 3 +++ > t/cypress/integration/ERM/Packages_spec.ts | 4 ++++ > t/cypress/integration/ERM/Titles_spec.ts | 4 ++++ > t/cypress/support/index.js | 4 ++++ > 5 files changed, 18 insertions(+) > >diff --git a/t/cypress/integration/ERM/Agreements_spec.ts b/t/cypress/integration/ERM/Agreements_spec.ts >index 83080dae380..811364cb1df 100644 >--- a/t/cypress/integration/ERM/Agreements_spec.ts >+++ b/t/cypress/integration/ERM/Agreements_spec.ts >@@ -255,6 +255,7 @@ describe("Agreement CRUD operations", () => { > cy.visit("/cgi-bin/koha/erm/agreements"); > cy.contains("New agreement").click(); > cy.get("#agreements_add h2").contains("New agreement"); >+ cy.left_menu_active_item_is("Agreements"); > > // Fill in the form for normal attributes > let agreement = get_agreement(); >@@ -492,6 +493,7 @@ describe("Agreement CRUD operations", () => { > cy.wait("@get-agreement"); > cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet! > cy.get("#agreements_add h2").contains("Edit agreement"); >+ cy.left_menu_active_item_is("Agreements"); > > // Form has been correctly filled in > cy.get("#agreement_name").should("have.value", agreements[0].name); >@@ -579,6 +581,7 @@ describe("Agreement CRUD operations", () => { > cy.get("#agreements_show h2").contains( > "Agreement #" + agreement.agreement_id > ); >+ cy.left_menu_active_item_is("Agreements"); > > // TODO There are more to test here: > // Dates correctly formatted >diff --git a/t/cypress/integration/ERM/Licenses_spec.ts b/t/cypress/integration/ERM/Licenses_spec.ts >index c296091c1cc..96b841d9fa5 100644 >--- a/t/cypress/integration/ERM/Licenses_spec.ts >+++ b/t/cypress/integration/ERM/Licenses_spec.ts >@@ -82,6 +82,7 @@ describe("License CRUD operations", () => { > cy.visit("/cgi-bin/koha/erm/licenses"); > cy.contains("New license").click(); > cy.get("#licenses_add h2").contains("New license"); >+ cy.left_menu_active_item_is("Licenses"); > > // Fill in the form for normal attributes > let license = get_license(); >@@ -169,6 +170,7 @@ describe("License CRUD operations", () => { > cy.wait("@get-license"); > cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet! > cy.get("#licenses_add h2").contains("Edit license"); >+ cy.left_menu_active_item_is("Licenses"); > > // Form has been correctly filled in > cy.get("#license_name").should("have.value", license.name); >@@ -230,6 +232,7 @@ describe("License CRUD operations", () => { > cy.wait("@get-license"); > cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet! > cy.get("#licenses_show h2").contains("License #" + license.license_id); >+ cy.left_menu_active_item_is("Licenses"); > }); > > it("Delete license", () => { >diff --git a/t/cypress/integration/ERM/Packages_spec.ts b/t/cypress/integration/ERM/Packages_spec.ts >index 0c0f73be5ad..360e5628382 100644 >--- a/t/cypress/integration/ERM/Packages_spec.ts >+++ b/t/cypress/integration/ERM/Packages_spec.ts >@@ -86,6 +86,7 @@ describe("Package CRUD operations", () => { > cy.visit("/cgi-bin/koha/erm/eholdings/local/packages"); > cy.contains("New package").click(); > cy.get("#packages_add h2").contains("New package"); >+ cy.left_menu_active_item_is("Packages"); > > // Fill in the form for normal attributes > let erm_package = get_package(); >@@ -171,6 +172,7 @@ describe("Package CRUD operations", () => { > cy.wait("@get-package"); > cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet! > cy.get("#packages_add h2").contains("Edit package"); >+ cy.left_menu_active_item_is("Packages"); > > // Form has been correctly filled in > cy.get("#package_name").should("have.value", erm_package.name); >@@ -232,6 +234,8 @@ describe("Package CRUD operations", () => { > cy.get("#packages_show h2").contains( > "Package #" + erm_package.package_id > ); >+ cy.left_menu_active_item_is("Packages"); >+ > // There are no resources, the table should not be displayed > cy.contains("Titles (0)"); > cy.get("#title_list_result table").should("not.exist"); >diff --git a/t/cypress/integration/ERM/Titles_spec.ts b/t/cypress/integration/ERM/Titles_spec.ts >index 2f1f6c826ab..c85cb647f09 100644 >--- a/t/cypress/integration/ERM/Titles_spec.ts >+++ b/t/cypress/integration/ERM/Titles_spec.ts >@@ -47,6 +47,7 @@ describe("Title CRUD operations", () => { > cy.wait(500); > cy.get("#toolbar a").contains("Import from list").click(); > cy.get("h2").contains("Import from a list"); >+ cy.left_menu_active_item_is("Titles"); > cy.get("#package_list .vs__selected").should("not.exist"); > > // Make sure packages are returned >@@ -127,6 +128,7 @@ describe("Title CRUD operations", () => { > cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet! > cy.contains("New title").click(); > cy.get("#titles_add h2").contains("New title"); >+ cy.left_menu_active_item_is("Titles"); > > // Fill in the form for normal attributes > let erm_title = cy.get_title(); >@@ -249,6 +251,7 @@ describe("Title CRUD operations", () => { > cy.wait("@get-title"); > cy.wait(500); // Cypress is too fast! Vue hasn't populated the form yet! > cy.get("#titles_add h2").contains("Edit title"); >+ cy.left_menu_active_item_is("Titles"); > > // Form has been correctly filled in > cy.get("#title_publication_title").should( >@@ -402,6 +405,7 @@ describe("Title CRUD operations", () => { > cy.get("#eholdings_title_show h2").contains( > "Title #" + erm_title.title_id > ); >+ cy.left_menu_active_item_is("Titles"); > // There are no packages, the table should not be displayed > cy.contains("Packages (0)"); > cy.get("#table#package_list").should("not.exist"); >diff --git a/t/cypress/support/index.js b/t/cypress/support/index.js >index 5ced7d5f029..4040e00547c 100644 >--- a/t/cypress/support/index.js >+++ b/t/cypress/support/index.js >@@ -19,6 +19,10 @@ import './commands'; > // Alternatively you can use CommonJS syntax: > // require('./commands') > >+Cypress.Commands.add('left_menu_active_item_is', (label) => { >+ cy.get("#navmenulist a.current:not(.disabled)").should('have.length',1).contains(label); >+}) >+ > cy.get_title = () => { > return { > access_type: "access type", >-- >2.25.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34691
:
155114
|
155117
|
155118
| 155120 |
155121