adding fixed tests for chrome
This commit is contained in:
committed by
adnanghaffar07
parent
4cba4007fd
commit
7dac728ee9
@@ -10,6 +10,7 @@ class ProblemPage(PageObject):
|
||||
"""
|
||||
|
||||
url = None
|
||||
CSS_PROBLEM_HEADER = '.problem-header'
|
||||
|
||||
def is_browser_on_page(self):
|
||||
return self.q(css='.xblock-student_view').present
|
||||
@@ -81,6 +82,7 @@ class ProblemPage(PageObject):
|
||||
Fill in the answer to a numerical problem.
|
||||
"""
|
||||
self.q(css='div.problem section.inputtype input').fill(text)
|
||||
self.wait_for_ajax()
|
||||
|
||||
def click_check(self):
|
||||
"""
|
||||
@@ -89,6 +91,12 @@ class ProblemPage(PageObject):
|
||||
self.q(css='div.problem button.check').click()
|
||||
self.wait_for_ajax()
|
||||
|
||||
def wait_for_status_icon(self):
|
||||
"""
|
||||
wait for status icon
|
||||
"""
|
||||
self.wait_for_element_visibility('div.problem section.inputtype div .status', 'wait for status icon')
|
||||
|
||||
def click_hint(self):
|
||||
"""
|
||||
Click the Hint button.
|
||||
|
||||
@@ -9,6 +9,7 @@ from .component_editor import ComponentEditorView
|
||||
from .container import XBlockWrapper
|
||||
from ...pages.studio.users import UsersPageMixin
|
||||
from ...pages.studio.pagination import PaginatedMixin
|
||||
from selenium.webdriver.common.keys import Keys
|
||||
|
||||
from ..common.utils import confirm_prompt, wait_for_notification
|
||||
|
||||
@@ -168,7 +169,8 @@ class StudioLibraryContentEditor(ComponentEditorView):
|
||||
Sets value of children count input
|
||||
"""
|
||||
count_text = self.get_setting_element(self.COUNT_LABEL)
|
||||
count_text.clear()
|
||||
count_text.send_keys(Keys.CONTROL, "a")
|
||||
count_text.send_keys(Keys.BACK_SPACE)
|
||||
count_text.send_keys(count)
|
||||
EmptyPromise(lambda: self.count == count, "count is updated in modal.").fulfill()
|
||||
|
||||
|
||||
@@ -118,6 +118,7 @@ class LibraryContentTestBase(UniqueCourseTest):
|
||||
LogoutPage(self.browser).visit()
|
||||
self._auto_auth(self.STAFF_USERNAME, self.STAFF_EMAIL, True)
|
||||
self.course_outline.visit()
|
||||
|
||||
subsection = self.course_outline.section(SECTION_NAME).subsection(SUBSECTION_NAME)
|
||||
return subsection.expand_subsection().unit(UNIT_NAME).go_to()
|
||||
|
||||
@@ -156,9 +157,10 @@ class LibraryContentTest(LibraryContentTestBase):
|
||||
XBlockFixtureDesc("html", "Html1", data='html1'),
|
||||
XBlockFixtureDesc("html", "Html2", data='html2'),
|
||||
XBlockFixtureDesc("html", "Html3", data='html3'),
|
||||
XBlockFixtureDesc("html", "Html4", data='html4'),
|
||||
)
|
||||
|
||||
@ddt.data(1, 2, 3)
|
||||
@ddt.data(2, 3, 4)
|
||||
def test_shows_random_xblocks_from_configured(self, count):
|
||||
"""
|
||||
Scenario: Ensures that library content shows {count} random xblocks from library in LMS
|
||||
@@ -190,7 +192,7 @@ class LibraryContentTest(LibraryContentTestBase):
|
||||
self._auto_auth(self.USERNAME, self.EMAIL, False)
|
||||
self._goto_library_block_page()
|
||||
children_contents = self.library_content_page.children_contents
|
||||
self.assertEqual(len(children_contents), 3)
|
||||
self.assertEqual(len(children_contents), 4)
|
||||
self.assertEqual(children_contents, self.library_xblocks_texts)
|
||||
|
||||
|
||||
|
||||
@@ -315,7 +315,9 @@ class ProblemPartialCredit(ProblemsTest):
|
||||
"""
|
||||
self.courseware_page.visit()
|
||||
problem_page = ProblemPage(self.browser)
|
||||
problem_page.wait_for_element_visibility(problem_page.CSS_PROBLEM_HEADER, 'wait for problem header')
|
||||
self.assertEqual(problem_page.problem_name, 'PARTIAL CREDIT TEST PROBLEM')
|
||||
problem_page.fill_answer_numerical('-1')
|
||||
problem_page.click_check()
|
||||
problem_page.wait_for_status_icon()
|
||||
self.assertTrue(problem_page.simpleprob_is_partially_correct())
|
||||
|
||||
Reference in New Issue
Block a user