Bug 14536 - PageObject-pattern base implementation
Summary: PageObject-pattern base implementation
Status: BLOCKED
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Olli-Antti Kivilahti
QA Contact: Testopia
URL:
Keywords:
Depends on: 14495 13906
Blocks: 10744 14540 14719
  Show dependency treegraph
 
Reported: 2015-07-16 12:02 UTC by Olli-Antti Kivilahti
Modified: 2021-03-04 17:53 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Large patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 14536 - PageObject-pattern base implementation (17.48 KB, patch)
2015-07-16 12:47 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 14536 - PageObject-pattern base implementation (21.53 KB, patch)
2015-07-17 08:35 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
PageObject-pattern schematic and usage example sketch (180.00 KB, image/jpeg)
2015-07-17 09:49 UTC, Olli-Antti Kivilahti
Details
Bug 14536 - PageObject-pattern base implementation (31.75 KB, patch)
2015-07-22 11:24 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 14536 - PageObject-pattern base implementation (31.75 KB, patch)
2015-07-24 14:03 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 14536 - PageObject-pattern base implementation (61.38 KB, patch)
2015-07-31 10:34 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 14536: (follow-up) Add Memberentry PageObject and navigations (12.64 KB, patch)
2015-08-12 12:15 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 14536: (follow-up) Add OpacMessaging, Circulation and LeftNavigation for Members/Circulation pages in Staff Client (10.85 KB, patch)
2015-08-17 07:35 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 14536: (follow-up) Add more functionalty for handling messaging preferences (16.94 KB, patch)
2015-08-17 07:57 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 14536 - PageObject-pattern base implementation (132.30 KB, patch)
2015-08-17 12:00 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 14536: (follow-up) Adds polling to Page.pm and enhances navigation. (5.50 KB, patch)
2015-08-19 14:30 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 14536: (follow-up) Add PageObject for members/notices.pl (5.10 KB, patch)
2015-08-28 10:56 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 14536 - PageObject squashable (1.57 KB, patch)
2015-08-31 11:05 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 14536: (follow-up) Add PageObject for members/notices.pl (6.13 KB, patch)
2015-08-31 13:15 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 14536 - PageObject squashable (5.41 KB, patch)
2015-09-01 08:00 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 14536: (follow-up) Add PageObject for members/notices.pl (6.18 KB, patch)
2015-09-01 14:18 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 14536 - PageObject squashable (3.07 KB, patch)
2015-09-07 15:16 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 14536 - PageObject squashable (3.03 KB, patch)
2015-09-07 15:28 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 14536: (follow-up) Add PageObject for members/notices.pl (7.21 KB, patch)
2015-09-21 10:44 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 14536 - PageObject squashable - Waitingreserves (19.29 KB, patch)
2015-11-04 15:16 UTC, Olli-Antti Kivilahti
Details | Diff | Splinter Review
Bug 14536 (follow-up) - New PageObjects for handling Fines (18.07 KB, patch)
2016-01-25 13:52 UTC, Lari Taskula
Details | Diff | Splinter Review
Bug 14536 - PageObject-pattern base implementation (167.80 KB, patch)
2017-05-08 14:58 UTC, Lari Taskula
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Olli-Antti Kivilahti 2015-07-16 12:02:24 UTC
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!
Comment 1 Olli-Antti Kivilahti 2015-07-16 12:47:39 UTC Comment hidden (obsolete)
Comment 2 Olli-Antti Kivilahti 2015-07-17 08:35:17 UTC Comment hidden (obsolete)
Comment 3 Olli-Antti Kivilahti 2015-07-17 09:49:05 UTC
Created attachment 41057 [details]
PageObject-pattern schematic and usage example sketch
Comment 4 Olli-Antti Kivilahti 2015-07-22 11:24:32 UTC Comment hidden (obsolete)
Comment 5 Olli-Antti Kivilahti 2015-07-24 14:03:14 UTC Comment hidden (obsolete)
Comment 6 Olli-Antti Kivilahti 2015-07-31 10:34:09 UTC Comment hidden (obsolete)
Comment 7 Lari Taskula 2015-08-12 12:15:20 UTC Comment hidden (obsolete)
Comment 8 Lari Taskula 2015-08-17 07:35:15 UTC Comment hidden (obsolete)
Comment 9 Lari Taskula 2015-08-17 07:57:56 UTC Comment hidden (obsolete)
Comment 10 Olli-Antti Kivilahti 2015-08-17 12:00:47 UTC
Created attachment 41534 [details] [review]
Bug 14536 - PageObject-pattern base implementation
Comment 11 Lari Taskula 2015-08-19 14:30:31 UTC
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.
Comment 12 Lari Taskula 2015-08-28 10:56:25 UTC Comment hidden (obsolete)
Comment 13 Olli-Antti Kivilahti 2015-08-31 11:05:08 UTC Comment hidden (obsolete)
Comment 14 Lari Taskula 2015-08-31 13:15:57 UTC Comment hidden (obsolete)
Comment 15 Olli-Antti Kivilahti 2015-09-01 08:00:52 UTC Comment hidden (obsolete)
Comment 16 Zeno Tajoli 2015-09-01 08:04:29 UTC
Patch complexity is 'Large' because this change has many architectural connections
Comment 17 Lari Taskula 2015-09-01 14:18:35 UTC Comment hidden (obsolete)
Comment 18 Olli-Antti Kivilahti 2015-09-07 15:16:38 UTC Comment hidden (obsolete)
Comment 19 Olli-Antti Kivilahti 2015-09-07 15:28:40 UTC
Created attachment 42435 [details] [review]
Bug 14536 - PageObject squashable
Comment 20 Lari Taskula 2015-09-21 10:44:12 UTC
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.
Comment 21 Olli-Antti Kivilahti 2015-11-04 15:16:48 UTC
Created attachment 44410 [details] [review]
Bug 14536 - PageObject squashable - Waitingreserves
Comment 22 Lari Taskula 2016-01-25 13:52:47 UTC
Created attachment 47254 [details] [review]
Bug 14536 (follow-up) - New PageObjects for handling Fines

Adds PageObjects that can handle the Fines tab.
Comment 23 Aleisha Amohia 2017-02-02 01:45:27 UTC
Please provide a test plan so someone can test this.
Comment 24 Lari Taskula 2017-05-08 14:58:45 UTC
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.

---------------------
Comment 25 Lari Taskula 2017-05-08 15:00:08 UTC
Squashed follow-ups into main patch, rebased on top of master (dependencies Bug 13906 and Bug 14495 still apply).
Comment 26 Katrin Fischer 2017-10-15 12:24:59 UTC
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.