This patch introduces: -PageObject base class and example tests, -a interactive debug script to drive PageObjects more easily. ------------------ PageObjects are used to make robust and reusable integration test components to test various front-end features. PageObjects load a Selenium::Remote::Driver implementation, phantomjs by default and use this to do scripted user actions in the browser, eg. clicking HTML-elements, accepting popup dialogs, entering text to input fields. PageObjects encapsulate those very low-level operations into clear and easily usable actions or services, like doPasswordLogin(). PageObjects also seamlessly deal with navigation from one page to another, eg. my $mainpage = t::lib::Page::Mainpage->new(); $mainpage->doPasswordLogin('admin', '1234')->gotoPatrons()-> searchPatrons({keywordSearch => "Jane Doe"}); PageObjects make doing integration tests so great! You can google for the specifics of PageObject patterns and there are a ton of great tutorials explaining their function. --------------------- Interactive debugger at misc/devel/interactiveWebDriverShell.pl loads the desired PageObject with the needed parameters to the debugger context and makes dynamic UserAgent scripting easy and fun!
Created attachment 41023 [details] [review] Bug 14536 - PageObject-pattern base implementation
Created attachment 41052 [details] [review] Bug 14536 - PageObject-pattern base implementation This patch introduces: -PageObject base class and example tests, -a interactive debug script to drive PageObjects more easily. ------------------ PageObjects are used to make robust and reusable integration test components to test various front-end features. PageObjects load a Selenium::Remote::Driver implementation, phantomjs by default and use this to do scripted user actions in the browser, eg. clicking HTML-elements, accepting popup dialogs, entering text to input fields. PageObjects encapsulate those very low-level operations into clear and easily usable actions or services, like doPasswordLogin(). PageObjects also seamlessly deal with navigation from one page to another, eg. my $mainpage = t::lib::Page::Mainpage->new(); $mainpage->doPasswordLogin('admin', '1234')->gotoPatrons()-> searchPatrons({keywordSearch => "Jane Doe"}); PageObjects make doing integration tests so great! You can google for the specifics of PageObject patterns and there are a ton of great tutorials explaining their function. Now PageObjects also have a debugging system where you can get the server response in a title+cookies+html-dump and a screenshot of the browser session. see t::lib::Page for more info! --------------------- Interactive debugger at misc/devel/interactiveWebDriverShell.pl loads the desired PageObject with the needed parameters to the debugger context and makes dynamic UserAgent scripting easy and fun!
Created attachment 41057 [details] PageObject-pattern schematic and usage example sketch
Created attachment 41121 [details] [review] Bug 14536 - PageObject-pattern base implementation
Created attachment 41156 [details] [review] Bug 14536 - PageObject-pattern base implementation
Created attachment 41254 [details] [review] Bug 14536 - PageObject-pattern base implementation
Created attachment 41460 [details] [review] Bug 14536: (follow-up) Add Memberentry PageObject and navigations This follow-up adds Memberentry PageObject and adds navigations to memberentry page.
Created attachment 41524 [details] [review] Bug 14536: (follow-up) Add OpacMessaging, Circulation and LeftNavigation for Members/Circulation pages in Staff Client
Created attachment 41525 [details] [review] Bug 14536: (follow-up) Add more functionalty for handling messaging preferences - Fixes memberentry form submit to return Circulation PageObject. - Prevents missing element errors at different steps of memberentry page. Patron modification has multiple different steps (full edit, information edit, sms number edit, library use edit, alternate address edit, alternative contact edit). Some of the input fields required for validation are not always present in each step of these modifications. - Adds functionality to check checkboxes and validate if they are checked or not - Adds navigation to moremember edit links. - Adds navigation to opac-messaging
Created attachment 41534 [details] [review] Bug 14536 - PageObject-pattern base implementation
Created attachment 41678 [details] [review] Bug 14536: (follow-up) Adds polling to Page.pm and enhances navigation. This follow-up adds a subroutine poll to superclass Page.pm. Polling will execute an anonymous subroutine for as long as defined or until the subroutine is successful. Also adds enchancements to navigation success confirmations. In earlier versions, the modify patron page (memberentry.pl) defines page title as follows: Modify <category> patron <name> But in current version it is defined as follows: Modify patron <name> (<category>) Instead of checking for title "Modify patron", we now check for "Modify(.*)patron" for determining if we are on the right memberentry.pl page.
Created attachment 42060 [details] [review] Bug 14536: (follow-up) Add PageObject for members/notices.pl This patch adds a new PageObject Notices for members/notices.pl page.
Created attachment 42111 [details] [review] Bug 14536 - PageObject squashable
Created attachment 42118 [details] [review] Bug 14536: (follow-up) Add PageObject for members/notices.pl
Created attachment 42136 [details] [review] Bug 14536 - PageObject squashable
Patch complexity is 'Large' because this change has many architectural connections
Created attachment 42160 [details] [review] Bug 14536: (follow-up) Add PageObject for members/notices.pl Forgot to call polling in navigateToNotices at LeftNavigation.pm. Here is a fix for it.
Created attachment 42433 [details] [review] Bug 14536 - PageObject squashable
Created attachment 42435 [details] [review] Bug 14536 - PageObject squashable
Created attachment 42716 [details] [review] Bug 14536: (follow-up) Add PageObject for members/notices.pl Adds subroutines for opening and resending messages in Patron's Notices table.
Created attachment 44410 [details] [review] Bug 14536 - PageObject squashable - Waitingreserves
Created attachment 47254 [details] [review] Bug 14536 (follow-up) - New PageObjects for handling Fines Adds PageObjects that can handle the Fines tab.
Please provide a test plan so someone can test this.
Created attachment 63245 [details] [review] Bug 14536 - PageObject-pattern base implementation This patch introduces: -PageObject base classes for OPAC and Intra, and example tests. More example tests in Buugg 14540, where setting test context is easier. -a interactive debug script to drive PageObjects more easily. ------------------ PageObjects are used to make robust and reusable integration test components to test various front-end features. PageObjects load a Selenium::Remote::Driver implementation, phantomjs by default and use this to do scripted user actions in the browser, eg. clicking HTML-elements, accepting popup dialogs, entering text to input fields. PageObjects encapsulate those very low-level operations into clear and easily usable actions or services, like doPasswordLogin(). PageObjects also seamlessly deal with navigation from one page to another, eg. my $mainpage = t::lib::Page::Mainpage->new(); $mainpage->doPasswordLogin('admin', '1234')->gotoPatrons()-> searchPatrons({keywordSearch => "Jane Doe"}); PageObjects make doing integration tests so great! You can google for the specifics of PageObject patterns and there are a ton of great tutorials explaining their function. Now PageObjects also have a debugging system where you can get the server response in a title+cookies+html-dump and a screenshot of the browser session. see t::lib::Page for more info! --------------------- Interactive debugger at misc/devel/interactiveWebDriverShell.pl loads the desired PageObject with the needed parameters to the debugger context and makes dynamic UserAgent scripting easy and fun! --------------------- Bug 14536: (follow-up) Adds polling to Page.pm and enhances navigation. This follow-up adds a subroutine poll to superclass Page.pm. Polling will execute an anonymous subroutine for as long as defined or until the subroutine is successful. ---------------------
Squashed follow-ups into main patch, rebased on top of master (dependencies Bug 13906 and Bug 14495 still apply).
Complex dependency tree, see here: https://bugs.koha-community.org/bugzilla3/showdependencygraph.cgi?id=14536 Some of the dependencies are failed QA or don't apply. Marking as BLOCKED until dependencies can be resolved.