Skip to content
adam goucher edited this page May 29, 2013 · 61 revisions

0.63

  • updated the browsermob proxy client version
  • updated the selenium version

0.62

changes

  • moved some guards around with the profile stuff, so, you know, it works and stuff

0.61

changes

[SauceLabs]
selenium_version: 2.32.0

0.60

changes

0.59

changes

  • self.selenium and self.config are on all rc page objects if you call init on saunter.po.remotecontrol.page.Page something like
def __init__(self, driver):
    super(type(self)), self).__init__(driver)

0.58

changes

0.57

changes

  • update selenium dependency to 2.31.0

0.56

changes

  • there is now self.short_wait, self.wait and self.long_wait WebDriverWait objects available on pages that inherit from saunter.po.webdriver.page.Page. self.wait is the [Selenium].timeout value from the saunter.ini file. short_wait is half of it, and long_wait is double. You can of course continue to create your own WebDriverWait objects as before if you enjoy the extra typing and/or need a one-off wait amount.
  • fixed a syntax error that was affecting both rc and webdriver scripts; and fixed the import in the webdriver side of things that should have isolated he problem to rc
  • fixed sauce labs integration (see below)
  • logs now going in logs/<timestamped dir> each run. At the end it is copied to logs/latest.xml still so won't break CI integrations
  • screenshots added for webdriver, and unified with rc

upgrade notes

screenshots

I'll write up something next week with code examples, but in a nutshell

  • testcases have two new methods on them
    • take_numbered_screenshot()
    • take_named_screenshot('some name')
  • screenshots are stored in logs/<timestamp>/<classname>/<methodname>
  • numbered screenshots start at 001.png and auto increment
  • webdriver screenshots in sauce labs ondemand will download, rc screenshots do not (due to differences in the api)
  • if an exception happens happens (due to an assert failure for instance) a screenshot called 'exception.png' will be taken
  • before the browser is shutdown, if screenshots are being taken, then a 'final.png' will be taken
  • to enable screenshots, set take_screenshots: true in the Saunter section of saunter.ini
  • also note that it is only in testcases, not in page objects -- just like asserts don't belong in page objects, nor do screenshot calls

0.55

changes

  • by default, new projects will execute in a random order
  • removed management of the selenium server; use a tool like puppet or chef to make sure it is running where you expect it
  • removed implicit waits
  • merged in change to fix incorrectly named verify_not_equal
  • you can now get the name of the test method in WebDriver scripts (and not just RC) via
self.conf.get('Saunter', 'name')

upgrade nodes

  • to add random order to your scripts, add the following to your conftest.py
import random
def pytest_collection_modifyitems(items):
    random.shuffle(items)

0.54

I need to update the main page, but you should likely be using 'pip' as your package manager now.

changes

  • updated selenium dependency to at least 2.28.0
  • you can now attache element objects to an instance (put them in the constructor rather than outside) which is a stylistic thing more than anything else
  • the csv provider will open files in 'universal' mode which allows it to behave on unix when the csv files were made on windows
  • make the difference between the text of elements, input and textarea a whole lot more transparent. saunter.po.webdriver.unicode.Unicode and saunter.po.webdriver.text.Text behave the way a user would expect rather than what a developer things is proper
  • using the package manager to do things the 'right' way in terms of where the script should live and installing shebangs that are proper for the the environment

upgrade notes

  • the location of pysaunter.py might have moved for you; look in $PYTHONHOME/scripts. And if you are on windows, you can even execute it as pysaunter.exe. Hows that for a win from actually reading how to package cross platform?

0.53

changes

  • removed the dependency on the unittest module; now 100% pytest
  • added a markers object which all test instances have on it. It has some [hard] asserts and [soft] asserts (verifies).
    • self.matchers.assert_equal(first, second, msg=None)
    • self.matchers.verify_equal(first, second, msg=None)
    • self.matchers.assert_not_equal(first, second, msg=None)
    • self.matchers.verify_not_equal(first, second, msg=None)
    • self.matchers.assert_true(expr, msg=None)
    • self.matchers.verify_true(expr, msg=None)
    • self.matchers.assert_false(expr, msg=None)
    • self.matchers.verify_false(expr, msg=None)
    • self.matchers.assert_is(first, second, msg=None)
    • self.matchers.verify_is(first, second, msg=None)
    • self.matchers.assert_is_not(first, second, msg=None)
    • self.matchers.verify_is_not(first, second, msg=None)
    • self.matchers.assert_is_none(expr, msg=None)
    • self.matchers.verify_is_none(expr, msg=None)
    • self.matchers.assert_is_not_none(expr, msg=None)
    • self.matchers.verify_is_not_none(expr, msg=None)
    • self.matchers.assert_in(first, second, msg=None)
    • self.matchers.verify_in(first, second, msg=None)
    • self.matchers.assert_not_in(first, second, msg=None)
    • self.matchers.verify_not_in(first, second, msg=None)
    • self.matchers.assert_is_instance(obj, cls, msg=None)
    • self.matchers.verify_is_instance(obj, cls, msg=None)
    • self.matchers.assert_is_not_instance(obj, cls, msg=None).
    • self.matchers.verify_is_not_instance(obj, cls, msg=None)
    • self.matchers.assert_text_present(text, msg=None)
    • self.verify.assert_text_present(text, msg=None)
    • self.matchers.asset_element_present(locator, msg=None)
    • self.verify.asset_element_present(locator, msg=None)
    • self.matchers.assert_visible(locator, msg=None)
    • self.verify.assert_visible(locator, msg=None)

upgrade notes

  • need to change you conftest.py, again. notice how the reference to _testcase is missing. (sorry!)
import os
import os.path
import py
import sys

def pytest_configure(config):
    sys.path.append(os.path.join(os.getcwd(), "modules"))

def pytest_runtest_makereport(__multicall__, item, call):
    if call.when == "call":
        try:
            assert([] == item.parent.obj.verificationErrors)
        except AssertionError:
            call.excinfo = py.code.ExceptionInfo()
    rep = __multicall__.execute()
    return rep
  • because the unittest stuff is gone, the collection algorithm is slightly different, which means the rules in pytest.ini are now being followed. The original rule that was unenforced was that your test methods must start with Check. CheckFoo, CheckBar, CheckFlyingMonkey etc. If you are using Test, or Scalpel or whatever, you can tweak the python_classes line to have the prefix you are using, or if you are using multiple prefixes it is a space delimited list.
  • also, if you are using any of the (unittest provided asserts)[http://docs.python.org/2/library/unittest.html#assert-methods] those are now handrolled versions of them -- with more pythonic names. But! I'm providing wrappers for those so they continue to work. Consider them deprecated though! You really want to convert them to one of the self.markers.* ones.
    • self.assertEqual(first, second, msg=None) -> self.matchers.assert_equal(first, second, msg=None)
    • self.assertNotEqual(first, second, msg=None) -> self.matchers.assert_not_equal(first, second, msg=None)
    • self.assertTrue(expr, msg=None) -> self.matchers.assert_true(expr, msg=None)
    • self.assertFalse(expr, msg=None) -> self.matchers.assert_false(expr, msg=None)
    • self.assertIs(first, second, msg=None) -> self.matchers.assert_is(first, second, msg=None)
    • self.assertIsNot(first, second, msg=None) -> self.matchers.assert_is_not(first, second, msg=None)
    • self.assertIsNone(expr, msg=None) -> self.matchers.assert_is_none(expr, msg=None)
    • self.assertIsNotNone(expr, msg=None) -> self.matchers.assert_is_not_none(expr, msg=None)
    • self.assertIn(first, second, msg=None) -> self.matchers.assert_in(first, second, msg=None)
    • self.assertNotIn(first, second, msg=None) -> self.matchers.assert_not_in(first, second, msg=None)
    • self.assertIsInstance(obj, cls, msg=None) -> self.matchers.assert_is_instance(obj, cls, msg=None)
    • self.assertIsNotInstance(obj, cls, msg=None) -> self.matchers.assert_is_not_instance(obj, cls, msg=None)

0.52

changes

  • default sauce port is now 80 rather than 4444 (for restrictive firewalled people)
  • updated py.test dependency to 2.3.4
  • reworked how Se-RC integrates with Sauce Labs (since it was kinda broken anyways...)

upgrade notes

  • Se-RC uses need to adjust their conftest.py again. This is what it should look like now. (WebDriver users should look like this already.)
import os
import os.path
import py
import sys

def pytest_configure(config):
    sys.path.append(os.path.join(os.getcwd(), "modules"))

def pytest_runtest_makereport(__multicall__, item, call):
    if call.when == "call":
        try:
            assert([] == item._testcase.verificationErrors)
        except AssertionError:
            call.excinfo = py.code.ExceptionInfo()
    rep = __multicall__.execute()
    return rep

0.51

changes

  • elements that are returned by find_elements_by_locator can now also use find_elements_by_locator on
  • added a checkbox base class which will flip the state of the element if it is not what you request
from saunter.po.webdriver.checkbox import Checkbox

def on_off(Checkbox):
  def __init__(self, locator):
    self.locator = locators['on off']

o = on_off()
o = True
o = False

assert(o != True)
  • updated the minimum version of selenium to 2.26
  • updated the minimum version of pytest to 2.3.2
  • added an attribute base class for when you just want an attribute from something
result_count_class = Attribute(locators["result count"], "class")

assert(s.result_count_class == 'rsltCnt')
  • --new will create a support/files directory which is where you would put things like photos that you want to upload to your site

0.48

changes

  • support for parallelization using -n #
  • support for grid functionality

upgrade notes

  • you need to add the following to your conftest.py
      import os
      import os.path
      import py
      import sys

      def pytest_configure(config):
          sys.path.append(os.path.join(os.getcwd(), "modules"))

If you do not, you will get weird import errors.

  • if you are going to use the grid functionality of se, you need to add the following to your saunter.ini
    [Grid]
    use_grid: true
    type: selenium
    platform: mac
    browser_version: 13.0.1

the platform and browser_version are there to filter which nodes get things. Right now, the only grid type is selenium

0.47

changes

  • selects for WebDriver now use the Select class that comes with WebDriver

upgrade notes

0.46

changes

  • i've started to release with 'sdist' instead of 'bdist_egg' which is a technical detail but also uncovered a problem in the packaging

0.45

changes

  • elements found are now wrapped in such a way that they have find_element_by_locator as well
  • --new actually will create the entries in tailored that it is supposed to

0.44

changes

  • fixing an errant comment that meant things were not installing nicely
  • --new will create the entries in tailored that it is supposed to

0.43

changes

0.42

changes

  • fixed an import which would cause things to blow up, ironically, when trying to throw an exception

0.41

changes

  • Seems like I forgot to include the two abstraction files that Saunter needs to run...
  • bumped the selenium version to 2.22.0

0.40

changes

  • There is now a saunter.po.webdriver.unicode.Unicode class which is exactly the same as Text but without the explicit cast into a string. Se returns the information back from the server as Unicode but the who string/unicode comparison thing can be a pain sometime which is why the cast is there.
  • Fixed an exception with SaunterWebDriver.is_visible()

0.39

This is a big release.

changes

  • WebDriver Page Objects now get their browser information as a constructor (dependency injection) rather than from a singleton
  • The SaunterWebDriver inherits in a more OO manner rather than having static methods on it. This allows the resulting code to be more in line with 'typical' Se code
  • Fixed Sauce Labs integration when downloading artifacts from Se-RC

upgrade notes

0.38

changes

  • added a --version flag to quickly figure out what version you have
  • updated things to use selenium 2.19.0
  • updated to use py.test 2.2.3
  • added wait_for_element_present and wait_for_element_visibility_change to the rc's base Page class

0.37

changes

  • instead of the initial se window always grabbing / from the server, it uses whatever the base_url is in saunter.ini

0.36

changes

  • py.test's xfail should now work
  • upgraded the versions of se py.test that are expected

upgrade notes

  • remove the pytest_runtest_makereport method and AdvancedReport class from conftest.py

0.35

changes

  • added a new Number element base class that will int() the returned value from Se
  • can disable autofocus

0.34

changes

  • exposed --durations argument, though it doesn't really do anything all that useful

0.33

ummm, ya. got confused with my commits and this didn't really happen

0.32

a small experimental release for disabling autofocus in a specific place; fully implemented in 0.35

0.31

changes

  • the full stack of a failing line (like a timeout) is displayed by default so you can see where things in your code is failing, just just where in saunter it was dying

0.30

changes

  • can now control the rc timeout value from saunter.ini

upgrade notes

  • add 'timeout' to the Selenium section of saunter.ini in order to get more control over the timeout. this config option takes the number seconds to wait (not ms which i think is just annoying). if you do not add this in, then the default of 30 seconds is used

0.29

changes

  • implicit waits when switching to a popup window in remote control now work
  • which was as a direct result of not swallowing the error the server returned when the window wasn't found
  • the parsing of the message (error) from the server when an element or window isn't found is done as unicode rather than as a string
  • wait_for_element_present(locator) is now available on rc based pages

0.28

apparently i did a double version bump.

changes

  • implicit waits now work for webdriver
  • setting text in a field that inherits from saunter.po.webdriver.text now works
  • increased the se version to 2.14 which pulls in a firefox-to-the-foreground fix
  • --collectonly is now exposed

0.26

changes

  • exposed the py.test --pdb flag
  • exposed the --maxfail flag for early exit of runs
  • upgrading the required py.test version to 2.2.0
  • removed the marksfiltration plugin since collection is now fixed in 2.2.x
  • google chrome support for webdriver

upgrade notes

  • the way to collect script has now changed as a result of using py.test's collection system. first, the flag is -m (marker) now rather than -f (filter).
shallow do nothing, this is the default
single -m ebay
or -m "shirts or meta"
and -m "shirts and ebay"
filter -m "ebay and not meta"
filter -m "not meta"
* if you are using google chrome with webdriver, you need to tell py.saunter where to find the external chromedriver binary. it looks for this information in saunter.ini in the Selenium section as the chromedriver_path key. For instance:

chromedriver_path: /Users/adam/Downloads/chromedriver

0.25

changes

  • the config file is now read using SafeConfigParser instead of RawConfigParser which is apparently a good thing (and a feature request)
  • new flag -p to control additional py.test plugins. your milage with them of course will vary
  • new flag --traceconfig to let you see which plugins are enabled or disabled
  • the built-in 'mark' plugin is disabled as it was conflicting with the markfiltration one which does better collection. this conflict broke a filtration of things like '-f foo -f bar' and '-f foo -bar'

0.24

changes

  • fixing an import when using WebDriver

0.23

changes

  • For RC, a screen capture is taken right before the browser is closed and put in logs//final.png
  • For both RC and WebDriver, if an exception happens in setUp() the browser should still get closed and not be orphaned

upgrade notes

  • the non-orphan trigger is in conftest.py which is created when you run with the --new argument. since this file does not get stomped on with subsequent runs it needs to be manually copied. The new conftest.py is at /site-packages/py.saunter-0.23-py2.7.egg/saunter/_defaults/conftest.py.

0.22

changes

  • buildbot will now correctly report passed or failed

0.21

changes

  • new flag --tb to control the output you want from failed scripts (same as the py.test one)

0.18, 0.19, 0.20

changes

  • fix a type-o around implicit waits. and then type-o in the fix. and that fix.

0.17

changes

  • implicit waits should now work with webdriver
  • added find_elements_by_locator to SaunterWebDriver
  • added wait_for_available to saunter.po.webdriver.page
  • fixed the missing imports from saunter.providers.django_provider

0.16

changes

  • fixed the se server 'hanging' when saunter was controlling it in the background

0.15

changes

  • even if the server version was bumped it wouldn't be downloaded

0.14

changes

  • fixed the logfile name which didnt have the hour in it
  • the 'focus' command doesn't throw and exception if the locator it is locating on doesnt exist

0.13

changes

  • bumped the server jar from 2.5.0 to 2.7.0

0.12

changes

  • fixed a problem with setting focus with 'select' commands

0.11

changes

  • ummm. wouldn't run due to a type-o. well, not really a type-o, but a lesson learned that you cannot use 0.10.1 as a version

0.10.1

changes

  • requires selenium 2.6.0 bindings
  • repo change from personal account to the organization one

0.10

changes

  • screenshots of command results are now available which are stored in logs/ as a numerical sequence

upgrade notes

  • add 'take_screenshots' to the 'Saunter' section as a true/false value

0.9

changes

  • elements now are 'focus'ed before interacted with

0.8

changes

  • added a mechanism for modifying the Selenium RC API

upgrade notes

  • there is a new module that is needed for this upgrade to work. running 'pysaunter --new' will create it for you.

0.7

changes

  • fixed updating of Se-RC jobs run in Sauce OnDemand
  • replaced urllib2 with requests
  • the selenium server detection was hardcoded to look at localhost:4444. now reads from the config file

upgrade notes

  • the bulk of the changes were done in the conftest.py which is created when you run with the --new argument. since this file does not get stomped on with subsequent runs it needs to be manually copied. The new conftest.py is at /site-packages/py.saunter-0.7-py2.7.egg/saunter/_defaults/conftest.py.

0.6

changes

  • reworked how the selenium server is controlled
  • added webdriver (always through remote) support
  • refactored a bit of the Sauce integration

upgrade notes

  • saunter.ini changes
  • new manage_server key in [Saunter] that is either true or false. when false the assumption is that you are controlling the server some other way (such as with puppet)
  • server key in [Saunter] is now server_path and points to selenium server jar you want to use. it it is not found py.saunter will download one for you
  • SaunterTestCase has been moved to either saunter.testcase.remotecontrol or saunter.testcase.webdriver. Adjust your imports accordingly

0.5

  • fixed argument parsing; the default really is 'shallow' as a tag when there is no tag provided.
  • added implicit wait support. the control, modify the following values in your saunter.ini
  • use_implicit_wait: true
  • implicit_wait: 30
  • when a locator is not found, it throws a useful exception instead of just a stack trace
  • Element css=.countr was not found. It is used in the ShirtPage page object in the pages.shirts module.

0.4

  • moved the starting of the server outside of initialization of a new project
  • added new [Saunter] section to saunter.ini (people upgrading will have to manually add this blank section)
  • examples now available in github
  • generators now work
  • providers now work

0.3

  • first public release