[Bug 13691] New: Add some selenium scripts
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 Bug ID: 13691 Summary: Add some selenium scripts Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Test Suite Assignee: chris@bigballofwax.co.nz Reporter: jonathan.druart@biblibre.com QA Contact: gmcharlt@gmail.com To catch performance regressions it would be great to have some selenium scripts. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED Assignee|chris@bigballofwax.co.nz |jonathan.druart@biblibre.co | |m -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13690 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 --- Comment #1 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 35797 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35797&action=edit Bug 13691: Add basic selenium script This script has been used to compare 3.16.x and 3.18.x performances on bug 13690. What it does: - Go on the mainpage and process a log in - Create a patron category - Create a patron - Add 3 items - check the 3 items out to the patron - check the 3 items in How to use it? $ wget http://selenium-release.storage.googleapis.com/2.44/selenium-server-standalo... $ vim /etc/apt/sources.list.d/firefox.list deb http://packages.linuxmint.com debian import $ apt-get update $ apt-get install firefox $ sudo apt-get install xvfb $ SELENIUM_PATH=/home/koha/tools/selenium-server-standalone-2.44.0.jar $ Xvfb :1 -screen 0 1024x768x24 2>&1 >/dev/null & $ DISPLAY=:1 java -jar $SELENIUM_PATH perl t/db_dependent/selenium/basic_workflow.t -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |In Discussion --- Comment #2 from Jonathan Druart <jonathan.druart@biblibre.com> --- This is a POC, feedback welcome :) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 --- Comment #3 from Jonathan Druart <jonathan.druart@biblibre.com> --- Created attachment 35798 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=35798&action=edit Bug 13691: Remove existing selenium scripts They are not usable. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 Magnus Enger <magnus@enger.priv.no> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |magnus@enger.priv.no -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 --- Comment #4 from Jonathan Druart <jonathan.druart@biblibre.com> --- If the community thinks that these tests are relevant and useful, I can rewrite them to make them pushable. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #5 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Current integration tests rely on Test::WWW::Mechanize. This option seems more interesting, but we should try to think "what" we want to actually test first. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |olli-antti.kivilahti@jns.fi --- Comment #6 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Check out the Perl Cucumber integration to use as a wrapper for feature documentation and acceptance/integration testing framework. It looks very promising and could be a good candidate as a mandatory testing framework for the new REST-API. https://metacpan.org/pod/Test::BDD::Cucumber::Manual::Integration https://metacpan.org/pod/App::pherkin Oslo is using Ruby, but we could try how the Perl implementation works. However we should consider some test driven mechanism as a mandatory part of getting REST API patches pushed to master. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 koha@akafred.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |koha@akafred.com --- Comment #7 from koha@akafred.com --- I have a feeling that Koha could benefit from having a few tests that exercise the most critical functionality from a user perspective, both as tools to measure performance changes and to automate test of critical user scenarios. These tests should optimally be in the same repo and be versioned along with the Koha code. That way developers could get rapid feedback on the changes they make, and also we would require the tests to pass along with production code changes. However, if this turns out to be to much work for the individual developer, these tests can be in a separate repo and perhaps be maintained by a separate team – as they in theory not break unless we are changing existing user functionality. In reality, however, they will from time to time break from changes the users cannot see, and they will have a certain cost to maintain. They will also need installations of Koha running the versions to test against. My feeling is that one could spend a little effort setting up an infrastructure for this and do some experiments on how this works, with a small number of scenarios. (Oslo Public Library has some experience in using automated browser based testing on Koha, using Cucumber and step definitions in Ruby.) A couple of comments: *** Browser-based testing *** This is about testing a running web application: Examples of tools: * Mechanize: (which already is used a little) - simple - only parses html (it has no understanding of JavaScript, which Koha uses more and more) * Webdriver (in Selenium 2): (which is what Jonathan has created a patch for) - drives actual browsers with JavaScript and all (can be "headless" browser) - you can programatically interact with visible elements like a user - there is currently no *direct* binding in perl, you have to run "selenium server" (which needs java) which in turn drives the browsers (in ruby you do not need this intermediary server) https://github.com/gempesaw/Selenium-Remote-Driver/issues/189 *** Feature based testing / behaviour driven testing / example driven testing *** This is about how your test looks, and in addition to using normal unit test tools, there are tools like Fit/-nesse and Cucumber that lets you write automated tests in a way that is easier for users to understand. (Olli-Antti touched on this.) These tests may or may not be browser-based, but in a web-based application it is more likely that they do than that they don't. *** Acceptance tests *** These are typically tests for a user story / scenario and confirms that a piece of functionality is in place and works. They may be expressed in a tool that is feature-based like the ones mentioned above, and will often drive a browser interface in a web application like Koha. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 Jonathan Druart <jonathan.druart@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=13849 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 --- Comment #8 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- FYI: Just started working on this. https://metacpan.org/pod/Selenium::Remote::Driver no longer needs the stand-alone server !! YAY YAY!!! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 --- Comment #9 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Cannot proceed because generating test users with test permissions has no API in Koha:: or C4:: Looking into the Koha REST API to create one. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14495 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 --- Comment #10 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Hi there! I just added bug 14495 to easily generate all kinds of WebDrivers/Test::Mojo things to do integration tests. This basically creates Selenium::Remote::Drivers based on the given parameters. Looking into implementing a PageObject to test password authentication, but it might be a bit difficult regarding how Koha deals with the authentication. This is to test the Authentication Rewriting at Bug 7174 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 --- Comment #11 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Hi! just drew a schematic to implement a PageObjectPattern-system on. There is a nice code example to make robust UI tests. https://docs.google.com/drawings/d/1k_y1YZi72UFxlVEDpqINT68TGQBEy-f2ZkTGLpMc... -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 --- Comment #12 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Created attachment 40819 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40819&action=edit Bug 13691 - PageObjectPattern implementation. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |http://bugs.koha-community. | |org/bugzilla3/show_bug.cgi? | |id=14536 -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #40819|0 |1 is obsolete| | --- Comment #13 from Olli-Antti Kivilahti <olli-antti.kivilahti@jns.fi> --- Comment on attachment 40819 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=40819 Bug 13691 - PageObjectPattern implementation. Created a separate bug for the PageObject Pattern. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13691 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Discussion |Needs Signoff --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Sending to the Needs Signoff queue. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org