Commit 9e16a80e by Ben Patterson

Merge pull request #7978 from edx/benp/wip-fix-edxnotes-flakiness

make edxnotes bok-choy tests chrome-friendly
parents b070d439 31e56e77
...@@ -201,7 +201,7 @@ class EdxNotesPage(CoursePage): ...@@ -201,7 +201,7 @@ class EdxNotesPage(CoursePage):
self.current_view = self.MAPPING["recent"](self.browser) self.current_view = self.MAPPING["recent"](self.browser)
def is_browser_on_page(self): def is_browser_on_page(self):
return self.q(css=".wrapper-student-notes").present return self.q(css=".wrapper-student-notes .note-group").visible
def switch_to_tab(self, tab_name): def switch_to_tab(self, tab_name):
""" """
...@@ -282,6 +282,16 @@ class EdxNotesPage(CoursePage): ...@@ -282,6 +282,16 @@ class EdxNotesPage(CoursePage):
children = self.q(css='.note-section') children = self.q(css='.note-section')
return [EdxNotesPageSection(self.browser, child.get_attribute("id")) for child in children] return [EdxNotesPageSection(self.browser, child.get_attribute("id")) for child in children]
class EdxNotesPageNoContent(CoursePage):
"""
EdxNotes page -- when no notes have been added.
"""
url_path = "edxnotes/"
def is_browser_on_page(self):
return self.q(css=".wrapper-student-notes .is-empty").visible
@property @property
def no_content_text(self): def no_content_text(self):
""" """
......
...@@ -6,7 +6,7 @@ from ...fixtures.course import CourseFixture, XBlockFixtureDesc ...@@ -6,7 +6,7 @@ from ...fixtures.course import CourseFixture, XBlockFixtureDesc
from ...pages.lms.auto_auth import AutoAuthPage from ...pages.lms.auto_auth import AutoAuthPage
from ...pages.lms.course_nav import CourseNavPage from ...pages.lms.course_nav import CourseNavPage
from ...pages.lms.courseware import CoursewarePage from ...pages.lms.courseware import CoursewarePage
from ...pages.lms.edxnotes import EdxNotesUnitPage, EdxNotesPage from ...pages.lms.edxnotes import EdxNotesUnitPage, EdxNotesPage, EdxNotesPageNoContent
from ...fixtures.edxnotes import EdxNotesFixture, Note, Range from ...fixtures.edxnotes import EdxNotesFixture, Note, Range
...@@ -413,10 +413,11 @@ class EdxNotesPageTest(EdxNotesTestMixin): ...@@ -413,10 +413,11 @@ class EdxNotesPageTest(EdxNotesTestMixin):
When I open Notes page When I open Notes page
Then I see only "You do not have any notes within the course." message Then I see only "You do not have any notes within the course." message
""" """
self.notes_page.visit() notes_page_empty = EdxNotesPageNoContent(self.browser, self.course_id)
notes_page_empty.visit()
self.assertIn( self.assertIn(
"You have not made any notes in this course yet. Other students in this course are using notes to:", "You have not made any notes in this course yet. Other students in this course are using notes to:",
self.notes_page.no_content_text) notes_page_empty.no_content_text)
def test_recent_activity_view(self): def test_recent_activity_view(self):
""" """
......
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