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
002f3ef9
Commit
002f3ef9
authored
Sep 19, 2013
by
Jay Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up waiting for elements not present on remote webdriver sessions.
parent
20ea2874
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
8 deletions
+18
-8
cms/djangoapps/contentstore/features/subsection.py
+1
-1
common/djangoapps/terrain/browser.py
+4
-2
common/djangoapps/terrain/ui_helpers.py
+7
-2
lms/djangoapps/courseware/features/lti.py
+6
-3
No files found.
cms/djangoapps/contentstore/features/subsection.py
View file @
002f3ef9
...
...
@@ -109,7 +109,7 @@ def i_see_my_subsection_name_with_quote_on_the_courseware_page(step):
@step
(
'the subsection does not exist$'
)
def
the_subsection_does_not_exist
(
step
):
css
=
'span.subsection-name'
assert
world
.
browser
.
is_element_not_present_by_css
(
css
)
assert
world
.
is_css_not_present
(
css
)
@step
(
'I see the subsection release date is ([0-9/-]+)( [0-9:]+)?'
)
...
...
common/djangoapps/terrain/browser.py
View file @
002f3ef9
...
...
@@ -119,6 +119,7 @@ def initial_setup(server):
if
not
success
:
raise
IOError
(
"Could not acquire valid {driver} browser session."
.
format
(
driver
=
browser_driver
))
world
.
absorb
(
0
,
'IMPLICIT_WAIT'
)
world
.
browser
.
driver
.
set_window_size
(
1280
,
1024
)
elif
world
.
LETTUCE_SELENIUM_CLIENT
==
'saucelabs'
:
...
...
@@ -128,7 +129,7 @@ def initial_setup(server):
url
=
"http://{}:{}@ondemand.saucelabs.com:80/wd/hub"
.
format
(
config
[
'username'
],
config
[
'access-key'
]),
**
make_saucelabs_desired_capabilities
()
)
world
.
browser
.
driver
.
implicitly_wait
(
30
)
world
.
absorb
(
30
,
'IMPLICIT_WAIT'
)
elif
world
.
LETTUCE_SELENIUM_CLIENT
==
'grid'
:
world
.
browser
=
Browser
(
...
...
@@ -136,11 +137,12 @@ def initial_setup(server):
url
=
settings
.
SELENIUM_GRID
.
get
(
'URL'
),
browser
=
settings
.
SELENIUM_GRID
.
get
(
'BROWSER'
),
)
world
.
browser
.
driver
.
implicitly_wait
(
30
)
world
.
absorb
(
30
,
'IMPLICIT_WAIT'
)
else
:
raise
Exception
(
"Unknown selenium client '{}'"
.
format
(
world
.
LETTUCE_SELENIUM_CLIENT
))
world
.
browser
.
driver
.
implicitly_wait
(
world
.
IMPLICIT_WAIT
)
world
.
absorb
(
world
.
browser
.
driver
.
session_id
,
'jobid'
)
...
...
common/djangoapps/terrain/ui_helpers.py
View file @
002f3ef9
...
...
@@ -36,8 +36,13 @@ def is_css_present(css_selector, wait_time=10):
@world.absorb
def
is_css_not_present
(
css_selector
,
wait_time
=
5
):
return
world
.
browser
.
is_element_not_present_by_css
(
css_selector
,
wait_time
=
wait_time
)
world
.
browser
.
driver
.
implicitly_wait
(
1
)
try
:
return
world
.
browser
.
is_element_not_present_by_css
(
css_selector
,
wait_time
=
wait_time
)
except
:
raise
finally
:
world
.
browser
.
driver
.
implicitly_wait
(
world
.
IMPLICIT_WAIT
)
@world.absorb
def
css_has_text
(
css_selector
,
text
,
index
=
0
):
...
...
lms/djangoapps/courseware/features/lti.py
View file @
002f3ef9
...
...
@@ -23,9 +23,12 @@ def lti_is_not_rendered(_step):
with
world
.
browser
.
get_iframe
(
'ltiLaunchFrame'
)
as
iframe
:
# iframe does not contain functions from terrain/ui_helpers.py
world
.
browser
.
driver
.
implicitly_wait
(
1
)
result
=
iframe
.
is_element_not_present_by_css
(
'.result'
,
wait_time
=
1
)
world
.
browser
.
driver
.
implicitly_wait
(
world
.
IMPLICIT_WAIT
)
assert
result
try
:
assert
iframe
.
is_element_not_present_by_css
(
'.result'
,
wait_time
=
1
)
except
:
raise
finally
:
world
.
browser
.
driver
.
implicitly_wait
(
world
.
IMPLICIT_WAIT
)
@step
(
'I view the LTI and it is rendered$'
)
...
...
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