Commit 5a579921 by JonahStanley

Fixed stylistic things and no longer skipped tests in firefox

parent 514af944
...@@ -61,16 +61,12 @@ def i_select_a_link_to_the_course_outline(step): ...@@ -61,16 +61,12 @@ def i_select_a_link_to_the_course_outline(step):
@step('I am brought to the course outline page$') @step('I am brought to the course outline page$')
def i_am_brought_to_course_outline(step): def i_am_brought_to_course_outline(step):
if world.is_firefox():
return
assert_in('Course Outline', world.css_text('.outline .page-header')) assert_in('Course Outline', world.css_text('.outline .page-header'))
assert_equal(1, len(world.browser.windows)) assert_equal(1, len(world.browser.windows))
@step('I am brought back to the course outline in the correct state$') @step('I am brought back to the course outline in the correct state$')
def i_am_brought_back_to_course_outline(step): def i_am_brought_back_to_course_outline(step):
if world.is_firefox():
return
step.given('I see the four default edX checklists') step.given('I see the four default edX checklists')
# In a previous step, we selected (1, 0) in order to click the 'Edit Course Outline' link. # In a previous step, we selected (1, 0) in order to click the 'Edit Course Outline' link.
# Make sure the task is still showing as selected (there was a caching bug with the collection). # Make sure the task is still showing as selected (there was a caching bug with the collection).
...@@ -79,15 +75,11 @@ def i_am_brought_back_to_course_outline(step): ...@@ -79,15 +75,11 @@ def i_am_brought_back_to_course_outline(step):
@step('I select a link to help page$') @step('I select a link to help page$')
def i_select_a_link_to_the_help_page(step): def i_select_a_link_to_the_help_page(step):
if world.is_firefox():
return
clickActionLink(2, 0, 'Visit Studio Help') clickActionLink(2, 0, 'Visit Studio Help')
@step('I am brought to the help page in a new window$') @step('I am brought to the help page in a new window$')
def i_am_brought_to_help_page_in_new_window(step): def i_am_brought_to_help_page_in_new_window(step):
if world.is_firefox():
return
step.given('I see the four default edX checklists') step.given('I see the four default edX checklists')
windows = world.browser.windows windows = world.browser.windows
assert_equal(2, len(windows)) assert_equal(2, len(windows))
...@@ -117,8 +109,6 @@ def toggleTask(checklist, task): ...@@ -117,8 +109,6 @@ def toggleTask(checklist, task):
# TODO: figure out a way to do this in phantom and firefox # TODO: figure out a way to do this in phantom and firefox
# For now we will mark the scenerios that use this method as skipped # For now we will mark the scenerios that use this method as skipped
def clickActionLink(checklist, task, actionText): def clickActionLink(checklist, task, actionText):
if world.is_firefox():
return
# toggle checklist item to make sure that the link button is showing # toggle checklist item to make sure that the link button is showing
toggleTask(checklist, task) toggleTask(checklist, task)
action_link = world.css_find('#course-checklist' + str(checklist) + ' a')[task] action_link = world.css_find('#course-checklist' + str(checklist) + ' a')[task]
......
...@@ -71,7 +71,7 @@ def press_the_notification_button(_step, name): ...@@ -71,7 +71,7 @@ def press_the_notification_button(_step, name):
error_showing = world.is_css_present('.is-shown.wrapper-notification-error') error_showing = world.is_css_present('.is-shown.wrapper-notification-error')
return confirmation_dismissed or error_showing return confirmation_dismissed or error_showing
if world.is_firefox(): if world.is_firefox():
#This is done to explicitly make the changes save on firefox. It will remove focus from the previously focused element # This is done to explicitly make the changes save on firefox. It will remove focus from the previously focused element
world.trigger_event(css, event='focus') world.trigger_event(css, event='focus')
world.browser.execute_script("$('{}').click()".format(css)) world.browser.execute_script("$('{}').click()".format(css))
else: else:
......
...@@ -116,7 +116,7 @@ def revert_setting_entry(label): ...@@ -116,7 +116,7 @@ def revert_setting_entry(label):
def get_setting_entry(label): def get_setting_entry(label):
settings = world.browser.find_by_css('.wrapper-comp-setting') settings = world.browser.find_by_css('.wrapper-comp-setting')
for setting in settings: for setting in settings:
if setting.find_by_css('.setting-label')[0].value == label: if world.css_value('.wrapper-comp-setting .setting-label') == label:
return setting return setting
return None return None
...@@ -124,6 +124,6 @@ def get_setting_entry(label): ...@@ -124,6 +124,6 @@ def get_setting_entry(label):
def get_setting_entry_index(label): def get_setting_entry_index(label):
settings = world.browser.find_by_css('.wrapper-comp-setting') settings = world.browser.find_by_css('.wrapper-comp-setting')
for index, setting in enumerate(settings): for index, setting in enumerate(settings):
if setting.find_by_css('.setting-label')[0].value == label: if world.css_value('.wrapper-comp-setting .setting-label') == label:
return index return index
return None return None
...@@ -47,7 +47,7 @@ def i_can_modify_the_display_name(step): ...@@ -47,7 +47,7 @@ def i_can_modify_the_display_name(step):
# (to confirm that we don't throw an error because it is of the wrong type). # (to confirm that we don't throw an error because it is of the wrong type).
index = world.get_setting_entry_index(DISPLAY_NAME) index = world.get_setting_entry_index(DISPLAY_NAME)
world.css_fill('.wrapper-comp-setting .setting-input', '3.4', index=index) world.css_fill('.wrapper-comp-setting .setting-input', '3.4', index=index)
if world.browser.driver_name == 'Firefox': if world.is_firefox():
world.trigger_event('.wrapper-comp-setting .setting-input', index=index) world.trigger_event('.wrapper-comp-setting .setting-input', index=index)
verify_modified_display_name() verify_modified_display_name()
...@@ -140,8 +140,6 @@ def set_the_weight_to_abc(step, bad_weight): ...@@ -140,8 +140,6 @@ def set_the_weight_to_abc(step, bad_weight):
@step('if I set the max attempts to "(.*)", it displays initially as "(.*)", and is persisted as "(.*)"') @step('if I set the max attempts to "(.*)", it displays initially as "(.*)", and is persisted as "(.*)"')
def set_the_max_attempts(step, max_attempts_set, max_attempts_displayed, max_attempts_persisted): def set_the_max_attempts(step, max_attempts_set, max_attempts_displayed, max_attempts_persisted):
#on firefox with selenium, the behaviour is different. eg 2.34 displays as 2.34 and is persisted as 2 #on firefox with selenium, the behaviour is different. eg 2.34 displays as 2.34 and is persisted as 2
if world.is_firefox():
return
index = world.get_setting_entry_index(MAXIMUM_ATTEMPTS) index = world.get_setting_entry_index(MAXIMUM_ATTEMPTS)
world.css_fill('.wrapper-comp-setting .setting-input', max_attempts_set, index=index) world.css_fill('.wrapper-comp-setting .setting-input', max_attempts_set, index=index)
world.verify_setting_entry(world.get_setting_entry(MAXIMUM_ATTEMPTS), MAXIMUM_ATTEMPTS, max_attempts_displayed, True) world.verify_setting_entry(world.get_setting_entry(MAXIMUM_ATTEMPTS), MAXIMUM_ATTEMPTS, max_attempts_displayed, True)
......
...@@ -23,7 +23,7 @@ Feature: Video Component ...@@ -23,7 +23,7 @@ Feature: Video Component
And I have toggled captions And I have toggled captions
Then when I view the video it does show the captions Then when I view the video it does show the captions
#Video Alpha Features will work in Firefox only when Firefox is the active window # Video Alpha Features will work in Firefox only when Firefox is the active window
Scenario: Autoplay is disabled in Studio for Video Alpha Scenario: Autoplay is disabled in Studio for Video Alpha
Given I have created a Video Alpha component Given I have created a Video Alpha component
Then when I view the videoalpha it does not have autoplay enabled Then when I view the videoalpha it does not have autoplay enabled
......
...@@ -33,6 +33,7 @@ def hide_or_show_captions(step, shown): ...@@ -33,6 +33,7 @@ def hide_or_show_captions(step, shown):
# click the button rather than the tooltip, so move the mouse # click the button rather than the tooltip, so move the mouse
# away to make it disappear. # away to make it disappear.
button = world.css_find(button_css) button = world.css_find(button_css)
# mouse_out is not implemented on firefox with selenium
if not world.is_firefox: if not world.is_firefox:
button.mouse_out() button.mouse_out()
world.css_click(button_css) world.css_click(button_css)
......
...@@ -11,7 +11,7 @@ Feature: Login in as a registered user ...@@ -11,7 +11,7 @@ Feature: Login in as a registered user
And I submit my credentials on the login form And I submit my credentials on the login form
Then I should see the login error message "This account has not been activated" Then I should see the login error message "This account has not been activated"
#CHROME ONLY, firefox will not redirect properly # CHROME ONLY, firefox will not redirect properly
Scenario: Login to an activated account Scenario: Login to an activated account
Given I am an edX user Given I am an edX user
And I am an activated user And I am an activated user
......
...@@ -3,7 +3,7 @@ Feature: Sign in ...@@ -3,7 +3,7 @@ Feature: Sign in
As a new user As a new user
I want to signup for a student account I want to signup for a student account
#CHROME ONLY, firefox will not redirect properly # CHROME ONLY, firefox will not redirect properly
Scenario: Sign up from the homepage Scenario: Sign up from the homepage
Given I visit the homepage Given I visit the homepage
When I click the link with the text "Register Now" When I click the link with the text "Register Now"
......
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