Merge pull request #20353 from edx/youngstrom/incr-lms-pages

INCR-216
This commit is contained in:
Michael Youngstrom
2019-04-29 11:45:13 -04:00
committed by GitHub
45 changed files with 118 additions and 9 deletions

View File

@@ -1,3 +1,8 @@
"""
Package of lms page objects for acceptance tests
"""
from __future__ import absolute_import
import os
# Get the URL of the instance under test

View File

@@ -1,6 +1,8 @@
"""
Base class for account settings page.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise

View File

@@ -1,7 +1,10 @@
"""
Pages object for the Django's /admin/ views.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL

View File

@@ -1,6 +1,8 @@
"""
Annotation Component Page.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from selenium.webdriver import ActionChains

View File

@@ -2,6 +2,8 @@
Courseware Boomarks
"""
from __future__ import absolute_import
from common.test.acceptance.pages.common.paging import PaginatedUIMixin
from common.test.acceptance.pages.lms.course_page import CoursePage

View File

@@ -1,3 +1,8 @@
"""
Course catalog page
"""
from __future__ import absolute_import
import re
from bok_choy.page_object import PageObject

View File

@@ -2,6 +2,8 @@
"""
CCX coach dashboard page
"""
from __future__ import absolute_import
from bok_choy.promise import EmptyPromise
from common.test.acceptance.pages.lms.course_page import CoursePage

View File

@@ -3,6 +3,8 @@
Module for Certificates pages.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL

View File

@@ -1,8 +1,10 @@
"""
Conditional Pages
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise, BrokenPromise
from bok_choy.promise import BrokenPromise, EmptyPromise
POLL_ANSWER = 'Yes, of course'

View File

@@ -2,6 +2,8 @@
Course about page (with registration button)
"""
from __future__ import absolute_import
from common.test.acceptance.pages.lms.course_page import CoursePage
from common.test.acceptance.pages.lms.login_and_register import RegisterPage

View File

@@ -2,6 +2,8 @@
LMS Course Home page object
"""
from __future__ import absolute_import
from collections import OrderedDict
from bok_choy.page_object import PageObject

View File

@@ -2,6 +2,8 @@
Course info page.
"""
from __future__ import absolute_import
from common.test.acceptance.pages.lms.course_page import CoursePage

View File

@@ -2,6 +2,8 @@
Base class for pages in courseware.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL

View File

@@ -2,8 +2,10 @@
Wiki tab on courses
"""
from __future__ import absolute_import
from common.test.acceptance.pages.lms.course_page import CoursePage
from common.test.acceptance.pages.studio.utils import type_in_codemirror, get_codemirror_value
from common.test.acceptance.pages.studio.utils import get_codemirror_value, type_in_codemirror
class CourseWikiPage(CoursePage):

View File

@@ -2,11 +2,15 @@
Courseware page.
"""
from __future__ import absolute_import
import re
from bok_choy.page_object import PageObject, unguarded
from bok_choy.promise import EmptyPromise
from selenium.webdriver.common.action_chains import ActionChains
from six.moves import range
from common.test.acceptance.pages.lms import BASE_URL
from common.test.acceptance.pages.lms.bookmarks import BookmarksPage
from common.test.acceptance.pages.lms.completion import CompletionOnViewMixin

View File

@@ -2,6 +2,8 @@
Courseware search
"""
from __future__ import absolute_import
from common.test.acceptance.pages.lms.course_page import CoursePage

View File

@@ -1,9 +1,11 @@
"""Mode creation page (used to add modes to courses during testing)."""
from __future__ import absolute_import
import re
import urllib
from bok_choy.page_object import PageObject
import six.moves.urllib.parse # pylint: disable=import-error
from common.test.acceptance.pages.lms import BASE_URL
@@ -65,7 +67,7 @@ class ModeCreationPage(PageObject):
course_id=self._course_id
)
query_string = urllib.urlencode(self._parameters)
query_string = six.moves.urllib.parse.urlencode(self._parameters)
if query_string:
url += '?' + query_string

View File

@@ -2,8 +2,11 @@
"""
Student dashboard page.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from opaque_keys.edx.keys import CourseKey
from six.moves import range
from common.test.acceptance.pages.lms import BASE_URL

View File

@@ -2,6 +2,8 @@
Dashboard search
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL

View File

@@ -2,6 +2,8 @@
Course discovery page.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL

View File

@@ -1,3 +1,8 @@
"""
LMS discussion page
"""
from __future__ import absolute_import
from contextlib import contextmanager
from bok_choy.javascript import wait_for_js

View File

@@ -1,3 +1,8 @@
"""
LMS edxnotes page
"""
from __future__ import absolute_import
from bok_choy.page_object import PageLoadError, PageObject, unguarded
from bok_choy.promise import BrokenPromise, EmptyPromise
from selenium.webdriver.common.action_chains import ActionChains
@@ -296,7 +301,7 @@ class EdxNotesPage(CoursePage, PaginatedUIMixin):
"""
tabs = self.q(css=".tabs .tab-label")
if tabs:
return map(lambda x: x.replace("Current tab\n", ""), tabs.text)
return [x.replace("Current tab\n", "") for x in tabs.text]
else:
return None

View File

@@ -2,6 +2,8 @@
"""
Mixins for fields.
"""
from __future__ import absolute_import
from bok_choy.promise import EmptyPromise
from common.test.acceptance.tests.helpers import get_selected_option_text, select_option_by_text

View File

@@ -2,6 +2,8 @@
Find courses page (main page of the LMS).
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL

View File

@@ -2,6 +2,8 @@
"""
LMS index (home) page.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL

View File

@@ -3,8 +3,11 @@
Instructor (2) dashboard page.
"""
from __future__ import absolute_import
import os
import six
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise, Promise
@@ -120,7 +123,7 @@ class InstructorDashboardPage(CoursePage):
def is_rescore_unsupported_message_visible(self):
if (self.q(css='.request-response-error').present):
return u'This component cannot be rescored.' in unicode(
return u'This component cannot be rescored.' in six.text_type(
self.q(css='.request-response-error').html
)
return False
@@ -1212,7 +1215,7 @@ class StudentAdminPage(PageObject):
Returns input box for problem location
"""
input_box = self.problem_location_input.first.results[0]
input_box.send_keys(unicode(problem_location))
input_box.send_keys(six.text_type(problem_location))
@property
def student_email_or_username_input(self):

View File

@@ -1,6 +1,8 @@
"""
Bok-Choy PageObject class for learner profile page.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise
from bok_choy.query import BrowserQuery

View File

@@ -1,6 +1,8 @@
"""
Library Content XBlock Wrapper
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject

View File

@@ -2,6 +2,8 @@
Login page for the LMS.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise

View File

@@ -1,9 +1,10 @@
"""Login and Registration pages """
from urllib import urlencode
from __future__ import absolute_import
from bok_choy.page_object import PageObject, unguarded
from bok_choy.promise import EmptyPromise, Promise
from six.moves.urllib.parse import urlencode # pylint: disable=import-error
from common.test.acceptance.pages.lms import BASE_URL
from common.test.acceptance.pages.lms.dashboard import DashboardPage

View File

@@ -1,6 +1,8 @@
"""
Matlab Problem Page.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject

View File

@@ -1,4 +1,6 @@
"""Pages relevant for OAuth2 confirmation."""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL

View File

@@ -1,5 +1,7 @@
"""Payment and verification pages"""
from __future__ import absolute_import
import re
from bok_choy.page_object import PageObject

View File

@@ -3,6 +3,8 @@ Page that allows the student to grade calibration essays
(requirement for being allowed to grade peers).
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from bok_choy.promise import Promise

View File

@@ -2,6 +2,8 @@
Confirmation screen for peer calibration and grading.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from bok_choy.promise import Promise

View File

@@ -2,6 +2,8 @@
Students grade peer submissions.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from bok_choy.promise import Promise

View File

@@ -1,6 +1,8 @@
"""
Problem Page.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from selenium.webdriver.common.keys import Keys

View File

@@ -1,4 +1,6 @@
"""LMS-hosted Programs pages"""
from __future__ import absolute_import
from uuid import uuid4
from bok_choy.page_object import PageObject

View File

@@ -1,6 +1,10 @@
"""
Student progress page
"""
from __future__ import absolute_import
from six.moves import map
from common.test.acceptance.pages.lms.course_page import CoursePage

View File

@@ -1,6 +1,8 @@
"""
Staff views of various tabs (e.g. courseware, course home)
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms.courseware import CoursewarePage

View File

@@ -2,6 +2,8 @@
High-level tab navigation.
"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise, Promise

View File

@@ -3,6 +3,8 @@
Teams pages.
"""
from __future__ import absolute_import
from common.test.acceptance.pages.common.paging import PaginatedUIMixin
from common.test.acceptance.pages.common.utils import click_css, confirm_prompt
from common.test.acceptance.pages.lms.course_page import CoursePage

View File

@@ -2,6 +2,8 @@
Course Textbooks page.
"""
from __future__ import absolute_import
from bok_choy.promise import EmptyPromise
from common.test.acceptance.pages.lms.course_page import CoursePage

View File

@@ -1,4 +1,6 @@
"""Track selection page"""
from __future__ import absolute_import
from bok_choy.page_object import PageObject
from common.test.acceptance.pages.lms import BASE_URL

View File

@@ -2,6 +2,8 @@
Video player in the courseware.
"""
from __future__ import absolute_import
import json
import logging
import time
@@ -11,6 +13,7 @@ from bok_choy.javascript import js_defined, wait_for_js
from bok_choy.page_object import PageObject
from bok_choy.promise import EmptyPromise, Promise
from selenium.webdriver.common.action_chains import ActionChains
from six.moves import zip
log = logging.getLogger('VideoPage')
@@ -746,7 +749,7 @@ class VideoPage(PageObject):
language_codes = self.q(css=languages_selector).attrs('data-lang-code')
language_names = self.q(css=languages_selector).attrs('textContent')
return dict(zip(language_codes, language_names))
return dict(list(zip(language_codes, language_names)))
@property
def position(self):