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
8a2d08bb
Commit
8a2d08bb
authored
Apr 17, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor choosing the browser for lettuce tests to settings.py
parent
584bb862
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
cms/envs/acceptance.py
+1
-0
common/djangoapps/terrain/browser.py
+13
-6
lms/envs/acceptance.py
+1
-0
No files found.
cms/envs/acceptance.py
View file @
8a2d08bb
...
...
@@ -36,3 +36,4 @@ DATABASES = {
INSTALLED_APPS
+=
(
'lettuce.django'
,)
LETTUCE_APPS
=
(
'contentstore'
,)
LETTUCE_SERVER_PORT
=
8001
LETTUCE_BROWSER
=
'chrome'
common/djangoapps/terrain/browser.py
View file @
8a2d08bb
from
lettuce
import
before
,
after
,
world
from
splinter.browser
import
Browser
from
logging
import
getLogger
from
django.core.management
import
call_command
from
django.conf
import
settings
# Let the LMS and CMS do their one-time setup
# For example, setting up mongo caches
...
...
@@ -10,18 +12,14 @@ from cms import one_time_startup
logger
=
getLogger
(
__name__
)
logger
.
info
(
"Loading the lettuce acceptance testing terrain file..."
)
from
django.core.management
import
call_command
@before.harvest
def
initial_setup
(
server
):
'''
Launch the browser once before executing the tests
'''
# Launch the browser app (choose one of these below)
world
.
browser
=
Browser
(
'chrome'
)
# world.browser = Browser('phantomjs')
# world.browser = Browser('firefox')
browser_driver
=
getattr
(
settings
,
'LETTUCE_BROWSER'
,
'chrome'
)
world
.
browser
=
Browser
(
browser_driver
)
@before.each_scenario
...
...
@@ -34,6 +32,15 @@ def reset_data(scenario):
call_command
(
'flush'
,
interactive
=
False
)
@after.each_scenario
def
screenshot_on_error
(
scenario
):
'''
Save a screenshot to help with debugging
'''
if
scenario
.
failed
:
world
.
browser
.
driver
.
save_screenshot
(
'/tmp/last_failed_scenario.png'
)
@after.all
def
teardown_browser
(
total
):
'''
...
...
lms/envs/acceptance.py
View file @
8a2d08bb
...
...
@@ -67,3 +67,4 @@ MITX_FEATURES['STUB_VIDEO_FOR_TESTING'] = True
# Include the lettuce app for acceptance testing, including the 'harvest' django-admin command
INSTALLED_APPS
+=
(
'lettuce.django'
,)
LETTUCE_APPS
=
(
'courseware'
,)
LETTUCE_BROWSER
=
'chrome'
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