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
3f1604ac
Commit
3f1604ac
authored
Feb 06, 2015
by
Jesse Zoldak
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6736 from edx/zoldak/content-library
Fix flaky content library test
parents
46f64305
07e0eee2
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 @
3f1604ac
"""
"""
Library edit page in Studio
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.page_object
import
PageObject
from
bok_choy.promise
import
EmptyPromise
from
bok_choy.promise
import
EmptyPromise
from
selenium.webdriver.common.keys
import
Keys
from
selenium.webdriver.common.keys
import
Keys
...
@@ -252,12 +252,19 @@ class StudioLibraryContentXBlockEditModal(CourseOutlineModal, PageObject):
...
@@ -252,12 +252,19 @@ class StudioLibraryContentXBlockEditModal(CourseOutlineModal, PageObject):
return
element
return
element
@js_defined
(
'window.LibraryContentAuthorView'
)
class
StudioLibraryContainerXBlockWrapper
(
XBlockWrapper
):
class
StudioLibraryContainerXBlockWrapper
(
XBlockWrapper
):
"""
"""
Wraps :class:`.container.XBlockWrapper` for use with LibraryContent blocks
Wraps :class:`.container.XBlockWrapper` for use with LibraryContent blocks
"""
"""
url
=
None
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
@classmethod
def
from_xblock_wrapper
(
cls
,
xblock_wrapper
):
def
from_xblock_wrapper
(
cls
,
xblock_wrapper
):
"""
"""
...
@@ -271,11 +278,18 @@ class StudioLibraryContainerXBlockWrapper(XBlockWrapper):
...
@@ -271,11 +278,18 @@ class StudioLibraryContainerXBlockWrapper(XBlockWrapper):
"""
"""
return
self
.
q
(
css
=
self
.
_bounded_selector
(
".xblock-message-area p"
))
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
):
def
refresh_children
(
self
):
"""
"""
Click "Update now..." button
Click "Update now..." button
"""
"""
btn_selector
=
self
.
_bounded_selector
(
".library-update-btn"
)
btn_selector
=
self
.
_bounded_selector
(
".library-update-btn"
)
refresh_button
=
self
.
q
(
css
=
btn_selector
)
self
.
wait_for_element_presence
(
btn_selector
,
'Update now button is present.'
)
refresh_button
.
click
()
self
.
q
(
css
=
btn_selector
)
.
first
.
click
()
self
.
wait_for_element_absence
(
btn_selector
,
'Wait for the XBlock to reload'
)
# 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 @
3f1604ac
...
@@ -3,7 +3,6 @@ Acceptance tests for Library Content in LMS
...
@@ -3,7 +3,6 @@ Acceptance tests for Library Content in LMS
"""
"""
import
textwrap
import
textwrap
import
ddt
import
ddt
from
unittest
import
skip
from
.base_studio_test
import
StudioLibraryTest
from
.base_studio_test
import
StudioLibraryTest
from
...fixtures.course
import
CourseFixture
from
...fixtures.course
import
CourseFixture
...
@@ -254,7 +253,6 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest):
...
@@ -254,7 +253,6 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest):
library_container
.
validation_warning_text
library_container
.
validation_warning_text
)
)
@skip
(
"Flaky: 01/16/2015"
)
def
test_settings_overrides
(
self
):
def
test_settings_overrides
(
self
):
"""
"""
Scenario: Given I have a library, a course and library content xblock in a course
Scenario: Given I have a library, a course and library content xblock in a course
...
@@ -294,6 +292,7 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest):
...
@@ -294,6 +292,7 @@ class StudioLibraryContainerTest(StudioLibraryTest, UniqueCourseTest):
container_page
.
visit
()
# Reload
container_page
.
visit
()
# Reload
self
.
assertTrue
(
library_block
.
has_validation_warning
)
self
.
assertTrue
(
library_block
.
has_validation_warning
)
library_block
.
refresh_children
()
library_block
.
refresh_children
()
container_page
.
wait_for_page
()
# Wait for the page to reload
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