Bugzilla – Attachment 182903 Details for
Bug 40046
Remove wait and screenshot from Tools/ManageMarcImport_spec.ts
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40046: (bug 39606 follow-up) Remove waits and screenshots
Bug-40046-bug-39606-follow-up-Remove-waits-and-scr.patch (text/plain), 3.60 KB, created by
Jonathan Druart
on 2025-06-02 10:16:52 UTC
(
hide
)
Description:
Bug 40046: (bug 39606 follow-up) Remove waits and screenshots
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-06-02 10:16:52 UTC
Size:
3.60 KB
patch
obsolete
>From 4c373aa17ab53dc4775b288f38f96f82542aed6a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 23 Apr 2025 11:15:33 +0200 >Subject: [PATCH] Bug 40046: (bug 39606 follow-up) Remove waits and screenshots > >From bug 39606: >""" >Why are you taking screenshots? >The wait statements will certainly cause random failures. > >cy.wait(5000); >cy.wait(2000); > >Notice the following couple of lines: > cy.get("#fileuploadstatus").contains("100%"); > cy.get("legend").contains("Look for existing records in catalog?").should('be.visible'); > >It makes Cypress wait 10s until "100%" appears (ie. the file is updated), then the block with the dropdown lists you are going to interact with to be visible. > >You should almost never use cy.wait. >""" > >Test plan: > yarn cypress run --spec t/cypress/integration/Tools/ManageMarcImport_spec.ts >should still pass >--- > .../Tools/ManageMarcImport_spec.ts | 27 ++++++------------- > 1 file changed, 8 insertions(+), 19 deletions(-) > >diff --git a/t/cypress/integration/Tools/ManageMarcImport_spec.ts b/t/cypress/integration/Tools/ManageMarcImport_spec.ts >index 4141a99ff26..f88ee91731e 100644 >--- a/t/cypress/integration/Tools/ManageMarcImport_spec.ts >+++ b/t/cypress/integration/Tools/ManageMarcImport_spec.ts >@@ -34,23 +34,22 @@ describe("loads the manage MARC import page", () => { > cy.get('button[id="fileuploadbutton"]').click(); > }); > >- //wait after file upload, it can go to quickly here >- cy.wait(2000); >+ cy.get("#fileuploadstatus").contains("100%"); >+ cy.get("legend") >+ .contains("Look for existing records in catalog?") >+ .should("be.visible"); > > //check default values >- cy.get('select[name="matcher"] option:selected').should( >- "have.value", >- "" >- ); >- cy.get('select[name="overlay_action"] option:selected').should( >+ cy.get("select#matcher option:selected").should("have.value", ""); >+ cy.get("select#overlay_action option:selected").should( > "have.value", > "replace" > ); >- cy.get('select[name="nomatch_action"] option:selected').should( >+ cy.get("select#nomatch_action option:selected").should( > "have.value", > "create_new" > ); >- cy.get('select[name="item_action"] option:selected').should( >+ cy.get("select#item_action option:selected").should( > "have.value", > "always_add" > ); >@@ -64,28 +63,18 @@ describe("loads the manage MARC import page", () => { > cy.get("#nomatch_action").select("ignore", { force: true }); > cy.get("#item_action").select("ignore", { force: true }); > >- //remove focus >- //cy.get('#item_action').blur(); >- cy.screenshot("after_selection"); >- > // Now verify all values > cy.get("#matcher").should("have.value", "3"); > cy.get("#overlay_action").should("have.value", "create_new"); > cy.get("#nomatch_action").should("have.value", "ignore"); > cy.get("#item_action").should("have.value", "ignore"); > >- cy.screenshot("right_before_submission"); > cy.get("#mainformsubmit").click(); > > cy.get("#job_callback").should("exist"); > >- //wait for View batch link to load with the batch ID >- cy.wait(5000); >- >- cy.screenshot("after_waiting"); > cy.contains("View batch").click(); > >- cy.wait(2000); > // Now verify all values are retained > cy.get("#new_matcher_id").should("have.value", "3"); > cy.get("#overlay_action").should("have.value", "create_new"); >-- >2.34.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 40046
:
182903
|
182912
|
182921
|
182932
|
183195
|
183196