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
20cc9303
Commit
20cc9303
authored
Nov 30, 2012
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bring over acceptance test changes from cms master branch.
parent
af4f1668
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
146 additions
and
13 deletions
+146
-13
lms/djangoapps/courseware/features/course_info.feature
+1
-4
lms/djangoapps/courseware/features/course_info.py
+0
-1
lms/djangoapps/courseware/features/courseware.feature
+1
-2
lms/djangoapps/courseware/features/courseware.py
+8
-0
lms/djangoapps/portal/features/common.py
+99
-0
lms/djangoapps/portal/features/factories.py
+34
-0
lms/djangoapps/portal/features/login.feature
+1
-2
lms/djangoapps/portal/features/signup.feature
+1
-2
lms/envs/acceptance.py
+1
-2
No files found.
lms/djangoapps/courseware/features/course_info.feature
View file @
20cc9303
...
...
@@ -12,10 +12,8 @@ Feature: View the Course Info tab
And
the Course Info tab is active
And
I do not see
"! Info section missing !"
anywhere on the page
# This test is currently failing
# see: https://www.pivotaltracker.com/projects/614553?classic=true#!/stories/38801223
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
\ No newline at end of file
Then
the login dialog is visible
lms/djangoapps/courseware/features/course_info.py
View file @
20cc9303
from
lettuce
import
world
,
step
from
lettuce.django
import
django_url
#from portal.common import *
@step
(
'I am on an info page'
)
def
i_am_on_an_info_page
(
step
):
...
...
lms/djangoapps/courseware/features/courseware.feature
View file @
20cc9303
...
...
@@ -15,4 +15,4 @@ Feature: View the Courseware Tab
# Given I am not logged in
# And I visit the homepage
# When I visit the courseware URL
# Then the login dialog is visible
\ No newline at end of file
# Then the login dialog is visible
lms/djangoapps/courseware/features/courseware.py
0 → 100644
View file @
20cc9303
from
lettuce
import
world
,
step
from
lettuce.django
import
django_url
@step
(
'I visit the courseware URL$'
)
def
i_visit_the_course_info_url
(
step
):
url
=
django_url
(
'/courses/MITx/6.002x/2012_Fall/courseware'
)
world
.
browser
.
visit
(
url
)
\ No newline at end of file
lms/djangoapps/portal/features/common.py
0 → 100644
View file @
20cc9303
from
lettuce
import
world
,
step
#, before, after
from
factories
import
*
from
django.core.management
import
call_command
from
salad.steps.everything
import
*
from
lettuce.django
import
django_url
from
django.conf
import
settings
from
django.contrib.auth.models
import
User
from
student.models
import
CourseEnrollment
import
time
from
logging
import
getLogger
logger
=
getLogger
(
__name__
)
@step
(
u'I wait (?:for )?"(
\
d+)" seconds?$'
)
def
wait
(
step
,
seconds
):
time
.
sleep
(
float
(
seconds
))
@step
(
'I (?:visit|access|open) the homepage$'
)
def
i_visit_the_homepage
(
step
):
world
.
browser
.
visit
(
django_url
(
'/'
))
assert
world
.
browser
.
is_element_present_by_css
(
'header.global'
,
10
)
@step
(
u'I (?:visit|access|open) the dashboard$'
)
def
i_visit_the_dashboard
(
step
):
world
.
browser
.
visit
(
django_url
(
'/dashboard'
))
assert
world
.
browser
.
is_element_present_by_css
(
'section.container.dashboard'
,
5
)
@step
(
'I should be on the dashboard page$'
)
def
i_should_be_on_the_dashboard
(
step
):
assert
world
.
browser
.
is_element_present_by_css
(
'section.container.dashboard'
,
5
)
assert
world
.
browser
.
title
==
'Dashboard'
@step
(
u'I (?:visit|access|open) the courses page$'
)
def
i_am_on_the_courses_page
(
step
):
world
.
browser
.
visit
(
django_url
(
'/courses'
))
assert
world
.
browser
.
is_element_present_by_css
(
'section.courses'
)
@step
(
'I should see that the path is "([^"]*)"$'
)
def
i_should_see_that_the_path_is
(
step
,
path
):
assert
world
.
browser
.
url
==
django_url
(
path
)
@step
(
u'the page title should be "([^"]*)"$'
)
def
the_page_title_should_be
(
step
,
title
):
assert
world
.
browser
.
title
==
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
)
@step
(
'I am not logged in$'
)
def
i_am_not_logged_in
(
step
):
world
.
browser
.
cookies
.
delete
()
@step
(
u'I am registered for a course$'
)
def
i_am_registered_for_a_course
(
step
):
u
=
User
.
objects
.
get
(
username
=
'robot2'
)
CourseEnrollment
.
objects
.
create
(
user
=
u
,
course_id
=
'MITx/6.002x/2012_Fall'
)
@step
(
u'I am an edX user$'
)
def
i_am_an_edx_user
(
step
):
call_command
(
'loaddata'
,
'/tmp/fixtures/robot_user_active.json'
)
########### 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
)
lms/djangoapps/portal/features/factories.py
0 → 100644
View file @
20cc9303
import
factory
from
student.models
import
User
,
UserProfile
,
Registration
from
datetime
import
datetime
import
uuid
class
UserProfileFactory
(
factory
.
Factory
):
FACTORY_FOR
=
UserProfile
user
=
None
name
=
'Jack Foo'
level_of_education
=
None
gender
=
'm'
mailing_address
=
None
goals
=
'World domination'
class
RegistrationFactory
(
factory
.
Factory
):
FACTORY_FOR
=
Registration
user
=
None
activation_key
=
uuid
.
uuid4
()
.
hex
class
UserFactory
(
factory
.
Factory
):
FACTORY_FOR
=
User
username
=
'robot'
email
=
'robot+test@edx.org'
password
=
'test'
first_name
=
'Robot'
last_name
=
'Test'
is_staff
=
False
is_active
=
True
is_superuser
=
False
last_login
=
datetime
(
2012
,
1
,
1
)
date_joined
=
datetime
(
2011
,
1
,
1
)
lms/djangoapps/portal/features/login.feature
View file @
20cc9303
...
...
@@ -24,4 +24,4 @@ Feature: Login in as a registered user
When
I click the dropdown arrow
And
I click on the link with the text
"Log Out"
Then
I should see a link with the text
"Log In"
And
I should see that the path is
"/"
\ No newline at end of file
And
I should see that the path is
"/"
lms/djangoapps/portal/features/signup.feature
View file @
20cc9303
...
...
@@ -13,4 +13,4 @@ Feature: Sign in
And
I check the checkbox named
"terms_of_service"
And
I check the checkbox named
"honor_code"
And
I press the
"Create My Account"
button on the registration form
Then
I should see
"THANKS FOR REGISTERING!"
in the dashboard banner
\ No newline at end of file
Then
I should see
"THANKS FOR REGISTERING!"
in the dashboard banner
lms/envs/acceptance.py
View file @
20cc9303
...
...
@@ -17,4 +17,4 @@ MITX_FEATURES['DISPLAY_TOY_COURSES'] = True
INSTALLED_APPS
+=
(
'lettuce.django'
,)
LETTUCE_APPS
=
(
'portal'
,)
# dummy app covers the home page, login, registration, and course enrollment
\ No newline at end of file
LETTUCE_APPS
=
(
'portal'
,)
# dummy app covers the home page, login, registration, and course enrollment
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