Make edxnotes bok-choy tests chrome-friendly.
This eliminates some flakiness related to the loading of the notes page. It also sets the 'no content' version of that page as a separate page object so testing that case is more explicit. TE-849
This commit is contained in:
@@ -201,7 +201,7 @@ class EdxNotesPage(CoursePage):
|
||||
self.current_view = self.MAPPING["recent"](self.browser)
|
||||
|
||||
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):
|
||||
"""
|
||||
@@ -282,6 +282,16 @@ class EdxNotesPage(CoursePage):
|
||||
children = self.q(css='.note-section')
|
||||
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
|
||||
def no_content_text(self):
|
||||
"""
|
||||
|
||||
@@ -6,7 +6,7 @@ from ...fixtures.course import CourseFixture, XBlockFixtureDesc
|
||||
from ...pages.lms.auto_auth import AutoAuthPage
|
||||
from ...pages.lms.course_nav import CourseNavPage
|
||||
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
|
||||
|
||||
|
||||
@@ -413,10 +413,11 @@ class EdxNotesPageTest(EdxNotesTestMixin):
|
||||
When I open Notes page
|
||||
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(
|
||||
"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):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user