pages.tutor package¶
Subpackages¶
- pages.tutor.admin package
- Submodules
- pages.tutor.admin.base module
- pages.tutor.admin.catalog module
- pages.tutor.admin.contracts module
- pages.tutor.admin.courses module
- pages.tutor.admin.districts module
- pages.tutor.admin.ecosystems module
- pages.tutor.admin.notifications module
- pages.tutor.admin.research_data module
- pages.tutor.admin.salesforce module
- pages.tutor.admin.schools module
- pages.tutor.admin.settings module
- pages.tutor.admin.statistics module
- pages.tutor.admin.tags module
- pages.tutor.admin.terms module
- pages.tutor.admin.users module
- Module contents
Submodules¶
pages.tutor.assignment module¶
The instructor’s assignment control pages.
Add/Edit/Delete Event Add/Edit/Delete External Add/Edit/Delete Homework Add/Edit/Delete Reading
-
class
pages.tutor.assignment.Assignment(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseAn assignment creation or modification.
-
class
SectionOpenToClose(page, root=None)[source]¶ Bases:
pypom.region.RegionOpen and due dates and times for a particular course section.
-
property
is_checked¶ Return True if the section checkbox is checked.
- Returns
Trueif the checkbox is checked, otherwiseFalse- Return type
bool
-
property
name¶ Return the section name.
- Returns
the section name
- Return type
str
-
property
open_to_close¶ Access the open and due dates and times.
- Returns
the date and time controls for the section
- Return type
-
property
-
all_sections() → pages.tutor.assignment.Assignment[source]¶ Click on the ‘All Sections’ radio button.
- Returns
the current page
- Return type
-
cancel() → pages.tutor.calendar.Calendar[source]¶ Click the ‘Cancel’ assignment button.
- Returns
the instructor’s calendar
- Return type
-
change_timezone() → pages.tutor.settings.CourseSettings[source]¶ Click on the current course timezone.
- Returns
the course settings page
- Return type
-
close() → pages.tutor.calendar.Calendar[source]¶ Click on the card ‘x’ button.
- Returns
the instructor’s calendar
- Return type
-
delete(confirm: bool = False) → pages.tutor.calendar.Calendar[source]¶ Click the ‘Delete’ assignment button.
- Parameters
confirm (bool) – (optional) click the delete confirmation button on the pop up dialog box
- Returns
the instructor’s calendar if confirmed otherwise the delete assignment confirmation dialog box
- Return type
-
property
description¶ Return the current assignment description.
- Returns
the current value in the assignment description field
- Return type
str
-
property
description_error¶ Return the description error text.
- Returns
the description field error text
- Return type
str
-
property
errors¶ Return any error messages.
- Returns
a list of error messages
- Return type
list(str)
-
individual_sections() → pages.tutor.assignment.Assignment[source]¶ Click on the ‘Individual Sections’ radio button.
- Returns
the current page
- Return type
-
property
loaded¶ Return True when the assignment name field is found.
- Returns
Truewhen the assignment name field is located- Return type
bool
-
property
name¶ Return the current assignment name.
- Returns
the current value in the assignment name field
- Return type
str
-
property
name_description¶ Return the field descriptor.
- Returns
the additional field descriptor text
- Return type
str
-
property
name_error¶ Return the name error text.
- Returns
the name field error text
- Return type
str
-
property
open_and_due¶ Access the open and due dates and times.
- Returns
the all sections open and due dates and times or the list of sections and their open and due dates and times
- Return type
OpenToCloseor list(SectionOpenToClose)
-
publish() → pages.tutor.calendar.Calendar[source]¶ Click the ‘Publish’ assignment button.
- Returns
the instructor’s calendar
- Return type
-
save() → pages.tutor.calendar.Calendar¶ Click the ‘Publish’ assignment button.
- Returns
the instructor’s calendar
- Return type
-
save_as_draft() → pages.tutor.calendar.Calendar[source]¶ Click the ‘Save as Draft’ assignment button.
- Returns
the instructor’s calendar
- Return type
-
set_assignment_dates(data: dict) → None[source]¶ Set the assignment open and close dates/times.
- Parameters
data (dict) – the data package containing the section open and due date and time information
- Returns
None
-
property
timezone¶ Return the current timezone.
- Returns
the course’s assigned timezone
- Return type
str
-
property
title¶ Return the current card title.
- Returns
the assignment creation or modification title
- Return type
str
-
class
-
class
pages.tutor.assignment.ButtonTooltip(page, root=None)[source]¶ Bases:
pypom.region.RegionThe card button explanation tooltip.
-
property
description¶ Return the tooltip content.
- Returns
the form buttons and there purpose
- Return type
str
-
property
root¶ Locate the tooltip trunk.
- Returns
the root element for a tooltip
- Return type
WebElement
-
property
-
class
pages.tutor.assignment.CancelConfirm(page, root=None)[source]¶ Bases:
pypom.region.RegionThe unsaved changes confirmation dialog.
-
close(no_button=False) → pages.tutor.assignment.Assignment[source]¶ Click on the close ‘x’ button.
- Parameters
no_button (bool) – (optional) use the ‘No’ button instead of the ‘x’ button
- Returns
the assignment page
- Return type
-
property
explanation¶ Return the modal explanation text.
- Returns
the modal explaining unsaved changes
- Return type
str
-
no() → pages.tutor.assignment.Assignment[source]¶ Click on the ‘No’ button.
- Returns
the assignment page
- Return type
-
property
title¶ Return the dialog box title.
- Returns
the modal title
- Return type
str
-
-
class
pages.tutor.assignment.DeleteConfirmation(page, root=None)[source]¶ Bases:
pypom.region.RegionThe assignment deletion confirmation dialog box.
-
property
content¶ Return the dialog box text content.
- Returns
the dialog box content text
- Return type
str
-
delete() → pages.tutor.calendar.Calendar[source]¶ Click the ‘Delete’ button.
- Returns
the instructor’s calendar after deleting the assignment
- Return type
-
property
root¶ Return the root element for the dialog box.
- Returns
the root of the dialog boxes
- Return type
WebElement
-
property
title¶ Return the dialog box title.
- Returns
the dialog box title
- Return type
str
-
property
-
class
pages.tutor.assignment.Event(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.assignment.AssignmentAn event creation or modification.
-
class
pages.tutor.assignment.ExerciseSelector(page, root=None)[source]¶ Bases:
pypom.region.RegionA section-grouped exercise selector and display.
-
class
BookSection(page, root=None)[source]¶ Bases:
pypom.region.RegionAll assessments within a specific book section.
-
property
assessments¶ Access the available assessments within the book section.
- Returns
the list of assessments available within the section
- Return type
list(
Assessment)
-
property
number¶ Return the section number including the chapter.
- Returns
the section number
- Return type
str
-
property
title¶ Return the section title.
- Returns
the section title
- Return type
str
-
property
-
class
Toolbar(page, root=None)[source]¶ Bases:
pypom.region.RegionThe assessment selection toolbar.
-
class
Section(page, root=None)[source]¶ Bases:
pypom.region.RegionA selected book section button in the toolbar.
-
property
is_active¶ Return True if the section is currently displayed.
- Returns
Trueif the section or its assessments are currently displayed in the main window- Return type
bool
-
property
number¶ Return the section number.
- Returns
the section number
- Return type
str
-
property
-
add_more_sections() → pages.tutor.assignment.SectionSelector[source]¶ Click on the ‘+ Add More Sections’ button.
- Returns
the book section selector
- Return type
-
cancel() → pages.tutor.assignment.Homework[source]¶ Click the ‘Cancel’ button.
- Returns
the homework builder
- Return type
-
fewer_tutor_selections() → pages.tutor.assignment.ExerciseSelector[source]¶ Click the down arrow to reduce the number of Tutor questions.
- Returns
the exercise selector
- Return type
-
more_tutor_selections() → pages.tutor.assignment.ExerciseSelector[source]¶ Click the up arrow to increase the number of Tutor questions.
- Returns
the exercise selector
- Return type
-
property
my_selections¶ Return the number of user-selected problems.
Return the number of assessments selected by the teacher for this assignment.
- Returns
the number of user-selected problems
- Return type
int
-
next() → pages.tutor.assignment.Homework[source]¶ Click the ‘Next’ button.
- Returns
the homework builder with the question review visible
- Return type
-
next_section() → pages.tutor.assignment.ExerciseSelector[source]¶ Click on the next section right arrow.
- Returns
the exercise selector with the subsequent section displayed if the arrow is not inactive
- Return type
-
previous_section() → pages.tutor.assignment.ExerciseSelector[source]¶ Click on the previous section left arrow.
- Returns
the exercise selector with the previous section displayed if the arrow is not inactive
- Return type
-
property
sections¶ Return the list of available section buttons.
- Returns
the list of currently displayed sections that have at least one available assessment
- Return type
list(
Section)
-
property
total_problems¶ Return the total number of problems selected.
Return the total number of assessments selected for this assignment (My Selections + Tutor Selections).
- Returns
the total number of selected problems
- Return type
int
-
property
tutor_selections¶ Return the number of Tutor-selected problems.
Return the number of assessments selected by Tutor for this assignment.
- Returns
the number of Tutor-selected problems
- Return type
int
-
class
-
property
loaded¶ Wait until the loading animation is done.
- Returns
Truewhen the loading animation is not found, otherwiseFalse- Return type
bool
-
property
sections¶ Access the book sections within the assessment selector pane.
- Returns
the list of book sections that have available assessments
- Return type
-
class
-
class
pages.tutor.assignment.ExerciseTableReview(page, root=None)[source]¶ Bases:
pypom.region.RegionThe exercise selection review.
-
class
Assessment(page, root=None)[source]¶ Bases:
pypom.region.RegionAn exercise review card.
-
class
Question(page, root=None)[source]¶ Bases:
pypom.region.RegionAn individual question within an assessment item.
-
class
Answer(page, root=None)[source]¶ Bases:
pypom.region.RegionAn exercise answer.
-
property
answer¶ Return the answer content.
Note
The content may not be clear when the answer includes LaTeX.
- Returns
the answer text including sub-elements
- Return type
str
-
property
is_correct¶ Return True if the answer is correct.
- Returns
Trueif the answer is correct,Falseif it is incorrect- Return type
bool
-
property
letter¶ Return the answer letter.
- Returns
the letter representing the answer
- Return type
str
-
property
-
property
answers¶ Access the list of answers for the current question.
- Returns
the list of answer options for the current assessment
- Return type
list(
Answer)
-
property
detailed_solution¶ Return the detailed solution.
- Returns
the detailed solution, if present
- Return type
str
-
property
stem¶ Return the exercise question stem.
- Returns
the assessment question stem
- Return type
str
-
property
tutor_label¶ Return the Tutor exercise reference number for the question.
- Returns
the Tutor exercise reference ID for the question within this assignment
- Return type
str
-
class
-
move_down() → pages.tutor.assignment.ExerciseTableReview[source]¶ Move the selected assessment later in the assignment.
Note
If the assessment is in the last position, the move down arrow is not available.
- Returns
the review table
- Return type
-
move_up() → pages.tutor.assignment.ExerciseTableReview[source]¶ Move the selected assessment earlier in the assignment.
Note
If the assessment is in position 1, the move up arrow is not available.
- Returns
the review table
- Return type
-
property
position¶ Return the position of the assessment in the assignment.
- Returns
the position of the assessment within the homework assignment
- Return type
int
-
property
question¶ Access the assessment(s).
-
question_details() → None[source]¶ View the assessment detailed card view.
- Returns
the assessment card detailed view
- Return type
QuestionDetails
-
remove() → pages.tutor.assignment.ExerciseTableReview[source]¶ Remove the assessment from the assignment.
- Returns
the review table
- Return type
-
property
stimulus¶ Return the introductory stimulus for a multipart question.
- Returns
the introductory stimulus if the assessment is a multi- part question, otherwise return an empty string
- Return type
str
Return the tag key/value pairs.
- Returns
the group of tag key:value pairs
- Return type
dict(str, str)
-
class
-
class
OverviewRow(page, root=None)[source]¶ Bases:
pypom.region.RegionAn exercise table assessment overview row.
-
property
details¶ Return the addition detail tags.
- Returns
assessment detail tags
- Return type
str
-
property
learning_objective¶ Return the learning objective tag.
- Returns
the learning objective tag
- Return type
str
-
property
position¶ Return the assessment position within the table.
- Returns
the position of the assessment within the review table
- Return type
int
-
property
question¶ Return the first question in the assessment.
- Returns
the question stem for normal assessments or the first question stem for multipart assessments
- Return type
str
-
property
section¶ Return the book section containing the assessment, if known.
- Returns
the book section for known locations, an empty string for unaffiliated assessments, or a ‘-‘ for Tutor selections
- Return type
str
-
property
-
add_more_sections() → pages.tutor.assignment.SectionSelector[source]¶ Click the ‘+ Add More Sections’ button.
- Returns
the homework section selector
- Return type
-
property
cards¶ Access the assessment cards in the assignment review.
- Returns
the assessment cards
- Return type
list(
Assessment)
-
fewer_tutor_selections() → pages.tutor.assignment.ExerciseTableReview[source]¶ Click the down arrow to reduce the number of Tutor selections.
- Returns
the assessment review table
- Return type
-
property
loaded¶ Wait until the loading animation is done.
- Returns
Truewhen the loading animation is not found, otherwiseFalse- Return type
bool
-
more_tutor_selections() → pages.tutor.assignment.ExerciseTableReview[source]¶ Click the up arrow to increase the number of Tutor selections.
- Returns
the assessment review table
- Return type
-
property
my_selections¶ Return the number of user-selected assessments.
- Returns
the number of user-selected assessments
- Return type
int
-
property
problem_questions¶ Access the Problem Questions assessment overview table.
- Returns
the overview table row data
- Return type
list(
OverviewRow)
-
property
total_problems¶ Return the total number of assignment problems selected.
- Returns
the number of user-selected assessments plus the number of Tutor-selected assessments
- Return type
int
-
property
tutor_selections¶ Return the number of Tutor-selected assessments.
- Returns
the number of Tutor-selected assessments
- Return type
int
-
class
-
class
pages.tutor.assignment.External(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.assignment.AssignmentAn external assignment creation or modification.
-
property
assignment_url¶ Return the current URL value.
- Returns
the current assignment URL
- Return type
str
-
property
errors¶ Return any error messages.
- Returns
a list of error messages
- Return type
list(str)
-
property
url_error¶ Return the assignment URL error text.
- Returns
the assignment URL field error text
- Return type
str
-
property
-
class
pages.tutor.assignment.Homework(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.assignment.AssignmentA homework assignment creation or modification.
-
add_assessments_by(chapters: Union[int, List[str], List[int], None] = None, sections: Union[int, List[str], List[float], None] = None) → List[str][source]¶ Narrow assessment selection to certain chapters or sections.
- Parameters
chapters (int or list(str) or list(int)) – a number of chapters or a list of specific chapters to select assessments from
sections (int or list(str) or list(float)) – a number of sections or a list of specific sections to select assessments from
- Returns
the list of chapters or sections selected as strings
- Return type
list(str)
-
property
errors¶ Return any error messages.
- Returns
a list of error messages
- Return type
list(str)
-
property
problem_error¶ Return the questions required error message.
- Returns
the questions required field error text
- Return type
str
-
select_problems() → pages.tutor.assignment.SectionSelector[source]¶ Click on the ‘Select Problems’ button.
- Returns
the section selector
- Return type
-
-
class
pages.tutor.assignment.HomeworkTutorSelectionsTooltip(page, root=None)[source]¶ Bases:
pages.tutor.assignment.ButtonTooltipThe ‘What are these?’ Tutor selections tooltip.
-
class
pages.tutor.assignment.OpenToClose(page, root=None)[source]¶ Bases:
pypom.region.RegionThe open and close dates and times rows.
-
DECREASE= ['\ue015']¶
-
INCREASE= ['\ue013']¶
-
NEXT_FIELD= ['\ue004']¶
-
SHIFT_LEFT= ['\ue012']¶
-
SHIFT_RIGHT= ['\ue014']¶
-
property
checkbox¶ Return the section checkbox.
- Returns
the section checkbox
- Return type
WebElement
-
property
due_date¶ Return the ‘Due Date’ input box.
- Returns
the due date input box
- Return type
WebElement
-
property
due_time¶ Return the ‘Due Time’ input box.
- Returns
the due time input box
- Return type
WebElement
-
property
is_checked¶ Return True if the section checkbox is currently checked.
- Returns
Trueif the section checkbox is checked, otherwiseFalse- Return type
bool
-
property
name¶ Return the section name.
- Returns
the section name
- Return type
str
-
property
open_date¶ Return the ‘Open Date’ input box.
- Returns
the open date input box
- Return type
WebElement
-
property
open_time¶ Return the ‘Open Time’ input box.
- Returns
the open time input box
- Return type
WebElement
-
set(open_on: str, open_at: str, due_on: str, due_at: str) → None[source]¶ Set the open and close dates/times.
- Parameters
open_on (str) – a
MM/DD/YYYYdate to open the assignmentopen_at (str) – a
hh:mm xmtime to open the assignmentdue_on (str) – a
MM/DD/YYYYdate the assignment is duedue_at (str) – a
hh:mm xmtime the assignment is due
- Returns
None
-
-
class
pages.tutor.assignment.Reading(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.assignment.AssignmentA reading assignment creation or modification.
-
class
ReadingSelection(page, root=None)[source]¶ Bases:
pypom.region.RegionThe reading order list.
-
delete() → pages.tutor.assignment.Reading.ReadingSelection[source]¶ Remove the section from the reading assignment.
- Returns
the reading selection pane
- Return type
-
move_down() → pages.tutor.assignment.Reading.ReadingSelection[source]¶ Move the section later in the reading order, if possible.
- Returns
the reading selection pane
- Return type
-
move_up() → pages.tutor.assignment.Reading.ReadingSelection[source]¶ Move the section higher in the reading order, if possible.
- Returns
the reading selection pane
- Return type
-
property
number¶ Return the section number.
- Returns
the chapter and section number for the reading
- Return type
str
-
property
title¶ Return the section title.
- Returns
the section title
- Return type
str
-
-
add_readings() → pages.tutor.assignment.SectionSelector[source]¶ Click on the ‘Add Readings’ button.
- Returns
the section selector
- Return type
-
add_readings_by(chapters: Union[int, List[str], List[int], None] = None, sections: Union[int, List[str], List[float], None] = None) → List[str][source]¶ Add chapters or sections to a reading assignment.
- Parameters
chapters (int or list(str) or list(int)) – a number of chapters or a list of specific chapters to add to the reading
sections (int or list(str) or list(float)) – a number of sections or a list of specific sections to add to the reading
- Returns
the list of chapters or sections selected as strings
- Return type
list(str)
-
property
errors¶ Return any error messages.
- Returns
a list of error messages
- Return type
list(str)
-
property
reading_list¶ Access the selected readings list.
- Returns
a list of reading sections for the assignment
- Return type
list(
ReadingSelection)
-
property
readings_error¶ Return the readings required error message.
- Returns
the readings required field error text
- Return type
str
-
what_do_students_see() → pages.tutor.preview.StudentPreview[source]¶ Click the ‘What do students see?’ button.
- Returns
the student preview video pop up
- Return type
-
class
-
class
pages.tutor.assignment.ReadingQuestionTooltip(page, root=None)[source]¶ Bases:
pages.tutor.assignment.ButtonTooltipThe reading questions informational tooltip.
-
class
pages.tutor.assignment.SectionSelector(page, root=None)[source]¶ Bases:
pypom.region.RegionA chapter and section selector for readings and homeworks.
-
class
Chapter(page, root=None)[source]¶ Bases:
pypom.region.RegionA book selection chapter.
-
class
Section(page, root=None)[source]¶ Bases:
pypom.region.RegionA book section within a chapter.
-
property
checked¶ Return True if the checkbox is selected.
- Returns
Trueif the section checkbox is checked andFalseif it is not- Return type
bool
-
property
is_unnumbered¶ Return True if the section is not numbered.
- Returns
Trueif the section does not have a section number,Falseif it does- Return type
bool
-
property
number¶ Return the section number.
- Returns
the section number if it exists, chapter number plus ‘.0’ if it is an introductory section, or an empty string if it does not exist for an end-of-chapter object
- Return type
str
-
select() → pages.tutor.assignment.SectionSelector[source]¶ Click on the section check box.
- Returns
the book section selector
- Return type
-
property
title¶ Return the section title.
- Returns
the section title
- Return type
str
-
property
-
browse_the_book() → pages.tutor.reference.ReferenceBook[source]¶ Click on the ‘Browse the Book’ link to view the chapter.
- Returns
the reference view for the selected chapter in a new tab
- Return type
-
property
checked¶ Return True if the checkbox is selected.
- Returns
Trueif the chapter checkbox is checked andFalseif it is not- Return type
bool
-
property
is_open¶ Return True if the chapter sections are displayed.
- Returns
Trueif the chapter is open andFalseif it is not- Return type
bool
-
property
number¶ Return the chapter number.
- Returns
the chapter number
- Return type
str
-
property
sections¶ Access the chapter sections.
- Returns
the list of chapter sections
- Return type
list(
Section)
-
select() → pages.tutor.assignment.SectionSelector[source]¶ Click on the chapter check box.
- Returns
the book section selector
- Return type
-
property
title¶ Return the chapter title.
- Returns
the chapter title
- Return type
str
-
class
-
add_readings() → Union[pages.tutor.assignment.Assignment, pages.tutor.assignment.ExerciseSelector][source]¶ Click the ‘Add Readings’ / ‘Show Problems’ button.
- Returns
the assignment creation wizard with the new readings added to the assignment or the exercise selector for homeworks
- Return type
-
cancel() → pages.tutor.assignment.Assignment[source]¶ Click the ‘Cancel’ button and return to the assignment wizard.
- Returns
the assignment creation page
- Return type
-
property
chapters¶ Access the book chapters.
- Returns
the list of book chapters
- Return type
list(
Chapter)
-
close() → pages.tutor.assignment.Assignment[source]¶ Click on the close ‘x’ button.
- Returns
close the selector and return to the assignment
- Return type
-
property
loaded¶ Wait until the loading animation is done.
- Returns
Truewhen the loading animation is not found, otherwiseFalse- Return type
bool
-
property
sections¶ Access the individual book sections.
- Returns
the list of book sections ignoring the chapters
- Return type
list(
Section)
-
show_problems() → Union[pages.tutor.assignment.Assignment, pages.tutor.assignment.ExerciseSelector]¶ Click the ‘Add Readings’ / ‘Show Problems’ button.
- Returns
the assignment creation wizard with the new readings added to the assignment or the exercise selector for homeworks
- Return type
-
property
title¶ Return the card heading.
- Returns
the card heading
- Return type
str
-
class
pages.tutor.base module¶
The Tutor base objects.
-
class
pages.tutor.base.TutorBase(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorSharedThe base page for the Tutor app.
Bases:
regions.tutor.nav.TutorNavUse the shared region Tutor navigation.
-
class
pages.tutor.base.TutorLoginBase(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorSharedThe base page for the Tutor URI root.
Used for / and /terms
Bases:
pypom.region.RegionThe log in base footer.
Click the Rice University link.
- Returns
the Rice University home page
- Return type
View the general Tutor terms of service and privacy policy.
- Returns
the OpenStax Tutor Beta terms and policy page
- Return type
Terms
Bases:
pypom.region.RegionThe log in base navigation.
Click on the logo.
- Returns
the OpenStax Tutor Beta home page
- Return type
Click on the Rice logo to view the Rice University home page.
- Returns
the Rice University home page
- Return type
Return the Tutor Beta logo.
- Returns
the OpenStax Tutor Beta logo element
- Return type
WebElement
Return the Rice University logo.
- Returns
the Rice University logo
- Return type
WebElement
Click on the Help link to view Salesforce articles.
- Returns
the OpenStax knowledge base webpage
- Return type
Access the page footer.
- Returns
the page footer element
- Return type
Bases:
pypom.page.PageShared base page functions.
Go back to the previous page.
Execute a one history step backwards request.
- Returns
the current page
- Return type
Close the current tab and switch to the remaining one.
Assumes 2 browser tabs are open.
- Returns
the page on the previous tab
- Return type
Return True when the Tutor page is displayed.
- Returns
Trueif the root element is currently displayed, otherwiseFalse- Return type
bool
Return True if the browser in use is Safari.
- Returns
Trueif the current browser is Safari, elseFalse- Return type
bool
Override the default loaded function.
Wait up to
timeoutseconds for the root element to be found within the DOM.- Returns
Truewhen the root element is found- Return type
bool
Return the current URL.
- Returns
the current website URL
- Return type
str
Access the page nav.
- Returns
the OpenStax Tutor navigation bar
- Return type
Nav
Reload the current page.
Ignore stale element issues because we’re reloading the page; everything is going to be stale if accessed too quickly (multi-process Firefox issue).
- Returns
the current page
- Return type
Set the browser window size.
- Parameters
width (int) – (optional) browser window width, default to a 4:3 ration
height (int) – (optional) browser window height, default to a 4:3 ration
- Returns
None
Return the last segment of the current URL.
- Returns
the final route segment of the current URL
- Return type
str
pages.tutor.calendar module¶
An instructor course page with calendar.
-
class
pages.tutor.calendar.Assignment(page, root=None)[source]¶ Bases:
pypom.region.RegionAn individual student assignment or event.
-
property
assignment_type¶ Return the assignment type.
- Returns
the assignment type
- Return type
str
-
edit()[source]¶ Edit the selected assignment.
- Returns
an assignment creation page if the assignment is a saved draft else display the quick look assignment modal
- Return type
AddExternalorAddEventorAddHomeworkorAddReadingorQuickLook
- :raises
TutorException: if the assignment type does not match a known assignment type
-
property
flagged¶ Return True if the trouble flag is present.
- Returns
Trueif the assignment has a trouble flag displayed on the calendar, elseFalse- Return type
bool
-
property
is_draft¶ Return True if the assignment is a saved draft.
- Returns
Trueif the assignment is a saved draft, elseFalse- Return type
bool
-
property
is_open¶ Return True if the assignment is open for work.
- Returns
Trueif the assignment is currently open for work, elseFalse- Return type
bool
-
property
is_published¶ Return True if the assignment is published.
- Returns
Trueif the assignment is published, elseFalse- Return type
bool
-
property
opens_on¶ Return the date the assignment opens on.
- Returns
the date the assignment opens for work
- Return type
str
-
property
plan¶ Return the assignment plan element.
- Returns
the assignment plan
- Return type
selenium.webdriver.remote.webelement.WebElement
-
property
plan_id¶ Return the assignment plan ID.
- Returns
the assignment plan identification number
- Return type
str
-
property
span¶ Return the number of days this week the event spans.
- Returns
the number of days in the week the assignment spans
- Return type
int
-
property
style¶ Return the assignment color display type.
- Returns
the assignment type
- Return type
str
-
property
title¶ Return the assignment title.
- Returns
the assignment title
- Return type
str
-
property
-
class
pages.tutor.calendar.Calendar(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseThe instructor course calendar.
-
class
Banner(page, root=None)[source]¶ Bases:
pypom.region.RegionThe header region of the course calendar.
-
add_assignment()[source]¶ Click on the ‘Add Assignment’ toggle button.
- Returns
the course calendar
- Return type
-
browse_the_book()[source]¶ Click on the ‘Browse the Book’ button.
- Returns
the reference book view in a new tab
- Return type
-
property
notes¶ Access the notifications.
- Returns
the list of currently active site notifications
- Return type
list(
Notifications)
-
performance_forecast()[source]¶ Click on the ‘Performance Forecast’ button.
- Returns
the course performance overview page
- Return type
Performance
-
question_library()[source]¶ Click on the ‘Question Library’ button.
- Returns
the course question library page
- Return type
QuestionLibrary
-
student_scores()[source]¶ Click on the ‘Student Scores’ button.
- Returns
the instructor scores page
- Return type
-
property
term¶ Return the course term.
- Returns
the course semester or quarter
- Return type
str
-
property
title¶ Return the course title.
- Returns
the course name
- Return type
str
-
-
class
CalendarMonth(page, root=None)[source]¶ Bases:
pypom.region.RegionThe instructor calendar.
-
class
Day(page, root=None)[source]¶ Bases:
pypom.region.RegionA specific date.
-
add_assignment(assignment_type=None)[source]¶ Click on the date number to add an assignment.
- Parameters
assignment_type (str) – the type of assignment to add
- Returns
an assignment creation page
- Return type
AddExternalorAddEventorAddHomeworkorAddReading
- :raises
TutorException: if the assignment_type does not match a known assignment type
-
property
assignments¶ Access the assignments listed as due today.
- Returns
the list of assignments due on this day
- Return type
list(
Assignment)
-
property
date¶ Return the date.
- Returns
the day as a date
- Return type
datetime
-
property
has_assignments¶ Return True if any class assignments are found.
- Returns
Trueif any assignments are due on this day, elseFalse- Return type
bool
-
property
number¶ Return the calendar day number element.
- Returns
the day’s label
- Return type
WebElement
-
property
tense¶ Return whether the date is before today, today, or after.
- Returns
the status of the date with respect to today
- Return type
str
-
property
term¶ Return whether the date is in or out of the term.
- Returns
the status of a date with respect to the course term
- Return type
str
-
-
property
month¶ Return the currently displayed month.
- Returns
the calendar’s currently displayed month
- Return type
str
-
next_month()[source]¶ Click on the right arrow to view the next month.
- Returns
the next month’s calendar view
- Return type
-
previous_month()[source]¶ Click on the left arrow to view the previous month.
- Returns
the previous month’s calendar view
- Return type
-
property
year¶ Return the currently displayed year.
- Returns
the currently displayed month’s year
- Return type
str
-
class
-
class
Sidebar(page, root=None)[source]¶ Bases:
pypom.region.RegionThe assignment sidebar.
-
class
AssignmentCopy(page, root=None)[source]¶ Bases:
pypom.region.RegionAn assignment from a previous course.
-
property
assignment_type¶ Return the assignment type.
- Returns
the past assignment type
- Return type
str
-
property
plan_id¶ Return the assignment ID.
- Returns
the past assignment identification number
- Return type
int
-
property
title¶ Return the assignment name.
- Returns
the past assignment title
- Return type
str
-
property
-
add_event()[source]¶ Click on the ‘Add Event’ button.
- Returns
the add assignment page for an event
- Return type
AddEvent
-
add_external()[source]¶ Click on the ‘Add External Assignment’ button.
- Returns
the add assignment page for an external task
- Return type
AddExternal
-
add_homework()[source]¶ Click on the ‘Add Homework’ button.
- Returns
the add assignment page for a homework
- Return type
AddHomework
-
add_reading()[source]¶ Click on the ‘Add Reading’ button.
- Returns
the add assignment page for a reading
- Return type
AddReading
-
property
copied_assignments¶ Access the assignment clone options.
- Returns
the list of previous-course assignments available for cloning
- Return type
list(
AssignmentCopy)
-
property
event_bar¶ Return the ‘Add Event’ bar element.
- Returns
the event bar
- Return type
WebElement
-
property
external_bar¶ Return the ‘Add External Assignment’ bar element.
- Returns
the external assignment bar
- Return type
WebElement
-
property
homework_bar¶ Return the ‘Add Homework’ bar element.
- Returns
the homework assignment bar
- Return type
WebElement
-
property
is_open¶ Return True if the assignment sidebar menu is displayed.
- Returns
Trueif the assignment sidebar is open and displayed, elseFalse- Return type
bool
-
property
reading_bar¶ Return the ‘Add Reading’ bar element.
- Returns
the reading assignment bar
- Return type
WebElement
-
class
-
add_assignment(assignment: str, name: str, assign_to: Dict[str, Tuple[Tuple[Union[str, datetime.datetime], str], Tuple[Union[str, datetime.datetime], str]]], description: str = '', action: str = 'Publish') → None[source]¶ Create a new assignment.
- TODO
fill parameter list
- Returns
None
- :raises
TutorException: if the assignment type does not match existing assignment types
-
assignment(name: str) → pages.tutor.calendar.Assignment[source]¶ Return the assignment from its name.
- Parameters
name (str) – the assignment name or title
- Returns
the assignment
- Return type
- :raises
TutorExceptionif an assignment does not match
name
-
assignments(by_name: bool = False) → Union[List[pages.tutor.calendar.Assignment], List[str]][source]¶ Return a list of assignments.
- Parameters
by_name (bool) – (optional) request the list of assignment names currently displayed in the calendar
- Returns
the list of assignments or assignment names
- Return type
list(
Assignment) or list(str)
-
assignments_on(date: datetime.datetime, by_name: bool = False) → Union[List[str], List[pages.tutor.calendar.Assignment]][source]¶ Return the assignments on a particular date.
- Parameters
date (
datetime) – a specific dateby_name (bool) – (optional) return the assignment names found on the date instead of the assignments
- Returns
the list of assignments on that date or the list of assignment names on that date
- Return type
list(
Assignment)
Access the course page header.
- Returns
the course banner region
- Return type
-
property
calendar¶ Access the calendar.
- Returns
the assignment calendar region
- Return type
Calendar
-
property
loaded¶ Return True when the loading message goes away.
- Returns
Truewhen the loading message goes away- Return type
bool
- Noindex
-
property
notifications¶ Access the active notifications, if exists.
- Returns
the list of currently active site notifications
- Return type
list(
Notifications)
Access the assignment sidebar.
- Returns
the assignment creation and cloning sidebar region
- Return type
-
property
term¶ Return the course term.
- Returns
the course semester or quarter
- Return type
str
-
property
title¶ Return the course title.
- Returns
the course name
- Return type
str
-
class
pages.tutor.course module¶
The student course view.
-
class
pages.tutor.course.AssignmentBar(page, root=None)[source]¶ Bases:
pypom.region.RegionA student assignment.
-
property
due¶ Return the assignment due date and time.
- Returns
the assignment due date and time, timezone-aware
- Return type
datetime
-
property
late_work¶ Return the homework secondary status line.
- Returns
the secondary status line text for homeworks
- Return type
str
-
property
lateness¶ Return the assignment on time or late status.
- Returns
whether the assignment is on time or late
- Return type
str
- Raises
ValueError – if the icon color for the clock does not match the color for a late assignment or the color for a late assignment with accepted work
-
property
progress¶ Return the assignment progress status.
- Returns
the student’s progress on the assignment
- Return type
str
-
property
style¶ Return the assignment type.
- Returns
the assignment type
- Return type
str
- :raises
TutorException: if a known assignment type is not found within the assignment class
-
property
title¶ Return the assignment name.
- Returns
the assignment name
- Return type
str
-
property
url¶ Return the assignment access URL.
- Returns
the assignment URL
- Return type
str
-
property
-
class
pages.tutor.course.StudentCourse(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseThe weekly course view for students.
-
class
Banner(page, root=None)[source]¶ Bases:
pypom.region.RegionThe course banner.
-
property
course_data¶ Return the course data stored in the course banner element.
- Returns
the course data overview provided by the banner
- Return type
dict(str, str)
-
property
course_name¶ Return the course name.
- Returns
the course title
- Return type
str
-
property
course_term¶ Return the course term.
- Returns
the course semester or quarter
- Return type
str
-
property
-
class
Performance(page, root=None)[source]¶ Bases:
pypom.region.RegionThe performance forecast sidebar.
-
class
Key(page, root=None)[source]¶ Bases:
pypom.region.RegionThe color guide for the performance forecast progress bars.
-
property
color¶ Return the bar color.
- Returns
the color of the progress bar
- Return type
str
-
property
description¶ Return the bar color description.
- Returns
the description of the bar color
- Return type
str
-
property
progress_bar¶ Return the progress bar color box.
- Returns
the progress bar box
- Return type
WebElement
-
property
-
class
Section(page, root=None)[source]¶ Bases:
pypom.region.RegionA recent performance forecast section information.
-
property
count¶ Return the number of questions worked.
- Returns
the number of questions worked for the section
- Return type
int
-
property
data¶ Return the CLUE data values.
- Returns
the CLUe data values
- Return type
dict(str, float or bool or str)
-
property
not_enough_data¶ Return True if a forecast CLUE is not available.
- Returns
Trueif not enough assessments have been worked from the section to generate a BigLearn CLUe, elseFalse- Return type
bool
-
property
number¶ Return the book chapter and section number.
- Returns
book chapter and section number for the bar
- Return type
str
-
practice()[source]¶ Request a practice session for this book section.
- Returns
a practice session for the selected section
- Return type
-
property
practice_more¶ Return the button text if a CLUE is not available.
- Returns
the button text if a CLUe is not available for the section or an empty string if the bar is displayed
- Return type
str
-
property
progress_bar¶ Return the progress bar element.
- Returns
the progress bar
- Return type
WebElement
-
property
progress_data¶ Return the progress bar data attributes.
- Returns
the progress bar data attributes
- Return type
dict(str, int or float)
-
property
title¶ Return the book section title.
- Returns
the section title for the bar
- Return type
str
-
property
worked¶ Return the questions worked text.
- Returns
the full text for the number of questions worked for the section
- Return type
str
-
property
-
property
empty_description¶ Return the forecast explanation if the sidebar is empty.
- Returns
Trueif the forecast explanation is empty, elseFalse- Return type
bool
-
property
is_empty¶ Return True if the forecast has not been populated.
- Returns
Trueif the forecast is empty, elseFalse- Return type
bool
-
property
key_guide¶ Access the color guide for the performance bars.
- Returns
the color guide keys for the performance bars
- Return type
list(
Key)
-
practice_my_weakest_topics()[source]¶ Click the ‘Practice my weakest topics’ button.
- Returns
a practice session with assessments from 1 to 4 of the student’s worst performing sections
- Return type
-
property
sections¶ Access the section forecasts.
- Returns
the list of sections in the recent forecast
- Return type
list(
Section)
- :raises
TutorException: if the recent topics forecast is empty
-
property
title¶ Return the forecast sidebar title.
- Returns
the performance forecast sidebar title
- Return type
str
-
class
-
class
Survey(page, root=None)[source]¶ Bases:
pypom.region.RegionA course research survey access card.
-
property
content¶ Return the text content of the survey card.
- Returns
the survey card text
- Return type
str
-
take_survey()[source]¶ Click on the ‘Take Survey’ button.
- Returns
the form for a research study
- Return type
ResearchSurvey
-
property
title¶ Return the survey title.
- Returns
the survey title
- Return type
str
-
property
-
class
Week(page, root=None)[source]¶ Bases:
pypom.region.RegionAssignments listed by week.
-
class
Banner(page, root=None)[source]¶ Bases:
pypom.region.RegionThe title bar for an assignment set.
-
end()[source]¶ Return the week’s ending date.
- Returns
the end date for the week
- Return type
datetime
-
is_upcoming()[source]¶ Return True if a title element is present.
- Returns
Trueif the title is found, elseFalse- Return type
bool
-
-
class
Key(page, root=None)[source]¶ Bases:
pypom.region.RegionAn icon and descriptor for assignment lateness.
-
property
description¶ Return the icon description.
- Returns
the guide description for the icon
- Return type
str
-
property
icon¶ Return the key icon.
- Returns
the guide icon
- Return type
WebElement
-
property
-
property
assignments¶ Access the assignment bars.
- Returns
the list of assignments
- Return type
list(
AssignmentBar)
Access the period bar.
- Returns
the title bar for a particular week
- Return type
Banner
-
property
guide¶ Access the key icons.
- Returns
the list of guide icon descriptions
- Return type
list(
Key)
-
class
-
assignment_bar(name: str, _type: str = None)[source]¶ Return the assignment bar for an assignment.
- Parameters
name (str) – the assignment’s name
_type (str) – (optional) the assignment’s type
- Returns
the assignment status bar
- Return type
AssignmentBar
-
property
assignment_names¶ Return a list of assignment names on the dashboard.
- Returns
the name for each assignment displayed on the current week
- Return type
list(str)
Access the course banner.
- Returns
the course banner region
- Return type
-
property
book_cover¶ Return the reference book cover image URL.
- Returns
the book cover image URL
- Return type
str
-
browse_the_book()[source]¶ Click on the ‘Browse the Book’ link.
- Returns
the reference book view in a new tab
- Return type
-
property
course_term¶ Return the course term.
- Returns
the course semester or quarter
- Return type
str
-
property
course_title¶ Return the course title.
- Returns
the course title
- Return type
str
-
property
loaded¶ Return True when all loading messages are done.
- Returns
Trueif no loading message is found- Return type
bool
-
property
notes¶ Access the notifications.
- Returns
the notification region
- Return type
Notifications
Access the performance forecast sidebar.
- Returns
the performance forecast recent work sidebar
- Return type
-
property
reference_book¶ Return the reference book link element.
- Returns
the reference book element
- Return type
WebElement
-
select_assignment(name: str, _type: str = None)[source]¶ Click on an assignment.
- Parameters
name (str) – the assignment’s name
_type (str) – (optional) the assignment’s type
- Returns
the assignment task page(s)
- Return type
-
view_all_past_work()[source]¶ Click on the ‘ALL PAST WORK’ toggle to view previous work.
- Returns
the course page with the Past Work view active
- Return type
-
view_this_week()[source]¶ Click on the ‘THIS WEEK’ toggle to view current work.
- Returns
the course page with the This Week view active
- Return type
-
wait_for_assignments(max_time: int = 10) → bool[source]¶ Return True if assignments are built within the max time.
As assignments are built when a student enrolls, wait until the ‘pending’ state is gone from the week.
- Parameters
max_time (int) – the maximum number of minutes to wait for any open assignments to be built for the student
- Returns
Trueif thependingstate is removed before the timer runs out- Return type
bool
-
class
pages.tutor.dashboard module¶
The dashboard (course picker) page object.
-
class
pages.tutor.dashboard.Courses(page, root=None)[source]¶ Bases:
pypom.region.RegionCourses sections.
-
class
Course(page, root=None)[source]¶ Bases:
pypom.region.RegionIndividual course cards.
-
property
appearance¶ Return the book tile appearance code.
- Returns
the book tile appearance code
- Return type
str
-
property
book_title¶ Return the textbook title.
- Returns
the course textbook title
- Return type
str
-
copy_this_course()[source]¶ Clone the selected course.
- Returns
the course cloning wizard
- Return type
-
property
course_brand¶ Return the course brand element.
- Returns
the course branding object
- Return type
WebElement
-
property
course_clone¶ Return the course clone button.
- Returns
the course clone button
- Return type
WebElement
-
property
course_id¶ Return the course identification number.
- Returns
the course identification number
- Return type
str
-
property
course_info¶ Return the course data element.
- Returns
the course data object
- Return type
WebElement
-
property
course_type¶ Return the course type.
Most courses will be Tutor, but some Concept Coach courses may still show for old users.
- Returns
the course type
- Return type
str
-
go_to_course()[source]¶ Go to the course page for this course.
- Returns
the calendar (teacher) or current week (student) page for the selected course
- Return type
-
property
is_preview¶ Return True if the course is a preview course.
- Returns
Trueif the course is a preview, elseFalse- Return type
bool
-
property
is_teacher¶ Return True if the current user is a course instructor.
- Returns
Trueif the currently logged in user is an instructor for the course, elseFalse- Return type
bool
-
property
preview_text¶ Return the preview belt explanation text if found.
- Returns
the preview belt text if the course is a preview or an empty string
- Return type
str
-
property
term¶ Return the course term.
- Returns
the course semester or quarter and year
- Return type
str
-
property
title¶ Return the course title.
- Returns
the course title
- Return type
str
-
property
-
property
courses¶ Return a list of course objects.
- Returns
the list of available courses
- Return type
list(
Course)
-
get_course_tile(name: str) → pages.tutor.dashboard.Courses.Course[source]¶ Return a course tile by matching the course name.
- Parameters
name (str) – the course name to match
- Returns
the course picker course tile
- Return type
-
select_course_by_id(course_id)[source]¶ Select a course by the course identification number.
- Parameters
course_id (str) – the course identification number to select
- Returns
the calendar (teacher) or current week (student) page for the selected course
- Return type
-
select_course_by_name(name, ignore_case=False, latest=True)[source]¶ Select a course by the course name.
- Parameters
name (str) – the course name to select
ignore_case (bool) – (optional) match to the case-insensitive value
latest (bool) – (optional) use the most recent course in the option list
- Returns
the calendar (teacher) or current week (student) page for the selected course
- Return type
-
select_course_by_subject(subject)[source]¶ Select a random course by the book subject.
- Parameters
subject (str) – the course subject to select from
- Returns
the calendar (teacher) or current week (student) page for the selected course
- Return type
-
select_course_by_term(term, year=None)[source]¶ Select a random course by the term and year.
- Parameters
term (str) – the semester or quarter to select from
year (str) – (optional) the 4-digit calendar year to select from
- Returns
the calendar (teacher) or current week (student) page for the selected course
- Return type
-
class
-
class
pages.tutor.dashboard.Dashboard(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseThe OpenStax Tutor Beta dashboard.
-
class
NoCourses(page, root=None)[source]¶ Bases:
pypom.region.RegionNo courses were found pane.
-
property
explanation¶ Return the explanation text.
-
property
-
class
Pending(page, root=None)[source]¶ Bases:
pypom.region.RegionThe pending faculty verification pane.
-
property
explanation¶ Return the explanation text.
- Returns
the pending verification explanation content
- Return type
str
-
property
title¶ Return the pending title overlay text.
- Returns
the pending verification title overlay content
- Return type
str
Return the verify now button.
- Returns
the verify button
- Return type
WebElement
-
property
-
URL_TEMPLATE= '/dashboard'¶
-
create_a_course()[source]¶ Select the create course tile.
- Returns
the course creation wizard
- Return type
-
property
current_courses¶ Return the current courses section.
- Returns
the current courses region
- Return type
-
go_to_course(name: str)[source]¶ Go to a specific course.
- Parameters
name (str) – the course name to select
- Returns
the calendar (teacher) or current week (student) page for the specific course
- Return type
- :raises
TutorException: if no previous course or current course exists or if a course does not match
name
-
go_to_first_course()[source]¶ Go to the first course.
- Returns
the calendar (teacher) or current week (student) page for the first course in the list
- Return type
Access the nav region.
- Returns
the general Tutor navigation
- Return type
TutorNav
-
property
no_courses¶ Access the courseless section, if found.
- Returns
the courseless section or None
- Return type
-
property
past_courses¶ Return the past courses section.
- Returns
the past courses region
- Return type
-
property
pending¶ Access the pending verification section, if found.
- Returns
the pending verification text region or None
- Return type
-
property
preview_courses¶ Return the preview courses section.
- Returns
the preview courses region
- Return type
-
property
tooltips¶ Access the tooltips, if found.
- Returns
a tooltip or None
- Return type
Tooltip
-
property
tooltips_displayed¶ Return True when the training wheels are visible.
- Returns
Trueif a training wheel modal is visible, elseFalse- Return type
bool
-
class
pages.tutor.enrollment module¶
Student enrollment.
-
class
pages.tutor.enrollment.BuyAccess(page, root=None)[source]¶ Bases:
pages.tutor.enrollment.ModalThe product purchase modal.
-
class
pages.tutor.enrollment.Enrollment(driver, base_url=None, timeout=10, **url_kwargs)[source]¶ Bases:
pypom.page.PageThe standard student course enrollment (direct URL signup).
-
URL_TEMPLATE= '/enroll/{enrollment_code}/{course_name}-{term}-{year}'¶
-
property
content¶ Return the splash text content.
- Returns
the enrollment introductory text
- Return type
str
-
get_started() → Union[AccountSignup, Enrollment.StudentID][source]¶ Click on the ‘Get Started’ button to begin enrollment.
- Returns
the account signup flow for new users or the student ID assignment for logged in users
- Return type
SignuporStudentID
-
property
loaded¶ Return True if the enrollment introduction is loaded.
- Returns
Trueif the enrollment introduction is loaded, otherwiseFalse- Return type
bool
-
-
class
pages.tutor.enrollment.FreeTrial(page, root=None)[source]¶ Bases:
pages.tutor.enrollment.ModalThe free product trial notice modal.
-
access_your_course() → pages.tutor.course.StudentCourse[source]¶ Click the ‘Access your course’ button.
- Returns
the student course page
- Return type
-
property
content¶ Return the modal content text.
- Returns
the modal content
- Return type
str
-
-
class
pages.tutor.enrollment.IframeModal(page, root=None)[source]¶ Bases:
pages.tutor.enrollment.ModalA dialog box with internal iFrames.
-
class
pages.tutor.enrollment.Modal(page, root=None)[source]¶ Bases:
pypom.region.RegionA page modal.
-
property
root¶ Return the root element for a page modal.
- Returns
the root element for a page modal
- Return type
WebElement
-
property
-
class
pages.tutor.enrollment.PrivacyPolicy(page, root=None)[source]¶ Bases:
pages.tutor.enrollment.ModalThe privacy policy enrollment modal.
-
property
content¶ Return the modal body text.
- Returns
the modal body text
- Return type
str
-
property
heading¶ Return the modal heading.
- Returns
the privacy policy modal heading
- Return type
str
-
i_agree() → Union[pages.tutor.enrollment.BuyAccess, pages.tutor.course.StudentCourse][source]¶ Click on the ‘I agree’ button.
After clicking on the I agree button, one of two destinations are possible:
the student course page with the product purchase modal open for paid courses
the student course page without a modal open for existing students in a free course
- Returns
the course page with the product purchase modal displayed
- Return type
-
property
loaded¶ Return True when ‘Terms of Service’ is found on the page.
- Returns
Truewhen the terms of service is found in the page text- Return type
bool
-
property
title¶ Return the modal title.
- Returns
the privacy policy modal title
- Return type
str
-
property
-
class
pages.tutor.enrollment.PurchaseConfirmation(page, root=None)[source]¶ Bases:
pages.tutor.enrollment.IframeModalThe Tutor product purchase confirmation.
-
access_your_course() → pages.tutor.course.StudentCourse[source]¶ Click the ‘Access your course’ continuation button.
- Returns
the student course page
- Return type
-
property
content¶ Return the order completion text.
- Returns
the text content at the top of the order confirmation pane
- Return type
str
-
property
loaded¶ Return True when the content is present in the iframe.
- Returns
Truewhen the content in the payment confirmation iframe is present- Return type
bool
-
property
order_date¶ Return the order date.
- Returns
the order date
- Return type
str
-
property
order_number¶ Return the order identification number.
- Returns
the order number
- Return type
str
-
property
price¶ Return the product price.
- Returns
the product price
- Return type
str
-
property
product¶ Return the purchased product name.
- Returns
the product name
- Return type
str
-
property
tax¶ Return the tax total.
- Returns
the total tax applied to the order
- Return type
str
-
property
tax_type¶ Return the tax type.
- Returns
the type of tax being applied
- Return type
str
-
property
total¶ Return the order’s total cost.
- Returns
the total cost of the purchase
- Return type
str
-
-
class
pages.tutor.enrollment.PurchaseForm(page, root=None)[source]¶ Bases:
pages.tutor.enrollment.IframeModalThe Tutor product purchase form.
-
property
address¶ Return the current address.
- Returns
the value in the address field
- Return type
str
-
property
billing_zip_code¶ Return the current billing zip code.
- Returns
the value in the billing zip code field
- Return type
str
-
cancel() → pages.tutor.enrollment.FreeTrial[source]¶ Click on the ‘Cancel’ purchase button.
- Returns
the free trial activation modal
- Return type
-
property
card_number¶ Return the current credit card number.
- Returns
the value in the credit card number field
- Return type
str
-
property
city¶ Return the current city.
- Returns
the value in the city field
- Return type
str
-
property
cvv¶ Return the current card verification number.
- Returns
the value in the card verification field
- Return type
str
-
property
error_messages¶ Return any active input field error messages.
- Returns
a list of error messages present in the purchase form
- Return type
list(str)
-
property
expiration_date¶ Return the current expiration date.
- Returns
the value in the expiration date field
- Return type
str
-
property
loaded¶ Return True when the form fields are found.
- Returns
Truewhen the form fields and iframes are found- Return type
bool
-
property
mailing_zip¶ Return the current mailing zip code.
- Returns
the value in the zip code field
- Return type
str
-
property
price¶ Return the product price.
- Returns
the product pre-tax price
- Return type
str
-
property
product¶ Return the product name.
- Returns
the purchased product name
- Return type
str
-
property
product_title¶ Return the product title being purchased.
- Returns
the product title
- Return type
str
-
purchase() → pages.tutor.enrollment.PurchaseConfirmation[source]¶ Click on the ‘Purchase’ Tutor button.
- Returns
the purchase confirmation modal or the error message for a failed transaction
- Return type
- Raises
TutorExceptionif error messages are found
-
property
state¶ Return the current state.
- Returns
the currently selected state
- Return type
str
-
property
tax¶ Return the tax amount.
- Returns
the tax amount, if applicable, otherwise ‘–’
- Return type
str
-
property
tax_type¶ Return the tax type.
- Returns
the type of tax being applied
- Return type
str
-
property
total¶ Return the total post-tax price.
- Returns
the total amount due (product price + tax amount)
- Return type
str
-
property
-
class
pages.tutor.enrollment.StudentID(driver, base_url=None, timeout=10, **url_kwargs)[source]¶ Bases:
pypom.page.PageEnter the student’s identification number.
-
URL_TEMPLATE= '/enroll/start/{enrollment_code}'¶
-
add_it_later() → Union[pages.tutor.enrollment.PrivacyPolicy, pages.tutor.enrollment.BuyAccess][source]¶ Click on the ‘Add it later’ link.
After clicking on the add it later button, one of two destinations are possible:
the student course page with the privacy policy modal open
the student course page with the product purchse modal open
- Returns
the course page with the privacy policy or product purchse modal displayed
- Return type
-
property
course_name¶ Return the course name associated with the enrollment code.
- Returns
the course name
- Return type
str
-
property
loaded¶ Return True when the student ID badge element is found.
- Returns
Truewhen the student ID icon is found- Return type
bool
-
property
student_id¶ Return the student ID field.
- Returns
the student ID field
- Return type
WebElement
-
-
class
pages.tutor.enrollment.Terms(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseThe terms of use and privacy policy acceptance page.
-
i_agree() → pages.tutor.enrollment.StudentID[source]¶ Agree to the terms of use and the privacy policy.
- Returns
the student identification number entry
- Return type
-
property
loaded¶ Return True when the policies are displayed.
- Returns
Truewhen the terms of use and privacy policy are shown.- Return type
bool
-
property
modal¶ Access the Terms modal.
- Returns
the combined policy modal
- Return type
-
pages.tutor.home module¶
Tutor Home page objects.
-
class
pages.tutor.home.TutorHome(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorLoginBaseThe Tutor root page.
Bases:
pages.tutor.base.FooterThe Tutor root page footer.
Click on the GDPR link to view the GDPR on Rice’s webpage.
- Returns
the General Data Privacy Regulation page on Rice University’s webpage in a new tab
- Return type
-
property
description¶ Return the descriptive Tutor overview text.
- Returns
the overview description
- Return type
str
-
learn_more()[source]¶ Click on the ‘LEARN MORE’ link to view the marketing page.
- Returns
the OpenStax Tutor marketing page on openstax.org
- Return type
-
log_in(username, password)[source]¶ Log into Tutor with a specific user.
- Parameters
username (str) – the user to log in as
password (str) – the user’s password
- Returns
the user’s dashboard
- Return type
-
property
logged_in¶ Return True if the user is logged into Tutor.
- Returns
Trueif the user is logged into Tutor, elseFalse- Return type
bool
-
service_pass_through()[source]¶ Click the log in button for an active Accounts user.
- Returns
the user’s dashboard
- Return type
- :raises
NoSuchElementException: if the login bar is not found
-
property
title¶ Return the slogan text.
- Returns
the OpenStax Tutor Beta marketing slogan
- Return type
str
pages.tutor.legal module¶
Tutor externally available terms of use and privacy policy.
-
class
pages.tutor.legal.Policies(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorLoginBaseThe Tutor site general legal policies.
Bases:
pages.tutor.base.NavThe terms base navigation.
Click the ‘LOG IN’ button.
- Returns
the Accounts log in page
- Return type
-
class
Policies(page, root=None)[source]¶ Bases:
pypom.region.RegionThe body containing the OpenStax policies.
-
PRIVACY_POLICY= 1¶
-
TERMS_OF_USE= 0¶
-
property
description¶ Return the policy explanation.
- Returns
the policy page description and explanation
- Return type
str
-
property
policies¶ Return the policy sections.
- Returns
the list of policy sections
- Return type
list(
WebElement)
-
property
privacy_policy¶ Return the privacy policy.
- Returns
the privacy policy text
- Return type
str
-
property
terms_of_use¶ Return the terms of use.
- Returns
the terms of use text
- Return type
str
-
property
title¶ Return the policy page title.
- Returns
the policy page title
- Return type
str
-
-
property
description¶ Return the policy page explanation text.
- Returns
the policy page description
- Return type
str
-
property
policies¶ Access the main page text.
- Returns
the policies page content
- Return type
-
property
privacy_policy¶ Return the privacy policy text.
- Returns
the privacy policy content
- Return type
str
-
property
terms_of_use¶ Return the terms of use policy text.
- Returns
the terms of use content
- Return type
str
-
property
title¶ Return the policy page title.
- Returns
the policy page title
- Return type
str
pages.tutor.new_course module¶
The Tutor course creation wizard.
-
class
pages.tutor.new_course.CloneCourse(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseClone an existing course.
-
class
Details(page, root=None)[source]¶ Bases:
pypom.region.RegionProvide student information.
-
property
error¶ Return the input error message, if present.
- Returns
the error message when the number of sections is greater than 10 or the number of students is greater than 1,500
- Return type
str
-
property
explanation¶ Return the course size estimation explanation.
- Returns
the course size estimation explanation
- Return type
str
-
property
loaded¶ Return True when the course details fields are found.
- Returns
Truewhen the course sections and estimated students fields are found.- Return type
bool
- Noindex
-
property
sections¶ Return the initial number of course sections or periods.
- Returns
the requested number of course sections to automatically create or 0 if the value is not set
- Return type
int
-
property
students¶ Return the expected number of students.
- Returns
the projected number of students who will enroll in the course or 0 if the value is not set
- Return type
int
-
property
-
class
Name(page, root=None)[source]¶ Bases:
pypom.region.RegionChoose the course title or name.
-
property
loaded¶ Return True when the course name input box is found.
- Returns
Truewhen the course name field is found- Return type
bool
- Noindex
-
property
name¶ Return the current value for the new course title.
- Returns
the new course’s name
- Return type
str
-
property
timezone¶ Return the currently selected timezone.
- Returns
the current timezone string
- Return type
str
-
property
-
class
Term(page, root=None)[source]¶ Bases:
pypom.region.RegionSelect the course term.
-
class
Term(page, root=None)[source]¶ Bases:
pypom.region.RegionA course term.
-
property
selected¶ Return True if the term is currently selected.
- Returns
Trueif the term is selected, otherwiseFalse- Return type
bool
-
property
term¶ Return the semester or quarter.
- Returns
the semester or quarter name
- Return type
str
-
property
year¶ Return the term year.
- Returns
the term year
- Return type
int
-
property
-
property
loaded¶ Return True when course semesters/quarters are found.
- Returns
Truewhen course term options are found- Return type
bool
- Noindex
-
select_by_term(term: str) → None[source]¶ Select a term by the semester or quarter name.
- Parameters
term (str) – the term to select
- Returns
None
- :raises
TutorException: if the term is not found or is not available
-
property
terms¶ Access the available course terms.
- Returns
the list of course terms available for new courses
- Return type
list(
Term)
-
class
-
property
details¶ Access the new course details pane.
- Returns
the new course’s section request and student estimate pane
- Return type
-
property
heading¶ Return the heading text.
- Returns
the entire text heading
- Return type
str
-
property
is_course_estimate¶ Return True if on the course estimation step.
- Returns
Trueif on the course estimation step,Falseif not- Return type
bool
-
property
loaded¶ Return True when the new course wizard root is found.
- Returns
Truewhen the new course wizard root element is located- Return type
bool
-
property
name¶ Access the new course name pane.
- Returns
the new course’s name and timezone selection pane
- Return type
-
class
-
class
pages.tutor.new_course.NewCourse(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.new_course.CloneCourseCreate a new Tutor course.
-
class
BaseCourse(page, root=None)[source]¶ Bases:
pypom.region.RegionSelect the course to clone.
-
class
Course(page, root=None)[source]¶ Bases:
pypom.region.RegionA previous course.
-
property
name¶ Return the existing course name.
- Returns
the course name
- Return type
str
-
property
term¶ Return the existing course semester/quarter and year.
- Returns
the course term
- Return type
str
-
property
-
property
courses¶ Access the previous course options.
- Returns
the list of available courses to clone
- Return type
list(
Course)
-
property
loaded¶ Return True when a previous course option is found.
- Returns
Truewhen at least one course clone base is found- Return type
bool
- Noindex
-
class
-
class
Course(page, root=None)[source]¶ Bases:
pypom.region.RegionSelect the course book.
-
class
Book(page, root=None)[source]¶ Bases:
pypom.region.RegionAn available course book.
-
property
appearance¶ Return the book appearance code.
- Returns
the book appearance code
- Return type
str
-
property
is_selected¶ Return True if the book is currently selected.
- Returns
Trueif the book is the current course selection, otherwiseFalse- Return type
bool
-
property
title¶ Return the book title.
- Returns
the book title
- Return type
str
-
property
-
property
books¶ Access the course book options.
- Returns
the list of available books
- Return type
list(
Book)
-
property
loaded¶ Return True when the book options list is populated.
- Returns
Truewhen at least one book option is found- Return type
bool
- Noindex
-
class
-
class
NewOrClone(page, root=None)[source]¶ Bases:
pypom.region.RegionCreate a new course or clone an existing course.
-
clone_a_past_course() → None[source]¶ Clone an existing course.
Select the option to clone an existing course.
- Returns
None
-
create_a_new_course() → None[source]¶ Create a new course.
Select the option to create a new course.
- Returns
None
-
property
loaded¶ Return True when the new course option is found.
- Returns
Truewhen the ‘Create a new course’ option is found- Return type
bool
- Noindex
-
-
property
clone_possible¶ Return True if a previous course can be cloned.
- Returns
Trueif a previous course exists and can be cloned, otherwiseFalse- Return type
bool
-
property
cloned_from¶ Access the new course details pane.
- Returns
the new course’s section request and student estimate pane
- Return type
-
property
course¶ Access the new course course pane.
- Returns
the new course’s section request and student estimate pane
- Return type
-
property
new_or_clone¶ Access the new course details pane.
- Returns
the new course’s section request and student estimate pane
- Return type
-
class
pages.tutor.performance module¶
The instructor’s course settings page.
-
class
pages.tutor.performance.BookSection(page, root=None)[source]¶ Bases:
pypom.region.RegionA book chapter or book section performance listing.
-
property
count¶ Return the worked assessments text.
- Returns
the worked assessments for students or the the number of students and their worked assessments for teachers
- Return type
str
-
property
number¶ Return the chapter or section number.
- Returns
the book chapter number or the individual section number
- Return type
str
-
practice()[source]¶ Click on the progress bar or work more button.
- Returns
a new practice session for a chapter, section, or the weakest topics or return the performance forecast for instructors
- Return type
-
property
progress¶ Return the progress value or no data statement.
- Returns
the rounded CLUe value from 0 to 100 or the ‘Not enough’ data message
- Return type
str
-
property
stats¶ Return the debugging CLUe data.
- Returns
the CLUe data as key: value pairs
- Return type
dict(str, str)
-
property
title¶ Return the chapter or section title.
- Returns
the book chapter title or the individual section title
- Return type
str
-
property
-
class
pages.tutor.performance.PerformanceForecast(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseThe performance forecast page.
-
class
Bar(page, root=None)[source]¶ Bases:
pypom.region.RegionA progress bar.
-
property
color¶ Return the background color for a bar.
- Returns
the background color value
- Return type
str
-
property
key¶ Return the key text.
- Returns
the text description for a bar color
- Return type
str
-
property
-
class
Guide(page, root=None)[source]¶ Bases:
pypom.region.RegionThe performance guide weakest guide and chapters.
-
class
Chapter(page, root=None)[source]¶ Bases:
pypom.region.RegionAn individual book chapter row.
-
property
chapter¶ Access the chapter performance data.
- Returns
the chapter performance data
- Return type
-
property
sections¶ Access the chapter sections performance data.
- Returns
the list of assigned chapter sections performance data
- Return type
list(
BookSection)
-
property
-
class
Weakest(page, root=None)[source]¶ Bases:
pypom.region.RegionThe sections with the worst performance.
-
property
explanation¶ Return the explanation text for the ‘Weakest Areas’.
- Returns
the Weakest Areas explanation
- Return type
str
-
property
lack_data¶ Return the “haven’t worked enough problems” message.
- Returns
the “haven’t worked enough problems” message, if found, else an empty string
- Return type
str
-
practice_all()[source]¶ Click the ‘Practice All’ button to start a practice session.
- Returns
a practice session for the weakest book sections or the performance forecast if there isn’t enough data to determine the weakest book sections or the user is a teacher
- Return type
-
property
sections¶ Access the row’s book section groups.
- Returns
the list of poorest performing book sections
- Return type
list(
BookSection)
-
property
title¶ Return the row title.
- Returns
the row title
- Return type
str
-
property
-
class
-
class
Section(page, root=None)[source]¶ Bases:
pypom.region.RegionA course section or period tab.
-
property
name¶ Return the section or period name.
- Returns
the section or period name
- Return type
str
-
select()[source]¶ Click on the section tab.
- Returns
the performance forecast with the selected section active
- Return type
-
property
selected¶ Return True if the tab is currently active.
- Returns
Trueif the tab is active,Falseotherwise- Return type
bool
-
property
-
property
forecast¶ Access the performance forecast rows.
- Returns
the forecast panels
- Return type
- :raise
TutorException: if the guide is not found
-
go_back()[source]¶ Return to the previous page.
Clicking on the ‘Back to …’ button returns the user to the previously visited Tutor page, which is often the student’s course page or the teacher’s calendar.
- Returns
None
-
property
guide¶ Access the colored bar guide.
- Returns
the list of possible bar colors and their associated keys
- Return type
list(
Bar)
-
property
loaded¶ Return True when the performance forecast is loaded.
- Returns
Trueif no loading messages or elements are found- Return type
bool
-
property
no_data¶ Return the ‘no questions worked’ message, if found.
- Returns
the ‘no questions worked’ message if found, otherwise an empty string
- Return type
str
-
property
section_tabs¶ Access the section or period tabs.
- Returns
the list of available sections or periods
- Return type
-
property
title¶ Return the page title.
- Returns
the page title
- Return type
str
-
class
pages.tutor.practice module¶
An OpenStax Tutor Beta practice session.
-
class
pages.tutor.practice.ButtonTooltip(page, root=None)[source]¶ Bases:
pypom.region.RegionThe assessment explanation tooltips.
-
property
description¶ Return the tooltip content.
- Returns
the tooltip text content
- Return type
str
-
property
root¶ Locate the tooltip trunk.
- Returns
the root element for a tooltip
- Return type
WebElement
-
property
-
class
pages.tutor.practice.Practice(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.task.HomeworkA practice session.
Bases:
pypom.region.RegionThe practice session footer.
Click the ‘Back to …’ button.
Clicking the button will return the student to the page they followed to get to the practice session; that may be either the student course page or the student’s performance forecast.
- Returns
the student course page or the performance forecast
- Return type
Return the practice session title.
- Returns
the practice session title
- Return type
str
-
class
FreeResponse(page, root=None)[source]¶ Bases:
pypom.region.RegionA free response assessment step.
-
property
free_response¶ Return the current content of the free response text box.
- Returns
the free response content
- Return type
str
-
property
nudge_shown¶ Return True if the answer validation message is displayed.
If the nudge message is displayed, then the free response failed answer validation.
- Returns
Trueif the validation message is displayed, otherwiseFalse
-
property
-
class
MultipleChoice(page, root=None)[source]¶ Bases:
pypom.region.RegionA multiple choice assessment step.
-
class
Answer(page, root=None)[source]¶ Bases:
pypom.region.RegionAn assessment answer choice.
-
property
answer¶ Return the answer content.
- Returns
the answer content text
- Return type
str
-
property
is_selected¶ Return True if the answer option is currently selected.
- Returns
Trueif the answer is selected, otherwiseFalse- Return type
bool
-
property
letter¶ Return the answer option letter.
- Returns
the answer letter
- Return type
str
-
property
question_id¶ Return the assessment question identification number.
- Returns
the question ID number
- Return type
int
-
property
-
property
answers¶ Access the multiple choice answers.
- Returns
the list of available answer options
- Return type
list(
Answer)
-
property
instructions¶ Return the assessment instructions.
- Returns
the assessment instructions
- Return type
str
-
class
Bases:
pypom.region.RegionThe practice session assessment navigation.
Bases:
pypom.region.RegionA practice session step icon.
Return True if this step is currently active.
- Returns
Trueif the step is active and displayed, otherwiseFalse- Return type
bool
Return the step’s position.
- Returns
the step’s positon within the practice session
- Return type
int
Click the icon to view the practice step.
- Returns
the practice session with the selected step in the practice window
- Return type
Return the step identification number.
- Returns
the step ID number
- Return type
int
Access the completion/final step.
- Returns
the completion step
- Return type
Access the practice session steps.
- Returns
the list of available assessment steps
- Return type
list(
Icon)
-
answer() → pages.tutor.practice.Practice[source]¶ Submit the answer.
- Returns
the next step in the practice session
- Return type
- :raises
TutorException: if the answer button is disabled
-
property
answer_enabled¶ Return True if the ‘Answer’ button is enabled.
- Returns
Trueif the Answer button is clickable, otherwiseFalse- Return type
bool
-
property
exercise_id¶ Return the exercise identification number for the assessment.
- Returns
the Exercise ID number and version
- Return type
str
-
property
exercises¶ Return the number of practice assessments.
- Returns
the number of assessments in this practice session
- Return type
int
Access the practice assignment footer.
- Returns
the footer region
- Return type
-
property
has_free_response¶ Return True if the assessment has a free response text box.
- Returns
Trueif a free response textbox is present, elseFalse- Return type
bool
-
property
is_personalized¶ Return True if the assessment is personalized to the user.
- Returns
Trueif the assessment is personalized, otherwiseFalse- Return type
bool
-
property
loaded¶ Return True when all loading messages are done.
- Returns
Trueif no loading message is found- Return type
bool
-
property
personalized_tooltip¶ Hover over the personalized badge info icon to show the help text.
- Returns
the personalized assessment tooltip
- Return type
-
property
question¶ Access the step-type features of the assessment.
- Returns
the inner assessment function - either multiple choice or a free response
- Return type
-
property
section¶ Return the assessment’s associated chapter section.
- Returns
the chapter and section containing the answer to the current assessment
- Return type
str
-
property
section_title¶ Return the assessment’s associated chapter section title.
- Returns
the title for the book section containing the answer to the current assessment
- Return type
str
-
property
stem¶ Return the question stem content.
- Returns
the question stem text content
- Return type
str
-
property
stimulus¶ Return the assessment stimulus if present.
- Returns
the assessment stimulus if present or an empty string if not
- Return type
str
pages.tutor.preview module¶
The instructor’s student preview.
-
class
pages.tutor.preview.StudentPreview(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseThe student assignment preview.
pages.tutor.reference module¶
The Tutor reference view of the textbook.
-
class
pages.tutor.reference.ReferenceBook(driver, base_url=None, timeout=10, **url_kwargs)[source]¶ Bases:
pypom.page.PageThe complete textbook reading experience.
-
class
Content(page, root=None)[source]¶ Bases:
pypom.region.RegionThe selected section’s content.
-
property
content¶ Return the HTML book content.
- Returns
the full HTML markup of the current section content
- Return type
str
-
next()[source]¶ Click on the next page button.
- Returns
the reference book with the next section in the content region if not at the book’s end
- Return type
-
property
next_page_arrow¶ Return the next page arrow button.
- Returns
the next page button
- Return type
WebElement
-
property
page_data¶ Return the ecosystem page data.
- Returns
the current section ecosystem data
- Return type
str
-
previous()[source]¶ Click on the previous page button.
- Returns
the reference book with the previous section in the content region if not at the book’s beginning
- Return type
-
property
previous_page_arrow¶ Return the previous page arrow button.
- Returns
the previous page button
- Return type
WebElement
-
property
-
class
Highlights(page, root=None)[source]¶ Bases:
pypom.region.RegionThe highlighting summary page overlay.
-
class
Note(page, root=None)[source]¶ Bases:
pypom.region.RegionAn individual highlight or annotation.
-
cancel_edit()[source]¶ Click on the X cancelation button.
- Returns
the reference book with the highlighting summary page open
- Return type
-
property
content¶ Return the full HTML content text.
- Returns
the highlighted content with full markup
- Return type
str
-
delete()[source]¶ Delete the highlight.
- Returns
the reference book with the highlighting summary page open
- Return type
-
edit(text='')[source]¶ Edit the highlight note.
- Parameters
text (str) – new text for the highlight’s note
- Returns
the reference book with the highlighting summary page open
- Return type
-
property
note¶ Return the associated note, if found.
- Returns
the highlight’s associated note
- Return type
str
-
property
note_box¶ Return the note edit box.
- Returns
the highlight’s note editing box
- Return type
WebElement
-
save_edit()[source]¶ Click on the checkmark confirm button.
- Returns
the reference book with the highlighting summary page open
- Return type
-
-
property
description¶ Return the page description if no notes are available.
- Returns
the empty highlighting summary text
- Return type
str
-
property
drop_down¶ Return the section selector drop down menu.
- Returns
the book section multi-select drop down
- Return type
WebElement
Return True if the section drop down menu is open.
- Returns
Trueif the multi-select drop down menu is open, elseFalse- Return type
bool
Click on the drop down menu.
- Returns
the reference book with the highlighting summary page open
- Return type
-
property
notes¶ Access each displayed highlight or annotation.
- Returns
a list of displayed highlights and annotations
- Return type
-
property
options¶ Return the list of sections with highlights.
- Returns
the list of sections with highlights and/or annotations
- Return type
list(
DisplaySection)
-
show_print_preview()[source]¶ Click on the ‘Print this page’ button.
- Returns
the print preview pop up window
- Return type
PrintPreview
-
show_sections(sections=[], show_all=False)[source]¶ Select sections by section number.
- Parameters
sections (list(str)) – a list of book section highlights to display
show_all (bool) – (optional) select all available sections
- Returns
the reference book with the highlighting summary page open
- Return type
-
class
Bases:
pypom.region.RegionThe reference book navigation controls.
Click on the ToC toggle button.
- Returns
the reference book
- Return type
Click on the highlight summary page toggle.
- Returns
the reference book
- Return type
Return True if the instructor toggle is available.
- Returns
Trueif the user is an instructor, elseFalse- Return type
bool
Return True if the ToC is open.
- Returns
Trueif the table of contents is currently displayed, elseFalse- Return type
bool
Return the table of contents toggle button.
- Returns
the open/close toggle for the table of contents
- Return type
WebElement
Return True if the highlight summary page is visible.
- Returns
Trueif the highlighting summary page is visible, elseFalse- Return type
bool
Return the highlighting summary toggle button.
- Returns
the open/close toggle for the highlighting summary
- Return type
WebElement
Return the pop over text if found or a blank string.
- Returns
the content of a pop over box or a blank string if no pop over is present
- Return type
str
Return the currently displayed section title.
- Returns
the title for the currently selected section
- Return type
str
Click on the teacher content toggle.
- Returns
the reference book
- Return type
Return the instructor content display toggle.
- Returns
the activate/deactivate toggle for instructor content or None for a student
- Return type
WebElement
-
class
TableOfContents(page, root=None)[source]¶ Bases:
pypom.region.RegionThe reference book table of contents.
-
class
Chapter(page, root=None)[source]¶ Bases:
pypom.region.RegionA single book chapter list in the table of contents.
-
class
Section(page, root=None)[source]¶ Bases:
pypom.region.RegionA single book section including unnumbered pieces.
-
property
display_line¶ Return the entire section line text.
- Returns
the merged section number and section title text as displayed
- Return type
str
-
property
section_id¶ Return the section identification.
- Returns
the section identification
- Return type
str
-
property
title¶ Return the section title.
- Returns
the section title
- Return type
str
-
property
-
property
number¶ Return the chapter number.
- Returns
the book chapter number
- Return type
str
-
property
sections¶ Access the chapter sections.
- Returns
a list of sections within the chapter
- Return type
list(:py:class: ~ReferenceBook.TableOfContents.Chapter.Section)
-
property
title¶ Return the chapter title.
- Returns
the book chapter title
- Return type
str
-
class
-
class
-
property
content¶ Access the currently selected section’s book content.
- Returns
the current section content
- Return type
-
property
highlights¶ Access the highlighting summary page.
- Returns
the highlight/annotation summary page
- Return type
Access the reference book navigation bar.
- Returns
the reference book navigation bar region
- Return type
-
property
table_of_contents¶ Access the table of contents.
- Returns
the table of contents for the book
- Return type
-
class
pages.tutor.review module¶
The assignment review.
-
class
pages.tutor.review.Metrics(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseThe assignment review metrics.
-
class
Assessment(page, root=None)[source]¶ Bases:
pypom.region.RegionAn assignment question.
-
class
Answer(page, root=None)[source]¶ Bases:
pypom.region.RegionAn answer to the parent question.
-
property
answered_by¶ Return the number of students who selected this answer.
- Returns
the number of students who selected this answer option
- Return type
int
-
property
content¶ Return the answer text.
- Returns
the answer text
- Return type
str
-
property
is_correct¶ Return True if this answer is correct.
- Returns
Trueif this answer is correct for the assessment- Return type
bool
-
property
letter¶ Return the answer letter.
- Returns
the answer letter
- Return type
str
-
property
-
property
answers¶ Access the assessment answers.
- Returns
the list of available assessment answers
- Return type
list(
Answer)
-
property
assessment_id¶ Return the Exercises identification number and version.
- Returns
the OpenStax Exercises identification number and assessment version for the question
- Return type
str
-
property
question_stem¶ Return the assessment question stem content.
- Returns
the question stem text
- Return type
str
-
class
-
class
Sidebar(page, root=None)[source]¶ Bases:
pypom.region.RegionThe review metrics assignment overview sidebar.
-
class
Stats(page, root=None)[source]¶ Bases:
pypom.region.RegionThe sidebar section stats.
-
class
BookSection(page, root=None)[source]¶ Bases:
pypom.region.RegionThe stats for a single book section.
-
property
correct¶ Return the percentage who responded correctly.
- Returns
the percentage of questions from the section that were answered correctly
- Return type
str
-
property
incorrect¶ Return the percentage who responded incorrectly.
- Returns
the percentage of questions from the section that were answered incorrectly
- Return type
str
-
property
section_number¶ Return the section number.
- Returns
the book section number
- Return type
str
-
property
section_title¶ Return the section title.
- Returns
the book section title
- Return type
str
-
property
-
property
completed¶ Return the number of students who have completed the work.
- Returns
the number of students who have completed the assignment
- Return type
int
-
property
current_topics¶ Access the stats for current assignment topics.
- Returns
the list of book section stats specified by the instructor in the assignment
- Return type
list(
BookSection)
-
property
in_progress¶ Return the number of students who have started the work.
- Returns
the number of students who have started but not completed the assignment
- Return type
int
-
property
not_started¶ Return the number of students who have not started the work.
- Returns
the number of students who have not started the assignment
- Return type
int
-
property
spaced_practice¶ Access the stats for spaced practice topics.
- Returns
the list of book section stats selected by Tutor in the assignment
- Return type
list(
BookSection)
-
class
-
class
Tab(page, root=None)[source]¶ Bases:
pypom.region.RegionA course section or period selection tab.
-
property
is_selected¶ Return True if the course section is currently selected.
- Returns
Trueif the course section is active- Return type
bool
-
property
name¶ Return the course section name or title.
- Returns
the course section name or title
- Return type
str
-
property
-
class
-
class
Toolbar(page, root=None)[source]¶ Bases:
pypom.region.RegionThe assignment navigation toolbar.
-
property
assignment_name¶ Return the assignment title or name.
- Returns
the assignment title or name
- Return type
str
-
back_to_calendar() → Union[pages.tutor.calendar.Calendar, pages.tutor.scores.Scores][source]¶ Click the ‘Back to Calendar’ button.
-
property
-
property
exercises¶ Access the assignment questions.
-
is_displayed() → bool[source]¶ Return True if the assignment metrics page is displayed.
- Returns
Trueif the metrics page is displayed- Return type
bool
-
property
loaded¶ Return True when the metrics columns are found.
- Returns
Truewhen the assessments column and the sidebar are found- Return type
bool
-
property
sections¶ Return the list of book sections in the assignment and review.
- Returns
the list of book section numbers with their titles found in the assignment or in spaced practice assessments
- Return type
list(str)
Access the review metrics overview and section selector.
- Returns
the sidebar
- Return type
-
class
pages.tutor.roster module¶
The instructor’s course roster management page.
-
class
pages.tutor.roster.AddInstructor(page, root=None)[source]¶ Bases:
pages.tutor.roster.ModalThe add instructor modal.
-
property
url¶ Return the registration URL for other instructors.
- Returns
the registration URL needed for other instructors and TAs to join the course as teachers
- Return type
str
-
property
url_input¶ Return the input containing the registration link input element.
- Returns
the registration URL input box
- Return type
WebElement
-
property
-
class
pages.tutor.roster.AddSection(page, root=None)[source]¶ Bases:
pages.tutor.roster.ModalAdd a new section or period to the course.
-
add()[source]¶ Click the ‘Add’ button.
Note
If the section_name matches an existing section (case-sensitive), an HTML 422 error will be thrown by Tutor; server errors are not handled by the automation code.
- Returns
the course roster with the new section displayed in the available tabs
- Return type
-
property
section_name¶ Return the section name input box.
- Returns
the section name input box element
- Return type
WebElement
-
-
class
pages.tutor.roster.ChangeSection(page, root=None)[source]¶ Bases:
pages.tutor.roster.TooltipMove a student to another section tooltip.
-
class
Section(page, root=None)[source]¶ Bases:
pypom.region.RegionAn available section for a student.
-
property
name¶ Return the section name.
- Returns
the section name
- Return type
str
-
property
-
property
sections¶ Return the list of available other sections.
- Returns
the course roster
- Return type
-
switch_to(section_name)[source]¶ Select a new section for the current student.
Note
section/period names are case sensitive (e.g. ‘1st’ and ‘1ST’ can occur in the same course)
- Parameters
section_name (str) – the new section for the student
- Returns
the course roster
- Return type
- Raises
TutorException – if the section_name does not match an active course section or period name
-
class
-
class
pages.tutor.roster.CourseRoster(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseThe Tutor course roster.
-
class
Roster(page, root=None)[source]¶ Bases:
pypom.region.RegionThe student roster tables.
-
class
Section(page, root=None)[source]¶ Bases:
pypom.region.RegionA section or period tab.
-
property
is_active¶ Return True if the section is currently displayed.
- Returns
Trueif the section is displayed elseFalse- Return type
bool
-
property
name¶ Return the section or period name.
- Returns
the section or period name
- Return type
str
-
property
-
class
Student(page, root=None)[source]¶ Bases:
pages.tutor.roster.UserA student row with actions.
-
add_back_to_active_roster(return_tooltip=False)[source]¶ Re-add the dropped student to the active roster.
- Parameters
return_tooltip (bool) – (optional) return the re-add tooltip instead of re-adding the student
- Returns
the add back tooltip if return_tooltip is
Trueelse the course roster- Return type
-
change_section(section=None)[source]¶ Move the student to a new section.
- Parameters
section (str) – (optional) the student’s new section or period
- Returns
the change section tooltip if section is not provided else the course roster
- Return type
- :raises
TutorException: if no section or period matches the requested section
-
drop(drop_student=True)[source]¶ Click the ‘Drop’ button.
- Returns
the course roster if drop_student is
True, otherwise the drop student tooltip- Return type
-
property
name¶ Return the student’s full name.
- Returns
the student’s first and last name
- Return type
str
-
property
student_id¶ Return the student’s identification number.
- Returns
the student ID number
- Return type
str
-
-
add_section(name=None)[source]¶ Add a new section or period to the course.
Note
If the name matches an existing section (case-sensitive), an HTML 422 error will be thrown by Tutor; server errors are not handled by the automation code.
If name is not provided, open and return the Add Section modal. If it is provided, add the new section or period to the course and return the course roster.
- Parameters
name (str) – (optional) the section or period name
- Returns
the Add Section modal if name is not provided or the course roster if name is provided
- Return type
-
property
current_section¶ Return the name of the currently selected course section.
- Returns
the current course section name
- Return type
str
-
delete_section(delete=True)[source]¶ Delete the current section or period.
- Parameters
delete (bool) – (optional) if
True, delete the current section or period; ifFalseopen and return the Delete Section modal- Returns
the Delete Section modal if delete is
Falseor the course roster if delete isTrue- Return type
-
property
dropped_students¶ Access the dropped student rows.
- Returns
the list of dropped students
- Return type
list(
Student)
-
rename_section(name=None)[source]¶ Rename a current course section or period.
Note
If the name matches an existing section (case-sensitive), an HTML 422 error will be thrown by Tutor; server errors are not handled by the automation code.
If name is not provided, open and return the Rename Section modal. If it is provided, rename the current section or period and return the course roster.
- Parameters
name (str) – (optional) the section or period name
- Returns
the Rename Section modal if name is not provided or the course roster if name is provided
- Return type
-
property
sections¶ Return the list of available course sections or periods.
- Returns
the list of course section tabs
- Return type
list(
Section)
-
select_section(name=None, position=1)[source]¶ Select a section or period tab by name or position.
Note
section/period names are case sensitive (e.g. ‘1st’ and ‘1ST’ can occur in the same course)
- Parameters
name (str) – (optional) the section or period name to select
position (int) – (optional) the position of the section or period tab to select from 1 to the number of tabs
- Returns
the course roster displaying the selected course section roster
- Return type
- :raises
TutorException: if the name does not match an existing tab name or if the position is not between 1 and number of active tabs
-
class
-
class
Teachers(page, root=None)[source]¶ Bases:
pypom.region.RegionThe ‘Instructors’ table.
-
class
Teacher(page, root=None)[source]¶ Bases:
pages.tutor.roster.UserAn instructor row with actions.
-
add_instructor()[source]¶ Click the ‘Add Instructor’ link.
- Returns
the open AddInstructor modal
- Return type
-
get_instructor(first_name=None, last_name=None, position=None)[source]¶ Return the instructor row based on their name or position.
- Parameters
first_name (str) – (optional) match the instructor row by the first match on the teacher’s first name
last_name (str) – (optional) match the instructor row by the first match on the teacher’s last name
position (int) – (optional) select the instructor row by the row position (e.g.
position = 1is the first instructor)
- Returns
the instructor row
- Return type
- Raises
TutorException – if a match isn’t found
-
class
-
property
course_name¶ Return the course name.
- Returns
the course name
- Return type
str
-
property
course_term¶ Return the course term.
- Returns
the course term
- Return type
str
-
property
instructors¶ Access the ‘Instructors’ table.
- Returns
the instructors table region
- Return type
-
property
loaded¶ Return True when the instructor list is populated.
- Returns
Truewhen at least one instructor is found- Return type
bool
-
property
title¶ Return the page title.
- Returns
the page title
- Return type
str
-
class
-
class
pages.tutor.roster.DeleteSection(page, root=None)[source]¶ Bases:
pages.tutor.roster.ModalDelete an existing section.
Note
Sections are not deleted; they are archived and may be reactivated by a Tutor administrator in the admin console.
-
class
pages.tutor.roster.DropStudent(page, root=None)[source]¶ Bases:
pages.tutor.roster.TooltipDrop a current student from the course tooltip.
-
class
pages.tutor.roster.Modal(page, root=None)[source]¶ Bases:
pypom.region.RegionA pop up modal with overlay.
-
close()[source]¶ Click the close link or ‘x’ button to close the modal.
- Returns
the course roster
- Return type
-
property
description¶ Return the modal description.
- Returns
the description within the modal body, if found, else an empty string
- Return type
str
-
property
title¶ Return the modal title.
- Returns
the modal title
- Return type
str
-
property
warning¶ Return the modal warning text.
- Returns
the warning text within the modal body, if found, else an empty string
- Return type
str
-
-
class
pages.tutor.roster.ReAddStudent(page, root=None)[source]¶ Bases:
pages.tutor.roster.TooltipRe-add a dropped student to the active roster tooltip.
-
class
pages.tutor.roster.RemoveInstructor(page, root=None)[source]¶ Bases:
pages.tutor.roster.TooltipRemove a current course instructor tooltip.
-
class
pages.tutor.roster.RenameSection(page, root=None)[source]¶ Bases:
pages.tutor.roster.AddSectionEdit an existing section’s name.
-
property
current_name¶ Return the existing section’s name.
- Returns
the text currently held in the input box’s value field
- Return type
str
-
property
-
class
pages.tutor.roster.Tooltip(page, root=None)[source]¶ Bases:
pypom.region.RegionA limited page tooltip action box.
-
property
request¶ Return the action description text found in the header.
- Returns
the action description
- Return type
str
-
property
-
class
pages.tutor.roster.User(page, root=None)[source]¶ Bases:
pypom.region.RegionA base user row for teachers and students.
-
property
first_name¶ Return the user’s first name.
- Returns
the user’s first name
- Return type
str
-
property
last_name¶ Return the user’s last name/surname.
- Returns
the user’s last name
- Return type
str
-
property
pages.tutor.scores module¶
The student and instructor scores page.
-
class
pages.tutor.scores.LateWork(page, root=None)[source]¶ Bases:
pages.tutor.scores.TooltipAn instructor late work tool tip.
-
property
heading¶ Return the tool tip heading.
- Returns
the tool tip heading
- Return type
str
-
property
status¶ Return the status percentage.
- Returns
the status percentage number out of 100
- Return type
int
-
property
title¶ Return the status lead in.
- Returns
the status lead in title - either the score on the due date or the score on the last day of work
- Return type
str
-
property
-
class
pages.tutor.scores.Progress(page, root=None)[source]¶ Bases:
pages.tutor.scores.TooltipA progress tool tip.
-
property
completion¶ Return the completion percentage.
- Returns
the assignment completion percentage out of 100
- Return type
int
-
property
number¶ Return the number complete out of the total possible.
- Returns
the number of completed questions out of the total possible
- Return type
str
-
property
-
class
pages.tutor.scores.Scores(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseThe shared scores page elements.
-
class
Section(page, root=None)[source]¶ Bases:
pypom.region.RegionA section or period tab.
-
property
name¶ Return the tab/section/period name.
- Returns
the tab name
- Return type
str
-
property
-
class
Table(page, root=None)[source]¶ Bases:
pypom.region.RegionThe scores table.
-
class
Heading(page, root=None)[source]¶ Bases:
pypom.region.RegionThe table column headings and average information region.
-
class
AssignmentInfo(page, root=None)[source]¶ Bases:
pypom.region.RegionAn assignment column header.
-
property
assignment_average¶ Return the assignment average.
- Returns
the assignment average for readings and homeworks or the click-on-time percentage for externals
- Return type
int
-
property
assignment_type¶ Return the assignment type.
- Returns
the assignment type
- Return type
str
-
property
due_on¶ Return the date the assignment is or was due.
- Returns
the assignment due date as a ‘month/date’ string
- Return type
str
-
property
name¶ Return the assignment name.
- Returns
the assignment name
- Return type
str
-
property
progress_sort¶ Return the progress sort toggle button.
- Returns
the assignment progress sort toggle
- Return type
WebElement
-
property
progress_sorted¶ Return the sort type currently on the progress column.
- Returns
what sort option is affecting the progress column
- Return type
ASCENDINGorDESCENDINGorNO_SORT
-
property
score_sort¶ Return the score sort toggle button.
- Returns
the assignment score sort toggle
- Return type
WebElement
-
property
scores_sorted¶ Return the sort type currently on the name column.
- Returns
what sort option is affecting the name column
- Return type
ASCENDINGorDESCENDINGorNO_SORT
-
property
-
property
assignments¶ Access the assignment column headers.
- Returns
a list of assignment headers
- Return type
list(
AssignmentInfo)
-
property
averages_open¶ Return True if the ‘Averages’ panel is open.
- Returns
Trueif the averages panel is open elseFalse- Return type
bool
-
property
averages_toggle¶ Return the hide and show averages toggle button.
- Returns
the ‘Averages’ column set header show/hide toggle
- Return type
WebElement
-
property
course_average¶ Return the current class average.
- Returns
the current class average out of 100, if available
- Return type
int or str
-
property
homework_average_progress¶ Return the current homework progress average.
- Returns
the current homework progress average out of 100, if available
- Return type
int or str
-
property
homework_average_score¶ Return the current homework score average.
- Returns
the current homework score average out of 100, if available
- Return type
int or str
-
property
name_sort¶ Return the name sort toggle button.
- Returns
the ‘Overall’ column header and sort toggle
- Return type
WebElement
-
property
names_sorted¶ Return the type of sort currently on the name column.
- Returns
what sort option is affecting the name column
- Return type
ASCENDINGorDESCENDINGorNO_SORT
-
property
reading_average_progress¶ Return the current reading progress average.
- Returns
the current reading progress average out of 100, if available
- Return type
int or str
-
property
reading_average_score¶ Return the current reading score average.
- Returns
the current reading score average out of 100, if available
- Return type
int or str
-
sort_by_name()[source]¶ Sort the table by last name.
- Returns
the scores table sorted by last name
- Return type
-
toggle_averages()[source]¶ Open or close the ‘Averages’ columns.
- Returns
the scores table
- Return type
-
class
-
class
Student(page, root=None)[source]¶ Bases:
pypom.region.RegionA student row.
-
class
Assignment(page, root=None)[source]¶ Bases:
pypom.region.RegionA student assignment result.
-
property
assignment_type¶ Return the assignment type.
- Returns
the assignment type
- Return type
str
-
property
has_late_work¶ Return True if the assignment has late work.
- Returns
Trueif the student worked at least part of the assignment after the assignment came due, elseFalse- Return type
bool
-
property
late_work_accepted¶ Return True if the late work has been accepted.
- Returns
Trueif an instructor has accepted the late work as the new grade, elseFalse- Return type
bool
-
progress_tooltip()[source]¶ Hover over progress and save the tooltip info.
- Returns
the progress information
- Return type
TODO
-
property
score¶ Return the assignment score.
- Returns
the assignment score, whether an external has been clicked, or dashes if no work has been done
- Return type
int or str
-
view_late_work_tooltip()[source]¶ Click on the late work caret.
Click on the late work caret to open the late work tooltip.
- Returns
the late work pop over tooltip
- Return type
-
property
-
property
assignments¶ Access the individual student assignments.
- Returns
a list of student assignment performance results
- Return type
list(
Assignment)
-
property
course_average¶ Return the student’s course average.
- Returns
the student’s current course grade or N/A if unavailable
- Return type
int or str
-
property
homework_progress¶ Return the student’s homework progress average.
- Returns
the student’s current progress score average or N/A is unavailable
- Return type
int or str
-
property
homework_score¶ Return the student’s homework score average.
- Returns
the student’s current homework score average or N/A if unavailable
- Return type
int or str
-
property
name¶ Return the student’s name.
- Returns
the student’s name
- Return type
str
-
performance_forecast() → pages.tutor.performance.PerformanceForecast[source]¶ View the performance forecast for the student.
- Returns
the performance forecast for the individual student
- Return type
PerformanceForecast
-
property
reading_progress¶ Return the student’s reading progress average.
- Returns
the student’s current reading progress average or N/A if unavailable
- Return type
int or str
-
property
reading_score¶ Return the student’s reading score average.
- Returns
the student’s current reading score average or N/A if unavailable
- Return type
int or str
-
property
student_id¶ Return the student’s ID number.
- Returns
the student’s ID number
- Return type
str
-
class
-
property
heading¶ Access the scores table heading information.
- Returns
the table heading region
- Return type
-
property
legend¶ Return the legend text, if found.
- Returns
the legend text or a blank string if not found
- Return type
str
-
class
-
property
active_show_as¶ Return the currently selected show as option.
- Returns
Tutor.AS_PERCENTAGEorTutor.AS_NUMBER- Return type
str
-
back_to_dashboard()[source]¶ Click on the ‘Manage student access’ or ‘Back to dashboard’ button.
- Returns
the course settings page (teacher), the current week (student), the course calendar (teacher), or the scores page if the link/button is not found
- Return type
SettingsorStudentCourseorCalendarorScoresBase
-
course_settings(use_button=False)¶ Click on the ‘Course settings’ or ‘dashboard’ link.
- Parameters
use_button (bool) – (optional) use the ‘Back to dashboard’ or ‘Manage student access’ button instead of the links
- Returns
the course settings page (teacher), the current week (student), the course calendar (teacher), or the scores page if the link/button is not found
- Return type
SettingsorStudentCourseorCalendarorScoresBase
-
dashboard(use_button=False)[source]¶ Click on the ‘Course settings’ or ‘dashboard’ link.
- Parameters
use_button (bool) – (optional) use the ‘Back to dashboard’ or ‘Manage student access’ button instead of the links
- Returns
the course settings page (teacher), the current week (student), the course calendar (teacher), or the scores page if the link/button is not found
- Return type
SettingsorStudentCourseorCalendarorScoresBase
-
property
explanation¶ Return the explanation text.
For situations where there are either no students or no assignments.
- Returns
the explanation text for when data is not possible or an empty string when there is data in the table
- Return type
str
-
export()[source]¶ Click on the download button to export the scores worksheet.
- Returns
the scores page
- Return type
-
property
export_message¶ Return the export scores message text.
- Returns
the text to the right of the export button; may include the last date and time the scores were exported
- Return type
str
-
property
is_teacher¶ Return True if the current user is an instructor.
- Returns
Trueif the current user is a teacher and has access to the instructor controls, elseFalse- Return type
bool
-
property
loaded¶ Return True when the scores table is found.
- Returns
Truewhen the score table is loaded.- Return type
bool
-
manage_student_access()¶ Click on the ‘Manage student access’ or ‘Back to dashboard’ button.
- Returns
the course settings page (teacher), the current week (student), the course calendar (teacher), or the scores page if the link/button is not found
- Return type
SettingsorStudentCourseorCalendarorScoresBase
-
property
modal_open¶ Return True if a modal is found open.
- Returns
Trueif a modal is found
-
property
sections¶ Return the list of course sections.
- Returns
the list of course sections or periods
- Return type
list(
Section)
-
show_as_number()[source]¶ Click the ‘#’ button to show scores as numbers.
- Returns
the scores page
- Return type
StudentScoresorScores
-
show_as_percentage()[source]¶ Click the ‘%’ button to show scores as percentages.
- Returns
the scores page
- Return type
StudentScoresorScores
-
property
title¶ Return the page title.
- Returns
the scores page title
- Return type
str
-
property
toast_seen¶ Return True if a toast-style popup is seen.
- Returns
Trueif a toast-style popup message is displayed and then closed- Return type
bool
-
view_section(by_name=None, by_id=None)[source]¶ Click on the section tab to view the section or period report.
- Parameters
by_name (str) – view a specific section by its name
by_id (int) – view a specific section by its order ID from 1 to the number of sections in the course
- Returns
the scores page with the selected tab visible
- Return type
- :raises
TutorException: if a section is not found to match by_name
-
class
-
class
pages.tutor.scores.SetWeights(page, root=None)[source]¶ Bases:
pages.tutor.scores.WeightsThe instructor’s set weights modal.
-
cancel()[source]¶ Click the ‘Cancel’ button to close the weights dialog.
- Returns
the scores page
- Return type
-
property
homework_progress¶ Return the current homework progress weight value.
- Returns
the value of the homework progress weight out of 100 or 0 if the value is missing/blank
- Return type
int
-
property
homework_progress_input¶ Return the homework progress input box.
- Returns
the homework progress input element
- Return type
WebElement- Noindex
-
property
homework_score¶ Return the current homework score weight value.
- Returns
the value of the homework score weight out of 100 or 0 if the value is missing/blank
- Return type
int
-
property
homework_score_input¶ Return the homework score input box.
- Returns
the homework score input element
- Return type
WebElement- Noindex
-
property
reading_progress¶ Return the current reading progress weight value.
- Returns
the value of the reading progress weight out of 100 or 0 if the value is missing/blank
- Return type
int
-
property
reading_progress_input¶ Return the reading progress input box.
- Returns
the reading progress input element
- Return type
WebElement- Noindex
-
property
reading_score¶ Return the current reading score weight value.
- Returns
the value of the reading score weight out of 100 or 0 if the value is missing/blank
- Return type
int
-
property
reading_score_input¶ Return the reading score input box.
- Returns
the reading score input element
- Return type
WebElement- Noindex
-
restore_default()[source]¶ Reset the weight to their default.
- Returns
the set weights modal
- Return type
- :raises
TutorException: if values are set to thier defaults and the restore button is not available
-
save()[source]¶ Click the ‘Save’ button if the weights are valid.
- Returns
the scores page
- Return type
-
see_why()[source]¶ Click on the ‘See why’ link to view the weights blog post.
- Returns
the blog entry on openstax.org in a new tab describing why homework scores and reading progress are the suggested metrics to use for Tutor
- Return type
-
set(weights: List[int]) → None[source]¶ Assign weights to each assignment category.
- Parameters
weights (list(int)) – the whole number percentages for each category in order - homework score, homework progress, reading score, reading progress; if less that 4 numbers are provided, default remaining values to 0; list elements beyond 4 will be ignored
- Returns
None
-
property
status¶ Return the status message.
- Returns
the status message
- Return type
str
-
property
status_message¶ Return the status message element.
- Returns
the status message element
- Return type
WebElement- Noindex
-
property
weights_are_valid¶ Return True if the sum of the weights equals 100.
- Returns
Trueif the sum of the weight values is 100, elseFalse- Return type
bool
-
-
class
pages.tutor.scores.Tooltip(page, root=None)[source]¶ Bases:
pypom.region.RegionA scores pop up tool tip.
-
class
pages.tutor.scores.ViewWeights(page, root=None)[source]¶ Bases:
pages.tutor.scores.WeightsThe student’s weights review modal.
-
property
homework_progress¶ Return the weight for homework completeness.
- Returns
the weight for homework progress out of 100
- Return type
int
-
property
homework_score¶ Return the weight for homework scores.
- Returns
the weight for homework scores out of 100
- Return type
int
-
property
reading_progress¶ Return the weight for reading completeness.
- Returns
the weight for reading progress out of 100
- Return type
int
-
property
reading_score¶ Return the weight for reading scores.
- Returns
the weight for reading scores out of 100
- Return type
int
-
property
weights¶ Return the currently assigned weights.
- Returns
the set of weights for homework scores, homework progress, reading scores, and reading progress
- Return type
list(int)
-
property
-
class
pages.tutor.scores.Weights(page, root=None)[source]¶ Bases:
pypom.region.RegionThe scores page weight scoring.
-
close(x=False)[source]¶ Click on the ‘Close’, ‘x’, or ‘Cancel’ button.
- Parameters
x (bool) – (optional)
Trueif using the ‘x’ close button- Returns
the scores page
- Return type
ScoresorStudentScores
- :raises
TutorException: if an instructor tries to use the ‘x’ close button
-
property
heading¶ Return the modal heading.
- Returns
the set weights modal heading
- Return type
str
-
is_displayed()[source]¶ Return True if the weights modal root is found.
- Returns
Trueif the weights modal is found- Return type
bool
-
property
root¶ Return the weights modal root element.
- Returns
the modal root element
- Return type
WebElement
-
pages.tutor.settings module¶
The instructor’s course settings page.
-
class
pages.tutor.settings.ChangeCourseTimezone(page, root=None)[source]¶ Bases:
pages.tutor.settings.CourseSettingsModalThe timezone change modal.
-
class
Timezone(page, root=None)[source]¶ Bases:
pypom.region.RegionA timezone option for a course.
-
is_current()[source]¶ Return True if the timezone is currently selected.
- Returns
Trueif the timezone option is currently selected, elseFalse- Return type
bool
-
property
name¶ Return the timezone name or region name.
- Returns
the name or affected region for the timezone setting
- Return type
str
-
-
property
active¶ Return the currently selected timezone.
- Returns
the current timezone in use by the course
- Return type
-
property
preview¶ Return the preview time if using the selected timezone.
- Returns
the preview time format if the selected timezone is accepted
- Return type
str
-
select_timezone(timezone='Central Time (US & Canada)')[source]¶ Select a timezone from the available radio options.
- Parameters
timezone (str) – (optional) the new timezone, defaults to
CENTRAL_TIME- Returns
the timezone modal
- Return type
- :raise
utils.tutor.TutorException: if the timezone does not match an available option
-
class
-
class
pages.tutor.settings.Component(page, root=None)[source]¶ Bases:
pypom.region.RegionA key or other data needed for LMS integration.
-
property
name¶ Return the component’s name.
- Returns
the component name
- Return type
str
-
property
value¶ Return the key value or URL of the component.
- Returns
the value of the component
- Return type
str
-
property
-
class
pages.tutor.settings.CourseSettings(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseThe Tutor course settings page.
-
class
DatesAndTime(page, root=None)[source]¶ Bases:
pypom.region.RegionThe course settings dates and time panel.
-
property
course_dates¶ Return the start and end date text.
- Returns
the start and end date text string
- Return type
str
-
edit_timezone()[source]¶ Click on the edit icon nex to the course timezone.
- Returns
the change course timezone modal
- Return type
-
property
end¶ Return the course end date.
- Returns
the course ending date string
- Return type
str
-
property
start¶ Return the course start date.
- Returns
the course starting date string
- Return type
str
-
property
term¶ Return the course term.
- Returns
the course term
- Return type
str
-
property
timezone¶ Return the assigned course timezone.
- Returns
the course timezone
- Return type
str
-
property
-
class
StudentAccess(page, root=None)[source]¶ Bases:
pypom.region.RegionThe course settings student access panel split.
This is a pass-through region to select the correct setup for the course.
-
class
DirectAccess(page, root=None)[source]¶ Bases:
pypom.region.RegionDirect student enrollment links.
-
property
information¶ Return the enrollment information help text.
- Returns
the direct link explanation text
- Return type
str
-
property
sections¶ Access the individual section URLs.
- Returns
the list of available section or period enrollment URLs
- Return type
list(
Section)
-
property
title¶ Return the section title.
- Returns
the panel section title
- Return type
str
-
property
-
class
DirectLinksOnly(page, root=None)[source]¶ Bases:
pypom.region.RegionThe LMS option is not available for the course.
-
class
Enrolled(page, root=None)[source]¶ Bases:
pypom.region.RegionThe LMS option is enabled and students have registered.
-
property
explanation¶ Return the enrollment explanation for LMS students.
- Returns
the enrollment explanation for LMS students
- Return type
str
-
property
-
class
LMS(page, root=None)[source]¶ Bases:
pypom.region.RegionLMS access.
-
property
controls¶ Access the keys and values to use LMS integration.
- Returns
the keys, secrets, URL controls necessary to integrate with the selected LMS system
- Return type
list(
Component)
-
how_do_i_integrate_with()[source]¶ Access the Salesforce LMS integration walkthrough.
- Returns
the LMS integration walkthrough on Salesforce
- Return type
-
property
information¶ Return the enrollment information help text.
- Returns
the direct link explanation text
- Return type
str
-
property
title¶ Return the section title.
- Returns
the panel section title
- Return type
str
-
property
-
property
panel¶ Return the correct subclass panel.
- Returns
the subpanel according to the course settings
- Return type
DirectAccessorDirectLinksOnlyorEnrolledorLMS
-
class
-
property
content¶ Access the main page content.
- Returns
the student access content or the dates and times content
- Return type
-
property
course_name¶ Return the course name.
- Returns
the course name
- Return type
str
-
edit_course_name()[source]¶ Click on the edit icon next to the course name.
- Returns
the course rename modal
- Return type
-
property
loaded¶ Return True when the settings page active nav tab is found.
- Returns
Truewhen the internal active nav tab is found- Return type
bool
-
property
page_title¶ Return the page title.
- Returns
the page title
- Return type
str
-
property
tabs¶ Access the page tabs.
- Returns
the student access and dates and time tabs
- Return type
list(
Tab)
-
property
term¶ Return the course term.
- Returns
the course term
- Return type
str
-
class
-
class
pages.tutor.settings.CourseSettingsModal(page, root=None)[source]¶ Bases:
pypom.region.RegionThe base model for course settings modals.
-
close(x_button=False)[source]¶ Click the ‘Close’, ‘Cancel’, ‘Rename’, ‘Save’, or ‘x’ button.
- Parameters
x_button (bool) – if
Trueuse the ‘x’ button in the upper right of the modal, otherwise use the footer button- Returns
the course settings page
- Return type
-
property
title¶ Return the modal title.
-
-
class
pages.tutor.settings.DirectLinks(page, root=None)[source]¶ Bases:
pages.tutor.settings.CourseSettingsModalThe use ‘Direct links instead of LMS integration’ modal.
-
cancel()[source]¶ Click on the ‘Cancel’ button.
Close the modal without changing the enrollment option.
- Returns
the course settings page
- Return type
-
property
description¶ Return the modal body content.
- Returns
the text explaining what will happen if LMS integration is deactivated
- Return type
str
-
-
class
pages.tutor.settings.LMSKeyPairings(page, root=None)[source]¶ Bases:
pages.tutor.settings.CourseSettingsModalKey pairings review modal.
-
property
controls¶ Access the keys and values to use LMS integration.
- Returns
the keys, secrets, URL controls necessary to integrate with the selected LMS system
- Return type
list(
Component)
-
how_do_i_integrate_with()[source]¶ Access the Salesforce LMS integration walkthrough.
- Returns
the LMS integration walkthrough on Salesforce
- Return type
-
property
instructions¶ Return the integration instructions.
- Returns
the basic LMS integration instructions
- Return type
str
-
property
-
class
pages.tutor.settings.RenameCourse(page, root=None)[source]¶ Bases:
pages.tutor.settings.CourseSettingsModalThe course renaming modal.
-
property
name¶ Return the course name.
- Returns
the current value of the course name input text box
- Return type
str
-
property
-
class
pages.tutor.settings.Section(page, root=None)[source]¶ Bases:
pypom.region.RegionSection information.
-
property
enrollment_url¶ Return the enrollment URL for the section or period.
- Returns
the enrollment URL
- Return type
str
-
property
name¶ Return the section name.
- Returns
the section or period name
- Return type
str
-
property
-
class
pages.tutor.settings.Tab(page, root=None)[source]¶ Bases:
pypom.region.RegionA section tab.
-
property
is_open¶ Return True if the tab is currently selected.
- Returns
Trueif the tab is currently active, elseFalse- Return type
bool
-
property
name¶ Return the name listed on the tab.
- Returns
the name of the tab
- Return type
str
-
property
-
class
pages.tutor.settings.Vendor(page, root=None)[source]¶ Bases:
pypom.region.RegionAn LMS vendor.
-
property
company¶ Return the LMS vendor’s company name.
- Returns
the LMS company name
- Return type
str
-
property
is_active¶ Return True if the LMS vendor is currently selected.
- Returns
Tureif the vendor is currently selected elseFalse- Return type
bool
-
property
short_name¶ Return the internal vendor short name.
- Returns
the LMS company short name
- Return type
str
-
property
pages.tutor.task module¶
Student assignment tasks.
Externals, Events, Homeworks, and Readings
-
class
pages.tutor.task.Assignment(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.base.TutorBaseThe shared assignment features.
-
class
Content(page, root=None)[source]¶ Bases:
pypom.region.RegionA placeholder for the assignment body.
-
property
assignment_complete¶ Return True if the assignment completion step is displayed.
- Returns
Trueif the assignment completion card is displayed- Return type
bool
-
property
has_correct_answer¶ Return True if the correct answer is displayed.
- Returns
Trueif the correct answer is displayed; may include answer feedback- Return type
bool
-
property
is_assessment¶ Return True if the current step is an assessment.
- Returns
Trueif an assessment is displayed in the content frame- Return type
bool
-
property
is_free_response¶ Return True if the current step contains a free response box.
- Returns
Trueif the current assignment step contains a free response text box- Return type
bool
-
property
is_interstitial¶ Return True if the current step is a transition car.
- Returns
Trueif an interstitial card is displayed in the content- Return type
bool
-
property
is_multiple_choice¶ Return True if the current shows multiple choice answers.
- Returns
Trueif the current assignment step contains mutliple choice answers- Return type
bool
-
property
Bases:
pypom.region.RegionThe assignment footer.
Click the ‘Back to Dashboard’ button.
- Returns
the student course page
- Return type
Return the assignment due date.
https://docs.python.org/3.7/library/datetime.html #strftime-and-strptime-behavior
- Returns
the assignment due date as a string with the format “due %a, %b %d, %Y %I:%M %p”
- Return type
str
Return the assignment name.
- Returns
the assignment name
- Return type
str
Bases:
pypom.region.RegionA placeholder for the assignment navigation bar.
-
property
assignment_type¶ Return the assignment type.
- Returns
the assignment type
- Return type
str
-
property
body¶ Access the assignment content and assessments.
- Returns
the region housing the assignment content and assessments
- Return type
-
property
debug_information¶ Return the debugging information for the current page.
- Returns
the group of debugging keys and values for the current page, task, or assessment
- Return type
dict(str, str)
Access the assignment footer content.
- Returns
the assignment footer
- Return type
-
property
loaded¶ Return True when the various loading panes are gone.
- Returns
Truewhen the various loading message panes/SVGs are not found- Return type
bool
Access the assignment navigaton bar.
- Returns
the assignment navigation bar for readings and homeworks
- Return type
Navor None
-
class
-
class
pages.tutor.task.Event(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.task.AssignmentA calendar event.
-
class
Content(page, root=None)[source]¶ Bases:
pypom.region.RegionThe interactive assignment body.
-
back_to_dashboard() → pages.tutor.course.StudentCourse[source]¶ Click on the ‘Back to Dashboard’ button in the assignment body.
- Returns
the student course page
- Return type
-
property
description¶ Return the assignment description, if present.
- Returns
the assignment description, if found, otherwise an empty string
- Return type
str
-
property
name¶ Return the assignment name.
- Returns
the assignment name.
- Return type
str
-
-
class
-
class
pages.tutor.task.External(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.task.AssignmentAn assignment found outside of OpenStax Tutor Beta.
-
class
Content(page, root=None)[source]¶ Bases:
pypom.region.RegionThe interactive assignment body.
-
property
assignment_url¶ Return the external URL for the assignment.
- Returns
the assignment URL
- Return type
str
-
property
description¶ Return the assignment description, if present.
- Returns
the assignment description, if found, otherwise an empty string
- Return type
str
-
go_to_assignment() → str[source]¶ Click on the assignment URL.
- Returns
the assignment URL
- Return type
str
-
property
name¶ Return the assignment name.
- Returns
the assignment name.
- Return type
str
-
property
-
class
-
class
pages.tutor.task.Homework(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.task.AssignmentA collection of assessments selected by the course instructor.
-
class
Content(page, root=None)[source]¶ Bases:
pages.tutor.task.ContentThe assessment pane.
-
back_to_dashboard(other_destination: bool = False) → pages.tutor.course.StudentCourse[source]¶ Click on the ‘Back to Dashboard’ button.
- Parameters
other_destination (bool) – if
True, skip the return to the student course- Returns
the student course page
- Return type
- Raises
TutorException: if the reading assignment is not at the completion card (final) step
-
back_to_performance_forecast() → pages.tutor.performance.PerformanceForecast[source]¶ Click on the ‘Back to Performance Forecast’ button.
- Returns
the student performance forecast
- Return type
- Raises
TutorException: if the practice session is not at the completion card (final) step
-
property
is_two_step_intro¶ Return True if the two-step introduction is displayed.
- Returns
Trueif the two-step question intersticial card is the current step- Return type
bool
-
property
pane¶ Access the question pane.
- Returns
the assessment question pane
- Return type
MultipartQuestionorFreeResponseorMultipleChoice- Raises
TutorExceptionif the assessment root element isn’t found
-
Bases:
pypom.region.RegionThe homework step navigation.
Bases:
pypom.region.RegionA homework step, review, or completion.
Return True if the step is answered.
- Returns
Trueif the step is answered, otherwiseFalse- Return type
bool
Return the correctness for the step.
- Returns
the correctness (answered correctly or incorrectly) of the step if past the due date and answered
CORRECTorINCORRECTorNOT_ANSWEREDorNOT_GRADED- Return type
str
Return the exercise step index.
- Returns
the exercise step index number or
-1for non- exercise steps- Return type
int
Return True if the step is currently selected and active.
- Returns
Trueif the step is active and displayed in the body, otherwiseFalse- Return type
bool
Select the step to display it in the main body.
- Returns
the homework assignment with the selected step active
- Return type
Return the selection type for the assessment.
- Returns
the selection type for the assessment question or
NOT_A_QUESTIONfor an interstitial card; standard responses will beCOREorPERSONALIZEDorSPACED_PRACTICE- Return type
str
Return the step identification number.
- Returns
the homework step ID number
- Return type
str
Return the step type.
- Returns
the step type
EXERCISEorREVIEW_CARDorEND_CARD- Return type
str
Return the homework step title.
- Returns
the homework step title
- Return type
str
Access the individual homework steps.
- Returns
the list of available steps
- Return type
list(
Step)
-
class
-
class
pages.tutor.task.Reading(driver, base_url=None, timeout=60, **url_kwargs)[source]¶ Bases:
pages.tutor.task.AssignmentA collection of book sections selected by the course instructor.
-
class
AnnotationBox(page, root=None)[source]¶ Bases:
pypom.region.RegionThe annotation creation and edit box.
-
delete() → pages.tutor.task.Reading[source]¶ Click the delete annotation trashcan button.
- Returns
the current reading task step
- Return type
-
is_displayed() → bool[source]¶ Return True if the slide out edit box is displayed.
- Returns
Truewhen the slide out edit box is open- Return type
bool
-
next() → pages.tutor.task.Reading.AnnotationBox[source]¶ Click the next annotation down arrow button.
- Returns
the following annotation/highlight if one exists
- Return type
-
previous() → pages.tutor.task.Reading.AnnotationBox[source]¶ Click the previous annotation up arrow button.
- Returns
the previous annotation/highlight if one exists
- Return type
-
save() → pages.tutor.task.Reading[source]¶ Click the save annotation checkmark button.
- Returns
the current reading task step
- Return type
-
see_all() → pages.tutor.task.Reading.Highlights[source]¶ Click the ‘See all’ annotations button.
- Returns
the highlighting summary page
- Return type
-
property
text¶ Return the current annotation text.
- Returns
the current annotation text
- Return type
str
-
-
class
Content(page, root=None)[source]¶ Bases:
pages.tutor.task.ContentThe reading assignment body.
-
class
Caption(page, root=None)[source]¶ Bases:
pypom.region.RegionAn image caption.
-
property
number¶ Return the caption’s figure number.
- Returns
the figure number
- Return type
str
-
property
text¶ Return the caption text content.
- Returns
the caption text
- Return type
str
-
property
-
back_to_dashboard() → pages.tutor.course.StudentCourse[source]¶ Click on the ‘Back to Dashboard’ button.
- Returns
the student course page
- Return type
- :raises
TutorException: if the reading assignment is not at the completion card (final) step
-
property
captions¶ Return a list of image captions found on the page.
- Returns
the list of picture captions
- Return type
list(
Caption)
-
property
loading_view¶ Return True if the latest step is still loading.
- Returns
Trueif the loading card is found.- Return type
bool
-
next_page() → pages.tutor.task.Reading[source]¶ Click on the right arrow button.
- Returns
the next step in the reading assignment
- Return type
-
property
next_page_arrow¶ Return the next page transition arrow element.
- Returns
the next page arrow
- Return type
WebElement
-
property
next_page_available¶ Return True if the next page arrow is available.
- Returns
Trueif the next page transition arrow is available- Return type
bool
-
property
pane¶ Access the body content.
- Returns
the text for a reading page, a free response assessment step, or a multiple choice assessment step
- Return type
str or
FreeResponseorMultipleChoice
-
property
paragraphs¶ Return a list of paragraphs found on the page.
- Returns
the list of paragraphs
- Return type
list(str)
-
class
-
class
Highlights(page, root=None)[source]¶ Bases:
pypom.region.RegionThe highlighting summary page.
-
class
Note(page, root=None)[source]¶ Bases:
pypom.region.RegionAn individual highlight or annotation.
-
cancel_edit() → pages.tutor.task.Reading.Highlights[source]¶ Click on the X cancelation button.
- Returns
the highlighting summary page
- Return type
-
property
content¶ Return the full HTML content text.
- Returns
the highlighted content with full markup
- Return type
str
-
delete() → pages.tutor.task.Reading.Highlights[source]¶ Delete the highlight.
- Returns
the highlighting summary page
- Return type
-
edit(text='') → pages.tutor.task.Reading.Highlights[source]¶ Edit the highlight note.
- Parameters
text (str) – new text for the highlight’s note
- Returns
the highlighting summary page
- Return type
-
property
note¶ Return the associated note, if found.
- Returns
the highlight’s associated note
- Return type
str
-
property
note_box¶ Return the note edit box.
- Returns
the highlight’s note editing box
- Return type
WebElement
-
save_edit() → pages.tutor.task.Reading.Highlights[source]¶ Click on the checkmark confirm button.
- Returns
the highlighting summary page
- Return type
-
-
property
description¶ Return the page description if no notes are available.
- Returns
the empty highlighting summary text
- Return type
str
-
property
drop_down¶ Return the section selector drop down menu.
- Returns
the book section multi-select drop down
- Return type
WebElement
-
is_displayed() → bool[source]¶ Return True when the main page is hidden.
- Returns
Truewhen the main content is not displayed- Return type
bool
Return True if the section drop down menu is open.
- Returns
Trueif the multi-select drop down menu is open, elseFalse- Return type
bool
-
property
notes¶ Access each displayed highlight or annotation.
- Returns
a list of displayed highlights and annotations
- Return type
list(
Note)
-
property
options¶ Return the list of sections with highlights.
- Returns
the list of sections with highlights and/or annotations
- Return type
list(
DisplaySection)
-
show_print_preview() → regions.tutor.print_preview.PrintPreview[source]¶ Click on the ‘Print this page’ button.
- Returns
the print preview pop up window
- Return type
PrintPreview
-
show_sections(sections=[], show_all=False) → pages.tutor.task.Reading.Highlights[source]¶ Select sections by section number.
- Parameters
sections (list(str)) – a list of book section highlights to display
show_all (bool) – (optional) select all available sections
- Returns
the highlighting summary page open
- Return type
-
class
-
class
Milestones(page, root=None)[source]¶ Bases:
pypom.region.RegionThe reading step milestone chart.
-
class
Milestone(page, root=None)[source]¶ Bases:
pypom.region.RegionA milestone card.
-
property
correct¶ Return the correctness for exercise steps.
- Returns
the correctness for an exercise step or None for other steps
- Return type
str or None
-
property
index¶ Return the milestone index.
- Returns
the milestone card’s index within the assignment starting from zero (0)
- Return type
int
-
property
is_complete¶ Return True if the step is complete.
- Returns
Trueif the reading step is complete, otherwiseFalse- Return type
bool
-
property
preview¶ Return the card preview text.
- Returns
the milestone preview card text
- Return type
str
-
property
status_element¶ Return the milestone status element.
- Returns
the milestone status element
- Return type
WebElement
-
property
step_type¶ Return the card step type.
- Returns
the step type represented by the card
- Return type
str
- :raises
TutorException: if a matching card type isn’t found within the information element class
-
property
title¶ Return the card title, if found.
- Returns
the card title, if found, otherwise an empty string
- Return type
str
-
property
-
close() → pages.tutor.task.Reading[source]¶ Click on the toggle to close the milestones pane.
- Returns
the reading page
- Return type
-
class
Bases:
pypom.region.RegionThe reading progress bar.
Return the current assignment progress.
- Returns
the current assignment progress percentage out of 100
- Return type
int
-
annotate() → pages.tutor.task.Reading.AnnotationBox[source]¶ Click the inline annotation button.
Click the speech bubble icon in the inline pop up button controls to add the selected text to the user’s annotation list.
- Returns
the annotation slide out edit box
- Return type
- Raises
TutorExceptionif the annotate button is not available or the new annotation is not found on the page after clicking the annotate button
-
property
content_highlights¶ Return the list of highlights found within the page.
- Returns
the list of highlights for the current book section or page
- Return type
dict(str, list(WebElement))
-
property
current_highlights_on_page¶ Return the number of highlights currently found on the page.
- Returns
the number of highlighted sections
- Return type
int
-
highlight() → None[source]¶ Click the inline highlight button.
Click the highlighter icon in the inline pop up button controls to add the selected text to the user’s annotation list.
- Returns
None
- Raises
TutorExceptionif the highlight button is not available or the new highlight is not found on the page after clicking the highlight button
-
highlights(milestones=False) → Union[pages.tutor.task.Reading, pages.tutor.task.Reading.Highlights, pages.tutor.task.Reading.Milestones][source]¶ Toggle the highlighting or milestone summary page.
- Parameters
milestones (bool) – (optional) use the milestone selector instead of the highlighting selector, returning the milestone chart
- Returns
the reading, the highlighting summary, or the milestone chart
- Return type
ReadingorHighlightsorMilestones
-
milestones() → Union[pages.tutor.task.Reading, pages.tutor.task.Reading.Milestones][source]¶ Toggle the milestones chart.
- Returns
the milestones chart if the chart isn’t displayed or the reading step if the chart is displayed
- Return type
Return the available annotation text bubbles.
- Returns
the list of available annotations
- Return type
list(
WebElement)
-
class