Commit 47a3172b by Calen Pennington

Enable parent/child tests using the acid XBlock.

Also fix those tests to correctly wait until the ajax portions have
finished before evaluating the page contents.
parent c4eee8eb
...@@ -3,7 +3,7 @@ PageObjects related to the AcidBlock ...@@ -3,7 +3,7 @@ PageObjects related to the AcidBlock
""" """
from bok_choy.page_object import PageObject from bok_choy.page_object import PageObject
from bok_choy.promise import Promise from bok_choy.promise import EmptyPromise, BrokenPromise
from .utils import wait_for_xblock_initialization from .utils import wait_for_xblock_initialization
...@@ -31,9 +31,22 @@ class AcidView(PageObject): ...@@ -31,9 +31,22 @@ class AcidView(PageObject):
# and then wait to make sure that the xblock has finished initializing. # and then wait to make sure that the xblock has finished initializing.
return ( return (
self.q(css='{} .acid-block'.format(self.context_selector)).present and self.q(css='{} .acid-block'.format(self.context_selector)).present and
wait_for_xblock_initialization(self, self.context_selector) wait_for_xblock_initialization(self, self.context_selector) and
self._ajax_finished()
) )
def _ajax_finished(self):
try:
EmptyPromise(
lambda: self.browser.execute_script("return jQuery.active") == 0,
"AcidBlock tests still running",
timeout=240
).fulfill()
except BrokenPromise:
return False
else:
return True
def test_passed(self, test_selector): def test_passed(self, test_selector):
""" """
Return whether a particular :class:`.AcidBlock` test passed. Return whether a particular :class:`.AcidBlock` test passed.
......
...@@ -80,7 +80,6 @@ class XBlockAcidNoChildTest(XBlockAcidBase): ...@@ -80,7 +80,6 @@ class XBlockAcidNoChildTest(XBlockAcidBase):
) )
).install() ).install()
@skip('Flakey test, TE-401')
def test_acid_block(self): def test_acid_block(self):
super(XBlockAcidNoChildTest, self).test_acid_block() super(XBlockAcidNoChildTest, self).test_acid_block()
...@@ -113,10 +112,20 @@ class XBlockAcidChildTest(XBlockAcidBase): ...@@ -113,10 +112,20 @@ class XBlockAcidChildTest(XBlockAcidBase):
) )
).install() ).install()
def validate_acid_block_view(self, acid_block): def validate_acid_parent_block_view(self, acid_parent_block):
super(XBlockAcidChildTest, self).validate_acid_block_view() super(XBlockAcidChildTest, self).validate_acid_block_view(acid_parent_block)
self.assertTrue(acid_block.child_tests_passed) self.assertTrue(acid_parent_block.child_tests_passed)
@skip('This will fail until we fix support of children in pure XBlocks')
def test_acid_block(self): def test_acid_block(self):
super(XBlockAcidChildTest, self).test_acid_block() """
Verify that all expected acid block tests pass in the lms.
"""
self.course_info_page.visit()
self.tab_nav.go_to_tab('Courseware')
acid_parent_block = AcidView(self.browser, '.xblock-student_view[data-block-type=acid_parent]')
self.validate_acid_parent_block_view(acid_parent_block)
acid_block = AcidView(self.browser, '.xblock-student_view[data-block-type=acid]')
self.validate_acid_block_view(acid_block)
...@@ -202,10 +202,8 @@ class XBlockAcidChildTest(XBlockAcidParentBase): ...@@ -202,10 +202,8 @@ class XBlockAcidChildTest(XBlockAcidParentBase):
self.user = course_fix.user self.user = course_fix.user
@skip('This will fail until we fix support of children in pure XBlocks')
def test_acid_block_preview(self): def test_acid_block_preview(self):
super(XBlockAcidChildTest, self).test_acid_block_preview() super(XBlockAcidChildTest, self).test_acid_block_preview()
@skip('This will fail until we fix support of children in pure XBlocks')
def test_acid_block_editor(self): def test_acid_block_editor(self):
super(XBlockAcidChildTest, self).test_acid_block_editor() super(XBlockAcidChildTest, self).test_acid_block_editor()
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
-e git+https://github.com/edx/edx-analytics-data-api-client.git@0.1.0#egg=edx-analytics-data-api-client -e git+https://github.com/edx/edx-analytics-data-api-client.git@0.1.0#egg=edx-analytics-data-api-client
-e git+https://github.com/edx/bok-choy.git@4a259e3548a19e41cc39433caf68ea58d10a27ba#egg=bok_choy -e git+https://github.com/edx/bok-choy.git@4a259e3548a19e41cc39433caf68ea58d10a27ba#egg=bok_choy
-e git+https://github.com/edx-solutions/django-splash.git@7579d052afcf474ece1239153cffe1c89935bc4f#egg=django-splash -e git+https://github.com/edx-solutions/django-splash.git@7579d052afcf474ece1239153cffe1c89935bc4f#egg=django-splash
-e git+https://github.com/edx/acid-block.git@459aff7b63db8f2c5decd1755706c1a64fb4ebb1#egg=acid-xblock -e git+https://github.com/edx/acid-block.git@df1a7f0cae46567c251d507b8c72168aed8ec042#egg=acid-xblock
-e git+https://github.com/edx/edx-ora2.git@release-2014-09-18T16.00#egg=edx-ora2 -e git+https://github.com/edx/edx-ora2.git@release-2014-09-18T16.00#egg=edx-ora2
-e git+https://github.com/edx/opaque-keys.git@295d93170b2f6e57e3a2b9ba0a52087a4e8712c5#egg=opaque-keys -e git+https://github.com/edx/opaque-keys.git@295d93170b2f6e57e3a2b9ba0a52087a4e8712c5#egg=opaque-keys
-e git+https://github.com/edx/ease.git@97de68448e5495385ba043d3091f570a699d5b5f#egg=ease -e git+https://github.com/edx/ease.git@97de68448e5495385ba043d3091f570a699d5b5f#egg=ease
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment