Commit 454e4d1a by Dean Dieker Committed by Mark L. Chang

updated signup.py and signup.feature with additional steps and scenarios

parent 90e5a0e1
......@@ -4,15 +4,29 @@ Feature: Homepage renders
We'll see if I can create an account
Scenario: Visit the homepage to Sign Up
#Given I visit "http://anant:agarwal@stage-edx-001.m.edx.org/"
Given I visit "http://edx.org/"
Given I visit "http://anant:agarwal@stage-edx-001.m.edx.org/"
When I click "SIGN UP"
And I signup with "bob@bob.com" in the "email" field
And I signup with "bob14@bob.com" in the "email" field
And I signup with "password" in the "password" field
And I fill in "username" with "Bjones1986"
And I fill in "name" with "Bob Jones"
#And I select "Master\'s or professional degree" from "level_of_education"
#And I select the option "(.*)" from the selection "(.*)"
#And I check "terms_of_service"
#And I check "honor_code"
#And I click "CREATE MY ACCOUNT"
\ No newline at end of file
And I click the checkbox "terms_of_service"
And I click the checkbox "honor_code"
And I press "Create My Account"
Then I should see an element with class of "activation-message" within "10" seconds
And I should see "Thanks For Registering!"
Scenario: Logout of a signed in account
Given I visit "http://anant:agarwal@stage-edx-001.m.edx.org/dashboard"
When I logout
Then I should see an element with id of "login" within "3" seconds
Scenario: Login to an existing account and logout
Given I visit "http://anant:agarwal@stage-edx-001.m.edx.org/"
When I click "LOG IN"
And I login with "test@test.com" in the "email" field
And I login with "password" in the "password" field
And I press "Access My Courses"
Then The browser's URL should contain "\/dashboard" within 3 seconds
\ No newline at end of file
......@@ -2,10 +2,12 @@ from lettuce import * #before, world
from selenium import *
import lettuce_webdriver.webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.support.ui import WebDriverWait
## Signup Step
@step(u'I signup with "(.*)" in the "(.*)" field')
def i_signup_with_data_in_the_field_field(step, data, field):
#e = world.browser.find_element_by_css_selector("div.input-group").find_element_by_name("email")
e = world.browser.find_element_by_xpath("//section[@id='signup-modal']").find_element_by_name(field)
e.send_keys(data)
......@@ -21,3 +23,32 @@ def i_select_option_from_selection(step, option, selection):
for option in allOptions:
if (option.name == option):
option.click()
@step(u'I click the checkbox "(.*)"')
def i_click_the_checkbox(step, checkbox):
c = world.browser.find_element_by_xpath("//section[@id='signup-modal']").find_element_by_name(checkbox)
c.click()
@step(u'Then I should see an element with class of "([^"]*)" within "(.*)" seconds')
def then_i_should_see_an_element_with_class_of_classname_within_duration_seconds(step, classname, duration):
try:
element = WebDriverWait(world.browser, int(duration)).until(lambda driver : driver.find_element_by_class_name(classname))
finally:
pass
## Logout Step
@step(u'I logout')
def i_logout(step):
l = world.browser.find_element_by_link_text("/logout")
l.click()
## Login Step
@step(u'I login with "(.*)" in the "(.*)" field')
def i_login_with_data_in_the_fieldname_field(step,data,fieldname):
e = world.browser.find_element_by_xpath("//section[@id='login-modal']").find_element_by_name(fieldname)
e.send_keys(data)
\ No newline at end of file
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