Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
454e4d1a
Commit
454e4d1a
authored
Aug 20, 2012
by
Dean Dieker
Committed by
Mark L. Chang
Aug 22, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updated signup.py and signup.feature with additional steps and scenarios
parent
90e5a0e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
8 deletions
+54
-8
test_root/features/signup.feature
+21
-7
test_root/features/signup.py
+33
-1
No files found.
test_root/features/signup.feature
View file @
454e4d1a
...
...
@@ -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
"bob
14
@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
test_root/features/signup.py
View file @
454e4d1a
...
...
@@ -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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment