Commit 71ec1b94 by muzaffaryousaf

Fixing & adding Bokchoys for edx notes pagination.

TNL-3910
parent bfa2ea5b
...@@ -3,6 +3,7 @@ Stub implementation of an HTTP service. ...@@ -3,6 +3,7 @@ Stub implementation of an HTTP service.
""" """
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
import urllib
import urlparse import urlparse
import threading import threading
import json import json
...@@ -217,6 +218,8 @@ class StubHttpRequestHandler(BaseHTTPRequestHandler, object): ...@@ -217,6 +218,8 @@ class StubHttpRequestHandler(BaseHTTPRequestHandler, object):
`format_str` is a string with old-style Python format escaping; `format_str` is a string with old-style Python format escaping;
`args` is an array of values to fill into the string. `args` is an array of values to fill into the string.
""" """
if not args:
format_str = urllib.unquote(format_str)
return u"{0} - - [{1}] {2}\n".format( return u"{0} - - [{1}] {2}\n".format(
self.client_address[0], self.client_address[0],
self.log_date_time_string(), self.log_date_time_string(),
......
from bok_choy.page_object import PageObject, PageLoadError, unguarded from bok_choy.page_object import PageObject, PageLoadError, unguarded
from bok_choy.promise import BrokenPromise, EmptyPromise from bok_choy.promise import BrokenPromise, EmptyPromise
from .course_page import CoursePage from .course_page import CoursePage
from ..common.paging import PaginatedUIMixin
from ...tests.helpers import disable_animations from ...tests.helpers import disable_animations
from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.action_chains import ActionChains
...@@ -242,7 +243,7 @@ class SearchResultsView(EdxNotesPageView): ...@@ -242,7 +243,7 @@ class SearchResultsView(EdxNotesPageView):
TAB_SELECTOR = ".tab#view-search-results" TAB_SELECTOR = ".tab#view-search-results"
class EdxNotesPage(CoursePage): class EdxNotesPage(CoursePage, PaginatedUIMixin):
""" """
EdxNotes page. EdxNotes page.
""" """
...@@ -348,6 +349,10 @@ class EdxNotesPage(CoursePage): ...@@ -348,6 +349,10 @@ class EdxNotesPage(CoursePage):
children = self.q(css='.note-group') children = self.q(css='.note-group')
return [EdxNotesTagsGroup(self.browser, child.get_attribute("id")) for child in children] return [EdxNotesTagsGroup(self.browser, child.get_attribute("id")) for child in children]
def count(self):
""" Returns the total number of notes in the list """
return len(self.q(css='div.wrapper-note-excerpts').results)
class EdxNotesPageNoContent(CoursePage): class EdxNotesPageNoContent(CoursePage):
""" """
......
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