Commit 34a4b35e by Jay Zoldak

Fix lettuce acceptance tests to reflect the new soft landing page changes.

parent 6c954607
...@@ -20,7 +20,8 @@ def i_visit_the_studio_homepage(step): ...@@ -20,7 +20,8 @@ def i_visit_the_studio_homepage(step):
# LETTUCE_SERVER_PORT = 8001 # LETTUCE_SERVER_PORT = 8001
# in your settings.py file. # in your settings.py file.
world.browser.visit(django_url('/')) world.browser.visit(django_url('/'))
assert world.browser.is_element_present_by_css('body.no-header', 10) signin_css = 'a.action-signin'
assert world.browser.is_element_present_by_css(signin_css, 10)
@step('I am logged into Studio$') @step('I am logged into Studio$')
...@@ -113,7 +114,11 @@ def log_into_studio( ...@@ -113,7 +114,11 @@ def log_into_studio(
create_studio_user(uname=uname, email=email, is_staff=is_staff) create_studio_user(uname=uname, email=email, is_staff=is_staff)
world.browser.cookies.delete() world.browser.cookies.delete()
world.browser.visit(django_url('/')) world.browser.visit(django_url('/'))
world.browser.is_element_present_by_css('body.no-header', 10) signin_css = 'a.action-signin'
world.browser.is_element_present_by_css(signin_css, 10)
# click the signin button
css_click(signin_css)
login_form = world.browser.find_by_css('form#login_form') login_form = world.browser.find_by_css('form#login_form')
login_form.find_by_name('email').fill(email) login_form.find_by_name('email').fill(email)
...@@ -127,17 +132,19 @@ def create_a_course(): ...@@ -127,17 +132,19 @@ def create_a_course():
css_click('a.new-course-button') css_click('a.new-course-button')
fill_in_course_info() fill_in_course_info()
css_click('input.new-course-save') css_click('input.new-course-save')
assert_true(world.browser.is_element_present_by_css('a#courseware-tab', 5)) course_title_css = 'span.course-title'
assert_true(world.browser.is_element_present_by_css(course_title_css, 5))
def add_section(name='My Section'): def add_section(name='My Section'):
link_css = 'a.new-courseware-section-button' link_css = 'a.new-courseware-section-button'
css_click(link_css) css_click(link_css)
name_css = '.new-section-name' name_css = 'input.new-section-name'
save_css = '.new-section-name-save' save_css = 'input.new-section-name-save'
css_fill(name_css, name) css_fill(name_css, name)
css_click(save_css) css_click(save_css)
span_css = 'span.section-name-span'
assert_true(world.browser.is_element_present_by_css(span_css, 5))
def add_subsection(name='Subsection One'): def add_subsection(name='Subsection One'):
css = 'a.new-subsection-item' css = 'a.new-subsection-item'
......
...@@ -34,8 +34,8 @@ def i_click_the_course_link_in_my_courses(step): ...@@ -34,8 +34,8 @@ def i_click_the_course_link_in_my_courses(step):
@step('the Courseware page has loaded in Studio$') @step('the Courseware page has loaded in Studio$')
def courseware_page_has_loaded_in_studio(step): def courseware_page_has_loaded_in_studio(step):
courseware_css = 'a#courseware-tab' course_title_css = 'span.course-title'
assert world.browser.is_element_present_by_css(courseware_css) assert world.browser.is_element_present_by_css(course_title_css)
@step('I see the course listed in My Courses$') @step('I see the course listed in My Courses$')
......
...@@ -5,8 +5,8 @@ Feature: Sign in ...@@ -5,8 +5,8 @@ Feature: Sign in
Scenario: Sign up from the homepage Scenario: Sign up from the homepage
Given I visit the Studio homepage Given I visit the Studio homepage
When I click the link with the text "Sign up" When I click the link with the text "Sign Up"
And I fill in the registration form And I fill in the registration form
And I press the "Create My Account" button on the registration form And I press the Create My Account button on the registration form
Then I should see be on the studio home page Then I should see be on the studio home page
And I should see the message "please click on the activation link in your email." And I should see the message "please click on the activation link in your email."
...@@ -11,10 +11,11 @@ def i_fill_in_the_registration_form(step): ...@@ -11,10 +11,11 @@ def i_fill_in_the_registration_form(step):
register_form.find_by_name('terms_of_service').check() register_form.find_by_name('terms_of_service').check()
@step('I press the "([^"]*)" button on the registration form$') @step('I press the Create My Account button on the registration form$')
def i_press_the_button_on_the_registration_form(step, button): def i_press_the_button_on_the_registration_form(step):
register_form = world.browser.find_by_css('form#register_form') register_form = world.browser.find_by_css('form#register_form')
register_form.find_by_value(button).click() submit_css = 'button#submit'
register_form.find_by_css(submit_css).click()
@step('I should see be on the studio home page$') @step('I should see be on the studio home page$')
......
...@@ -4,13 +4,13 @@ from lettuce.django import django_url ...@@ -4,13 +4,13 @@ from lettuce.django import django_url
@step('I click on View Courseware') @step('I click on View Courseware')
def i_click_on_view_courseware(step): def i_click_on_view_courseware(step):
css = 'p.enter-course' css = 'a.enter-course'
world.browser.find_by_css(css).first.click() world.browser.find_by_css(css).first.click()
@step('I click on the "([^"]*)" tab$') @step('I click on the "([^"]*)" tab$')
def i_click_on_the_tab(step, tab): def i_click_on_the_tab(step, tab):
world.browser.find_link_by_text(tab).first.click() world.browser.find_link_by_partial_text(tab).first.click()
world.save_the_html() world.save_the_html()
......
...@@ -11,8 +11,9 @@ from django.core.management import call_command ...@@ -11,8 +11,9 @@ from django.core.management import call_command
@before.harvest @before.harvest
def initial_setup(server): def initial_setup(server):
# Launch firefox # Launch the browser app (choose one of these below)
world.browser = Browser('chrome') world.browser = Browser('chrome')
# world.browser = Browser('firefox')
@before.each_scenario @before.each_scenario
......
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