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
18feb139
Commit
18feb139
authored
Aug 20, 2012
by
Mark L. Chang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first test from django with lettuce + selenium
parent
ad284bb5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
lms/djangoapps/acceptance_testing/features/courses.py
+14
-7
lms/djangoapps/acceptance_testing/features/homepage.feature
+1
-1
No files found.
lms/djangoapps/acceptance_testing/features/courses.py
View file @
18feb139
...
@@ -2,9 +2,11 @@ from lettuce import * #before, world
...
@@ -2,9 +2,11 @@ from lettuce import * #before, world
from
selenium
import
*
from
selenium
import
*
import
lettuce_webdriver.webdriver
import
lettuce_webdriver.webdriver
import
logging
import
logging
import
nose.tools
from
selenium.webdriver
import
ActionChains
from
selenium.webdriver
import
ActionChains
from
selenium.webdriver.support.ui
import
WebDriverWait
from
selenium.webdriver.support.ui
import
WebDriverWait
## imported from lms/djangoapps/courseware/courses.py
from
collections
import
defaultdict
from
collections
import
defaultdict
from
fs.errors
import
ResourceNotFoundError
from
fs.errors
import
ResourceNotFoundError
from
functools
import
wraps
from
functools
import
wraps
...
@@ -20,9 +22,10 @@ from xmodule.modulestore.django import modulestore
...
@@ -20,9 +22,10 @@ from xmodule.modulestore.django import modulestore
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
xmodule.modulestore.exceptions
import
ItemNotFoundError
from
static_replace
import
replace_urls
,
try_staticfiles_lookup
from
static_replace
import
replace_urls
,
try_staticfiles_lookup
from
courseware.access
import
has_access
from
courseware.access
import
has_access
## end import
## set up logger
from
django.core.urlresolvers
import
reverse
# logging.basicConfig(filename='lettuce.log', level=logging.DEBUG)
from
courseware.courses
import
course_image_url
,
get_course_about_section
## support functions
## support functions
def
get_courses
():
def
get_courses
():
...
@@ -30,15 +33,20 @@ def get_courses():
...
@@ -30,15 +33,20 @@ def get_courses():
Returns dict of lists of courses available, keyed by course.org (ie university).
Returns dict of lists of courses available, keyed by course.org (ie university).
Courses are sorted by course.number.
Courses are sorted by course.number.
'''
'''
# TODO: Clean up how 'error' is done.
# filter out any courses that errored.
courses
=
[
c
for
c
in
modulestore
()
.
get_courses
()
courses
=
[
c
for
c
in
modulestore
()
.
get_courses
()
if
isinstance
(
c
,
CourseDescriptor
)]
if
isinstance
(
c
,
CourseDescriptor
)]
courses
=
sorted
(
courses
,
key
=
lambda
course
:
course
.
number
)
courses
=
sorted
(
courses
,
key
=
lambda
course
:
course
.
number
)
logging
.
info
(
"COURSES FOUND"
)
logging
.
info
(
courses
)
logging
.
debug
(
courses
)
return
courses
## course listing step
## course listing step
@step
(
u'I should see all courses'
)
@step
(
u'I should see all courses'
)
def
i_should_see_all_courses
(
step
):
def
i_should_see_all_courses
(
step
):
get_courses
()
courses
=
get_courses
()
\ No newline at end of file
page_source
=
world
.
browser
.
page_source
course_link_texts
=
[
(
c
.
location
.
course
,
c
.
display_name
)
for
c
in
courses
]
for
c
in
course_link_texts
:
assert
world
.
browser
.
find_element_by_partial_link_text
(
c
[
0
]
+
' '
+
c
[
1
])
lms/djangoapps/acceptance_testing/features/homepage.feature
View file @
18feb139
Feature
:
There are courses
Feature
:
There are courses
on the homepage
In order to view and sign up for courses
In order to view and sign up for courses
As anonymous web users
As anonymous web users
We want to be able to see all the courses available on the home page
We want to be able to see all the courses available on the home page
...
...
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