Commit b2480b5f by JonahStanley

Changed way feature flags are interpreted

Configurations must be defined before hand

Reduced pylint violations

We only support 4 browsers
parent 21f75ff2
...@@ -12,7 +12,6 @@ Feature: Course checklists ...@@ -12,7 +12,6 @@ Feature: Course checklists
# There are issues getting link to be active in browsers other than chrome # There are issues getting link to be active in browsers other than chrome
@skip_firefox @skip_firefox
@skip_opera
Scenario: A task can link to a location within Studio Scenario: A task can link to a location within Studio
Given I have opened Checklists Given I have opened Checklists
When I select a link to the course outline When I select a link to the course outline
...@@ -22,7 +21,6 @@ Feature: Course checklists ...@@ -22,7 +21,6 @@ Feature: Course checklists
# There are issues getting link to be active in browsers other than chrome # There are issues getting link to be active in browsers other than chrome
@skip_firefox @skip_firefox
@skip_opera
Scenario: A task can link to a location outside Studio Scenario: A task can link to a location outside Studio
Given I have opened Checklists Given I have opened Checklists
When I select a link to help page When I select a link to help page
......
...@@ -10,6 +10,7 @@ import os ...@@ -10,6 +10,7 @@ import os
TEST_ROOT = settings.COMMON_TEST_DATA_ROOT TEST_ROOT = settings.COMMON_TEST_DATA_ROOT
@step(u'I go to the files and uploads page') @step(u'I go to the files and uploads page')
def go_to_uploads(_step): def go_to_uploads(_step):
menu_css = 'li.nav-course-courseware' menu_css = 'li.nav-course-courseware'
...@@ -106,8 +107,8 @@ def get_index(file_name): ...@@ -106,8 +107,8 @@ def get_index(file_name):
def get_file(file_name): def get_file(file_name):
index = get_index(file_name) index = get_index(file_name)
assert index != -1 assert index != -1
url_css = 'a.filename' url_css = 'a.filename'
def get_url(): def get_url():
return world.css_find(url_css)[index]._element.get_attribute('href') return world.css_find(url_css)[index]._element.get_attribute('href')
url = world.retry_on_exception(get_url) url = world.retry_on_exception(get_url)
......
...@@ -13,8 +13,6 @@ Feature: Navigate Course ...@@ -13,8 +13,6 @@ Feature: Navigate Course
When I click on subsection "2" When I click on subsection "2"
Then I should see the content of subsection "2" Then I should see the content of subsection "2"
# Clicking on the sequence link doesn't work on opera through sauce
@skip_opera
Scenario: I can navigate to sequences Scenario: I can navigate to sequences
Given I am viewing a section with multiple sequences Given I am viewing a section with multiple sequences
When I click on sequence "2" When I click on sequence "2"
......
...@@ -27,24 +27,41 @@ DESIRED_CAPABILITIES = { ...@@ -27,24 +27,41 @@ DESIRED_CAPABILITIES = {
'android': DesiredCapabilities.ANDROID 'android': DesiredCapabilities.ANDROID
} }
PLATFORMS = ['Linux', 'OS X 10.8', 'OS X 10.6', 'Windows 8', 'Windows 7', 'Windows XP'] ALL_CONFIG = {
'Linux-chrome--': ['Linux', 'chrome', '', ''],
'Windows 8-chrome--': ['Windows 8', 'chrome', '', ''],
'Windows 7-chrome--': ['Windows 7', 'chrome', '', ''],
'Windows XP-chrome--': ['Windows XP', 'chrome', '', ''],
'OS X 10.8-chrome--': ['OS X 10.8', 'chrome', '', ''],
'OS X 10.6-chrome--': ['OS X 10.6', 'chrome', '', ''],
'Linux-firefox-23-': ['Linux', 'firefox', '23', ''],
'Windows 8-firefox-23-': ['Windows 8', 'firefox', '23', ''],
'Windows 7-firefox-23-': ['Windows 7', 'firefox', '23', ''],
'Windows XP-firefox-23-': ['Windows XP', 'firefox', '23', ''],
'OS X 10.8-safari-6-': ['OS X 10.8', 'safari', '6', ''],
'Windows 8-internetexplorer-10-': ['Windows 8', 'internetexplorer', '10', ''],
}
#HACK #HACK
#This needs to be done because Jenkins needs to satisfy URLs, JSON, BASH, SAUCE, and PYTHON #This needs to be done because Jenkins needs to satisfy URLs, JSON, BASH, SAUCE, and PYTHON
#This is the simplest way to adhere to all of these requirements and still be readable #This is the simplest way to adhere to all of these requirements and still be readable
# PLATFORM-BROWSER-VERSION_NUM-DEVICE
DEFAULT_CONFIG = 'Linux-chrome--' DEFAULT_CONFIG = 'Linux-chrome--'
SAUCE_INFO = os.environ.get('SAUCE_INFO', DEFAULT_CONFIG).split('-') SAUCE_CONFIG = os.environ.get('SAUCE_INFO', DEFAULT_CONFIG)
if len(SAUCE_INFO) != 4:
SAUCE_INFO = DEFAULT_CONFIG.split('-') SAUCE_INFO = ALL_CONFIG[SAUCE_CONFIG]
# Information needed to utilize Sauce Labs. # Information needed to utilize Sauce Labs.
SAUCE = { SAUCE = {
'SAUCE_ENABLED': os.environ.get('SAUCE_ENABLED'), 'SAUCE_ENABLED': os.environ.get('SAUCE_ENABLED'),
'USERNAME': os.environ.get('SAUCE_USER_NAME'), 'USERNAME': os.environ.get('SAUCE_USER_NAME'),
'ACCESS_ID': os.environ.get('SAUCE_API_KEY'), 'ACCESS_ID': os.environ.get('SAUCE_API_KEY'),
'PLATFORM': SAUCE_INFO[0] if SAUCE_INFO[0] in PLATFORMS else 'Linux', 'PLATFORM': SAUCE_INFO[0],
'BROWSER': DESIRED_CAPABILITIES.get(SAUCE_INFO[1].lower(), DesiredCapabilities.CHROME), 'BROWSER': DESIRED_CAPABILITIES.get(SAUCE_INFO[1]),
'VERSION': SAUCE_INFO[2], 'VERSION': SAUCE_INFO[2],
'DEVICE': SAUCE_INFO[3], 'DEVICE': SAUCE_INFO[3],
'SESSION': 'Jenkins Acceptance Tests', 'SESSION': 'Jenkins Acceptance Tests',
......
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