Commit 1a4a514b authored by Michal Čihař's avatar Michal Čihař

Adjust Selenium tests setup

- do not try to test in browsers which are currently broken on Sauce
- verify login form behavior
- always create all test classes, this makes code easier to understand
parent b2226408
...@@ -104,44 +104,50 @@ class SeleniumTests(LiveServerTestCase): ...@@ -104,44 +104,50 @@ class SeleniumTests(LiveServerTestCase):
self.driver.find_element_by_xpath('//input[@value="Login"]').click() self.driver.find_element_by_xpath('//input[@value="Login"]').click()
# We should end up on login page as user was invalid # We should end up on login page as user was invalid
# This is currently broken with Sauce labs, see: self.driver.find_element_by_name('username')
# http://support.saucelabs.com/entries/20629691
#self.driver.find_element_by_name('username')
# What other platforms we want to test
EXTRA_PLATFORMS = { EXTRA_PLATFORMS = {
'Chrome': { 'Chrome': {
'browserName': 'chrome', 'browserName': 'chrome',
'platform': 'XP', 'platform': 'XP',
}, },
'Opera': { # Following browsers do not work correctly store cookies with Sauce labs:
'browserName': 'opera', # http://support.saucelabs.com/entries/20629691
'platform': 'WIN7', #'Opera': {
}, # 'browserName': 'opera',
'MSIE10': { # 'platform': 'WIN7',
'browserName': 'internet explorer', #},
'version': '10', #'MSIE10': {
'platform': 'WIN8', # 'browserName': 'internet explorer',
}, # 'version': '10',
'MSIE9': { # 'platform': 'WIN8',
'browserName': 'internet explorer', #},
'version': '9', #'MSIE9': {
'platform': 'VISTA', # 'browserName': 'internet explorer',
}, # 'version': '9',
# 'platform': 'VISTA',
#},
} }
if DO_SELENIUM: def create_extra_classes():
'''
Create classes for testing with other browsers
'''
classes = {} classes = {}
for platform in EXTRA_PLATFORMS: for platform in EXTRA_PLATFORMS:
d = dict(SeleniumTests.__dict__) classdict = dict(SeleniumTests.__dict__)
name = '%s_%s' % ( name = '%s_%s' % (
SeleniumTests.__name__, SeleniumTests.__name__,
platform platform
) )
d.update({ classdict.update({
'caps': EXTRA_PLATFORMS[platform], 'caps': EXTRA_PLATFORMS[platform],
}) })
classes[name] = new.classobj(name, (SeleniumTests,), d) classes[name] = new.classobj(name, (SeleniumTests,), classdict)
globals().update(classes) globals().update(classes)
create_extra_classes()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment