Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • Linux Kernel 3.9.6 / 3....
  • Linux Kernel 3.0.82 LTS...
  • KDE Software Compilatio...
  • PulseAudio 4.0
  • Wireshark 1.10.0
  • NetworkManager 0.9.8.2
  • LibreOffice 3.6.6 / 4.0...
  • SystemRescueCd 3.7.0
  • Linux Kernel 3.10 RC6
  • Ubuntu Tweak 0.8.5
  • Home > Linux > Internet > HTTP (WWW)

    collective.zombiedoctesting 1.1.0

    Download button

    No screenshots available
    Downloads: 110  View global page NEW!  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Asko Soukka | More programs
    GPL / FREE
    April 30th, 2012, 12:55 GMT [view history]
    ROOT / Internet / HTTP (WWW)

     Read user reviews (0)  Refer to a friend  Subscribe

    collective.zombiedoctesting description

    Fast functional JavaScript testing with Zombie.js

    Zombie.js is a fast headless browser with all the JavaScript support Node.js provides. collective.zombiedoctesting is package that provides a function decorator, which allows Python doctest-style functional JavaScript testing using Python-like CoffeeScript.

    Disclaimer: This may not replace your Selenium-stack, because Zombie.js is just an another browser with its own quirks.

    Requirements

    - Node.js must be installed
    - npm must be installed
    - coffeescript, zombiejs and async packages must be installed using npm
    - coffee-executable must be found on the path

    Example of use (with plone.app.testing)

    Start with defining a functional testing fixture with ZServer (that will run your Plone on localhost:55001 by default):

    from plone.app.testing import PLONE_FIXTURE
    from plone.app.testing import FunctionalTesting

    from plone.testing import z2

    FUNCTIONAL_TESTING = FunctionalTesting(
     bases=(PLONE_FIXTURE, z2.ZSERVER_FIXTURE), name="PloneFixture:ZServer")


    Then write your functional JavaScript tests as a doctest for your testmethod using CoffeeScript instead of Python. Define the context (URL) of your test by using the decorator (@browser) from collective.zombiedoctesting as shown below. You may use all the JavaScript that's provided by your context and the global browser that represents Zombie.js' browser:

    import unittest

    from plone.app.testing import TEST_USER_NAME
    from plone.app.testing import TEST_USER_PASSWORD

    from collective.zombiedoctesting import browser

    constants = {
     "TEST_USER_NAME": TEST_USER_NAME,
     "TEST_USER_PASSWORD": TEST_USER_PASSWORD
     }


    class LoginOverlayTest(unittest.TestCase):

     layer = FUNCTIONAL_TESTING

     @browser("http://localhost:55001/plone/", mapping=constants)
     def test_login(self):
     """
     Let's start by looking up the login link.

     >>> console.log do $("#personaltools-login").text
     Log in

     Clicking that link should not redirect us anywhere, but give us an
     AJAX overlay with a login form.

     >>> do ($ "#personaltools-login").click
     >>> console.log window.location.href
     ... console.log do ($ ".pb-ajax #login-form").text
     http://localhost:55001/plone/
     Login Name
     Password

     Let's fill that form...


     >>> global.form = ($ ".pb-ajax #login-form")
     ... form.find("#__ac_name").val "%(TEST_USER_NAME)s"
     ... form.find("#__ac_password").val "%(TEST_USER_PASSWORD)s"
     ... console.log do form.find("#__ac_name").val
     ... console.log do form.find("#__ac_password").val
     %(TEST_USER_NAME)s
     %(TEST_USER_PASSWORD)s

     ... and click the button to log in.

     >>> do form.find("input[type='submit']").click
     >>> console.log window.location.href
     ... console.log browser.text ".documentFirstHeading"
     http://localhost:55001/plone/login_form
     You are now logged in
     """



    Product's homepage

    Requirements:

    · Python

    What's New in This Release: [ read full changelog ]

    · First (hopefully) non-broken release.

      


    TAGS:

    zombie doctesting | JavaScript testing | zombie | doctesting | JavaScript

    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM