OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Test Infrastructure for PKP projects

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

Test Infrastructure for PKP projects

Postby jerico » Sun Aug 09, 2009 4:03 am

Hi Alec (and others),

I am opening this thread to publicly document the PHPUnit/Selenium prototype that we already discussed over email.

As we agreed, I am going to implement a prototype for the author's submission process, paying special attention to:
- testing file uploads
- testing email responses

I have already developed a test infrastructure for PHPUnit tests which can be seen in my submissions to the Debian Packaging Project which are fully unit tested (see patch attachments in BugZilla's "Debian Packaging" category, especially #4518). Now Selenium web tests need to be integrated with the existing PHPUnit infrastructure.

I'll be using:
- Selenium IDE (Firefox Plugin) as a development environment (but not to run tests!)
- PHPUnit's selenium test integration
- An email abstraction layer together with a mock implementation to test email responses

On first caveat: The Selenium IDE that can be found on Firefox's add-on site is not compatible with FF 3.5. You have to go to http://seleniumhq.org/download/ and download the IDE there.

Florian
jerico
 
Posts: 94
Joined: Sat May 16, 2009 2:45 pm

Re: Test Infrastructure for PKP projects

Postby jerico » Sun Aug 09, 2009 4:57 am

One of the most important points that I mentioned to you already is that we'll have to develop guidelines when to do web tests and (above all) when not.

Compared to UnitTests, maintenance of web tests may be rather costly if you don't do them well. In my experience it is very important that you develop clear and easy to remember guidelines for what should be automated with Selenium and what shouldn't. Imagine you'd have to change your tests whenever you changed a translation string or made some small change in your page design.

IMO what we shouldn't automate:
- texts and translations correct
- images present
- design guidelines compliance
- browser compliance (design)
- anything else that testers and end users will immediately seen anyway
- ...

What we should automate:
- complicated workflows with many branches and conditions
- form fields, especially form field validation
- correct handling of border conditions
- correct display of error messages for error conditions
- browser compliance (workflows, border/error conditions)
- ...
jerico
 
Posts: 94
Joined: Sat May 16, 2009 2:45 pm

Re: Test Infrastructure for PKP projects

Postby jerico » Sun Aug 09, 2009 5:03 am

Here come the links to the websites that describe workarounds for file uploads in Selenium. There may be some "recommended solution" from the Selenium project by now, though. I think elevating JS browser permissions would be the right way to go. I'll check that.

http://www.brokenbuild.com/blog/2007/06 ... nd-profit/
http://cakebaker.wordpress.com/2006/03/ ... -selenium/

Here is the link to the PHPUnit manual that describes the Selenium integration I'll use:

http://www.phpunit.de/manual/3.3/en/selenium.html
jerico
 
Posts: 94
Joined: Sat May 16, 2009 2:45 pm

Re: Test Infrastructure for PKP projects

Postby jerico » Tue Oct 27, 2009 6:59 pm

jerico
 
Posts: 94
Joined: Sat May 16, 2009 2:45 pm


Return to OJS Development

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 2 guests