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
07e0eee2
Commit
07e0eee2
authored
Jan 22, 2015
by
Jesse Zoldak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix flaky content library test
parent
b01f7adc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
common/test/acceptance/pages/studio/library.py
+18
-4
common/test/acceptance/tests/studio/test_studio_library_container.py
+1
-2
No files found.
common/test/acceptance/pages/studio/library.py
View file @
07e0eee2
"""
Library edit page in Studio
"""
from
bok_choy.javascript
import
js_defined
,
wait_for_js
from
bok_choy.page_object
import
PageObject
from
bok_choy.promise
import
EmptyPromise
from
selenium.webdriver.common.keys
import
Keys
...
...
@@ -252,12 +252,19 @@ class StudioLibraryContentXBlockEditModal(CourseOutlineModal, PageObject):
return
element
@js_defined
(
'window.LibraryContentAuthorView'
)
class
StudioLibraryContainerXBlockWrapper
(
XBlockWrapper
):
"""
Wraps :class:`.container.XBlockWrapper` for use with LibraryContent blocks
"""
url
=
None
def
is_browser_on_page
(
self
):
"""
Returns true iff the library content area has been loaded
"""
return
self
.
q
(
css
=
'article.content-primary'
)
.
visible
@classmethod
def
from_xblock_wrapper
(
cls
,
xblock_wrapper
):
"""
...
...
@@ -271,11 +278,18 @@ class StudioLibraryContainerXBlockWrapper(XBlockWrapper):
"""
return
self
.
q
(
css
=
self
.
_bounded_selector
(
".xblock-message-area p"
))
@wait_for_js
# Wait for the fragment.initialize_js('LibraryContentAuthorView') call to finish
def
refresh_children
(
self
):
"""
Click "Update now..." button
"""
btn_selector
=
self
.
_bounded_selector
(
".library-update-btn"
)
refresh_button
=
self
.
q
(
css
=
btn_selector
)
refresh_button
.
click
()
self
.
wait_for_element_absence
(
btn_selector
,
'Wait for the XBlock to reload'
)
self
.
wait_for_element_presence
(
btn_selector
,
'Update now button is present.'
)
self
.
q
(
css
=
btn_selector
)
.
first
.
click
()
# This causes a reload (see cms/static/xmodule_js/public/js/library_content_edit.js)
self
.
wait_for
(
lambda
:
self
.
is_browser_on_page
(),
'StudioLibraryContainerXBlockWrapper has reloaded.'
)
# And wait to make sure the ajax post has finished.
self
.
wait_for_ajax
()
self
.
wait_for_element_absence
(
btn_selector
,
'Wait for the XBlock to finish reloading'
)
common/test/acceptance/tests/studio/test_studio_library_container.py
View file @
07e0eee2
...
...
@@ -3,7 +3,6 @@ Acceptance tests for Library Content in LMS
"""
import
textwrap
import
ddt
from
unittest
import
skip
from
.base_studio_test
import
StudioLibraryTest
from
...fixtures.course
import
CourseFixture
...
...
@@ -254,7 +253,6 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest):
library_container
.
validation_warning_text
)
@skip
(
"Flaky: 01/16/2015"
)
def
test_settings_overrides
(
self
):
"""
Scenario: Given I have a library, a course and library content xblock in a course
...
...
@@ -294,6 +292,7 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest):
container_page
.
visit
()
# Reload
self
.
assertTrue
(
library_block
.
has_validation_warning
)
library_block
.
refresh_children
()
container_page
.
wait_for_page
()
# Wait for the page to reload
...
...
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