Bugzilla – Attachment 176088 Details for
Bug 38461
Table features needs to be covered by e2e tests using Cypress
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38461: Shareable link
Bug-38461-Shareable-link.patch (text/plain), 4.71 KB, created by
Martin Renvoize (ashimema)
on 2025-01-02 16:18:56 UTC
(
hide
)
Description:
Bug 38461: Shareable link
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-01-02 16:18:56 UTC
Size:
4.71 KB
patch
obsolete
>From e551388cb6fd3b0764aa9c25b8c582db2bc4463b Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 27 Nov 2024 15:16:37 +0100 >Subject: [PATCH] Bug 38461: Shareable link > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/cypress/integration/KohaTable_spec.ts | 92 +++++++++++++++++++++++++ > 1 file changed, 92 insertions(+) > >diff --git a/t/cypress/integration/KohaTable_spec.ts b/t/cypress/integration/KohaTable_spec.ts >index eef837c0cf9..8b1667a61ee 100644 >--- a/t/cypress/integration/KohaTable_spec.ts >+++ b/t/cypress/integration/KohaTable_spec.ts >@@ -233,6 +233,98 @@ describe("kohaTable (using REST API)", () => { > }); > }); > }); >+ >+ it("Shareable link", { scrollBehavior: false }, () => { >+ build_libraries().then(() => { >+ cy.visit("/cgi-bin/koha/admin/branches.pl"); >+ >+ mock_table_settings({ >+ default_save_state: 1, >+ columns: { library_code: { is_hidden: 1 } }, >+ }); >+ >+ cy.get("@columns").then(columns => { >+ // Code is not shown >+ cy.get(`#${table_id} th`).should( >+ "have.length", >+ columns.length - 1 >+ ); >+ cy.get(`#${table_id} th`).contains("Name"); >+ cy.get(`#${table_id} th`) >+ .contains("Code") >+ .should("not.exist"); >+ cy.get(`#${table_id}_wrapper .buttons-colvis`).click(); >+ // Show Code >+ cy.get(`#${table_id}_wrapper .dt-button-collection`) >+ .contains("Code") >+ .click(); >+ cy.get(`#${table_id} th`).should( >+ "have.length", >+ columns.length >+ ); >+ cy.get(`#${table_id} th`).contains("Name"); >+ cy.get(`#${table_id} th`).contains("Code"); >+ >+ // Close the 'Columns' list >+ cy.get(".dt-button-background").click(); >+ cy.get(".dt-button-background").should("not.exist"); >+ >+ // Copy the shareable link (Name and Code shown) >+ cy.get( >+ `#${table_id}_wrapper .copyConditions_controls` >+ ).click({ force: true }); >+ cy.get(".tooltip").contains("Copied!"); >+ }); >+ >+ cy.window().then(win => { >+ // Retrieve the content of the clipboard >+ win.navigator.clipboard.readText().then(url => { >+ expect(url).to.match( >+ /branches.pl\?DataTables_admin_libraries_libraries_state=/ >+ ); >+ >+ // Remove localStorage >+ win.localStorage.clear(); >+ >+ // Use it >+ cy.visit(url); >+ >+ // Code is shown whereas it is hidden in the config >+ cy.get("@columns").then(columns => { >+ cy.get(`#${table_id} th`).should( >+ "have.length", >+ columns.length >+ ); >+ cy.get(`#${table_id} th`).contains("Name"); >+ cy.get(`#${table_id} th`).contains("Code"); >+ >+ // Hide "Name" >+ cy.get( >+ `#${table_id}_wrapper .buttons-colvis` >+ ).click(); >+ cy.get(`#${table_id}_wrapper .dt-button-collection`) >+ .contains("Name") >+ .click(); >+ }); >+ >+ // Go to the shareable link >+ // but do not remove localStorage! >+ cy.visit(url); >+ >+ // Name is hidden and Code is shown >+ cy.get("@columns").then(columns => { >+ cy.get(`#${table_id} th`).should( >+ "have.length", >+ columns.length >+ ); >+ >+ cy.get(`#${table_id} th`).contains("Name"); >+ cy.get(`#${table_id} th`).contains("Code"); >+ }); >+ }); >+ }); >+ }); >+ }); > }); > > describe("Patrons search", () => { >-- >2.47.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 38461
:
174877
|
174878
|
175004
|
175005
|
175006
|
175007
|
175008
|
175009
|
175010
|
175011
|
175015
|
175016
|
175179
|
175223
|
175224
|
175225
|
175226
|
175227
|
175228
|
175229
|
175230
|
175231
|
175232
|
175233
|
175234
|
175235
|
175289
|
175290
|
175291
|
175292
|
176082
|
176083
|
176084
|
176085
|
176086
|
176087
| 176088 |
176089
|
176090
|
176091
|
176092
|
176093
|
176793
|
176846
|
176902