Bug 33211

Summary: Fix failing test for basic_workflow.t when adding item
Product: Koha Reporter: Nick Clemens <nick>
Component: Architecture, internals, and plumbingAssignee: Bugs List <koha-bugs>
Status: Pushed to oldstable --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: arthur.suzuki, jonathan.druart, lucas, tomascohen, wainuiwitikapark
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
23.05.00,22.11.04,22.05.12,21.11.20
Attachments: Bug 33211: Fix failing test
Bug 33211: Fix failing test

Description Nick Clemens 2023-03-13 14:38:50 UTC
It seems something changed and the selector is no longer findable

STRACE:	/usr/share/perl5/Try/Tiny.pm:123 in Selenium::Remote::Driver::catch {...} 
	/usr/share/perl5/Selenium/Remote/Driver.pm:361 in Try::Tiny::try
	(eval 1840):1 in Selenium::Remote::Driver::__ANON__
	(eval 1842):2 in Selenium::Remote::Driver::__ANON__
	/usr/share/perl5/Selenium/Remote/Driver.pm:1340 in Selenium::Remote::Driver::_execute_command
	/usr/share/perl5/Selenium/Remote/Driver.pm:1340 in (eval)
	t/db_dependent/selenium/basic_workflow.t:207 in Selenium::Remote::Driver::find_element

Error while executing command: no such element: Unable to locate element: //div[@id="subfield952w"]/input[@class="input_marceditor flatpickr-input"] at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.
 at /usr/share/perl5/Selenium/Remote/Driver.pm line 356.
# Looks like your test exited with 255 just after 6.
Dubious, test returned 255 (wstat 65280, 0xff00)
Failed 16/22 subtests 

Test Summary Report
-------------------
t/db_dependent/selenium/basic_workflow.t (Wstat: 65280 Tests: 6 Failed: 0)
  Non-zero exit status: 255
  Parse errors: Bad plan.  You planned 22 tests but ran 6.
Comment 1 Nick Clemens 2023-03-13 14:39:42 UTC
Created attachment 148121 [details] [review]
Bug 33211: Fix failing test

This patch updates the selector to use the full class and find the text
type as well
Comment 2 Tomás Cohen Arazi 2023-03-13 14:42:16 UTC
Created attachment 148122 [details] [review]
Bug 33211: Fix failing test

This patch updates the selector to use the full class and find the text
type as well

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Comment 3 Tomás Cohen Arazi 2023-03-13 14:43:28 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 4 Martin Renvoize 2023-03-14 07:23:51 UTC
Many hands makes light work, thankyou everyone!

Pushed to 22.11.x for the next release
Comment 5 Lucas Gass 2023-04-14 16:51:10 UTC
Backported to 22.05.x for upcoming 22.05.12
Comment 6 Arthur Suzuki 2023-04-20 09:12:12 UTC
applied to 21.11.x for 21.11.20
Comment 7 wainuiwitikapark 2023-04-27 05:58:17 UTC
Not backported to 21.05.x
Comment 8 Jonathan Druart 2023-11-29 10:32:08 UTC
(In reply to Tomás Cohen Arazi from comment #2)
> Created attachment 148122 [details] [review] [review]
> Bug 33211: Fix failing test
> 
> This patch updates the selector to use the full class and find the text
> type as well
> 
> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>

This patch actually makes a test fail under 22.05

A revert fixes the basic_workflow

Error while executing command: no such element: Unable to locate element: //div[@id="subfield952w"]/input[@type="text" and @class="input_marceditor items.replacementpricedate noEnterSubmit flatpickr-input"] at /usr/share/perl5/Selenium/Remote/Driver.pm line 411.
Comment 9 Jonathan Druart 2023-11-29 10:35:19 UTC
Pushed in April... Is this test failing since April??