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
ccc8b599
Commit
ccc8b599
authored
12 years ago
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed tests to work OK so far.
parent
7e5a67ba
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
78 deletions
+10
-78
lms/djangoapps/courseware/features/course_info.feature
+0
-19
lms/djangoapps/courseware/features/course_info.py
+0
-14
lms/djangoapps/portal/features/common.py
+8
-39
lms/djangoapps/portal/features/registration.feature
+1
-2
lms/djangoapps/terrain/common.py
+1
-4
No files found.
lms/djangoapps/courseware/features/course_info.feature
deleted
100644 → 0
View file @
7e5a67ba
Feature
:
View the Course Info tab
As a student in an edX course
In order to get background on the course
I want to view the info on the course info tab
Scenario
:
I
can get to the course info tab when logged in
Given
I am logged in
And
I am registered for a course
And
I visit the dashboard
When
I click on View Courseware
Then
I am on an info page
And
the Course Info tab is active
And
I do not see
"! Info section missing !"
anywhere on the page
Scenario
:
I
cannot get to the course info tab when not logged in
Given
I am not logged in
And
I visit the homepage
When
I visit the course info URL
Then
the login dialog is visible
This diff is collapsed.
Click to expand it.
lms/djangoapps/courseware/features/course_info.py
deleted
100644 → 0
View file @
7e5a67ba
from
lettuce
import
world
,
step
from
lettuce.django
import
django_url
@step
(
'I am on an info page'
)
def
i_am_on_an_info_page
(
step
):
title
=
world
.
browser
.
title
url
=
world
.
browser
.
url
assert
(
'Course Info'
in
title
)
assert
(
r'/info'
in
url
)
@step
(
'I visit the course info URL$'
)
def
i_visit_the_course_info_url
(
step
):
url
=
django_url
(
'/courses/MITx/6.002x/2012_Fall/info'
)
world
.
browser
.
visit
(
url
)
This diff is collapsed.
Click to expand it.
lms/djangoapps/portal/features/common.py
View file @
ccc8b599
...
...
@@ -45,21 +45,8 @@ def the_page_title_should_be(step, title):
@step
(
'I am logged in$'
)
def
i_am_logged_in
(
step
):
# This is a workaround for now, until askbot is removed
# because askbot is messing with the user and auth tables.
call_command
(
'loaddata'
,
'/tmp/fixtures/robot_user_active.json'
)
world
.
browser
.
cookies
.
delete
()
world
.
browser
.
visit
(
django_url
(
'/'
))
world
.
browser
.
is_element_present_by_css
(
'header.global'
,
10
)
world
.
browser
.
click_link_by_href
(
'#login-modal'
)
login_form
=
world
.
browser
.
find_by_css
(
'form#login_form'
)
login_form
.
find_by_name
(
'email'
)
.
fill
(
'robot@edx.org'
)
login_form
.
find_by_name
(
'password'
)
.
fill
(
'test'
)
login_form
.
find_by_name
(
'submit'
)
.
click
()
# wait for the page to redraw
assert
world
.
browser
.
is_element_present_by_css
(
'.content-wrapper'
,
5
)
world
.
create_user
(
'robot'
)
world
.
log_in
(
'robot@edx.org'
,
'test'
)
@step
(
'I am not logged in$'
)
def
i_am_not_logged_in
(
step
):
...
...
@@ -67,33 +54,15 @@ def i_am_not_logged_in(step):
@step
(
u'I am registered for a course$'
)
def
i_am_registered_for_a_course
(
step
):
u
=
User
.
objects
.
get
(
username
=
'robot2'
)
world
.
create_user
(
'robot'
)
u
=
User
.
objects
.
get
(
username
=
'robot'
)
CourseEnrollment
.
objects
.
create
(
user
=
u
,
course_id
=
'MITx/6.002x/2012_Fall'
)
world
.
log_in
(
'robot@edx.org'
,
'test'
)
@step
(
u'I am an edX user$'
)
def
i_am_an_edx_user
(
step
):
call_command
(
'loaddata'
,
'/tmp/fixtures/robot_user_active.json
'
)
world
.
create_user
(
'robot
'
)
########### USER CREATION ##############
@step
(
u'User "([^"]*)" is an edX user$'
)
def
registered_edx_user
(
step
,
uname
):
# This user factory stuff should work after we kill askbot
# portal_user = UserFactory.build(username=uname, email=uname + '@edx.org')
# portal_user.set_password('test')
# portal_user.save()
# registration = RegistrationFactory(user=portal_user)
# registration.register(portal_user)
# registration.activate()
# user_profile = UserProfileFactory(user=portal_user)
# This is a workaround for now, until askbot is removed
# because askbot is messing with the user and auth tables.
call_command
(
'loaddata'
,
'/tmp/fixtures/robot_user_active.json'
)
########### DEBUGGING ##############
@step
(
u'I save a screenshot to "(.*)"'
)
def
save_screenshot_to
(
step
,
filename
):
world
.
browser
.
driver
.
save_screenshot
(
filename
)
world
.
create_user
(
uname
)
This diff is collapsed.
Click to expand it.
lms/djangoapps/portal/features/registration.feature
View file @
ccc8b599
...
...
@@ -10,8 +10,7 @@ Feature: Register for a course
Then
I should see the course numbered
"6.002x"
in my dashboard
Scenario
:
I
can unregister for a course
Given
I am logged in
And
I am registered for a course
Given
I am registered for a course
And
I visit the dashboard
When
I click the link with the text
"Unregister"
And
I press the
"Unregister"
button in the Unenroll dialog
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/terrain/common.py
View file @
ccc8b599
...
...
@@ -85,6 +85,7 @@ def i_am_an_edx_user(step):
create_user
(
'robot'
)
#### helper functions
@world.absorb
def
create_user
(
uname
):
# This user factory stuff should work after we kill askbot
portal_user
=
UserFactory
.
build
(
username
=
uname
,
email
=
uname
+
'@edx.org'
)
...
...
@@ -171,7 +172,3 @@ def save_the_course_content(path='/tmp'):
f
.
write
(
output
)
f
.
close
########### DEBUGGING ##############
@step
(
u'I save a screenshot to "(.*)"'
)
def
save_screenshot_to
(
step
,
filename
):
world
.
browser
.
driver
.
save_screenshot
(
filename
)
This diff is collapsed.
Click to expand it.
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