pages.tutor package

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.TutorBase

An assignment creation or modification.

class SectionOpenToClose(page, root=None)[source]

Bases: pypom.region.Region

Open and due dates and times for a particular course section.

property is_checked

Return True if the section checkbox is checked.

Returns

True if the checkbox is checked, otherwise False

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

OpenToClose

toggle() → pages.tutor.assignment.Assignment[source]

Click on the section checkbox.

Returns

the assignment page

Return type

Assignment

all_sections() → pages.tutor.assignment.Assignment[source]

Click on the ‘All Sections’ radio button.

Returns

the current page

Return type

Assignment

cancel() → pages.tutor.calendar.Calendar[source]

Click the ‘Cancel’ assignment button.

Returns

the instructor’s calendar

Return type

Calendar

change_timezone() → pages.tutor.settings.CourseSettings[source]

Click on the current course timezone.

Returns

the course settings page

Return type

CourseSettings

close() → pages.tutor.calendar.Calendar[source]

Click on the card ‘x’ button.

Returns

the instructor’s calendar

Return type

Calendar

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

Calendar or DeleteConfirmation

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

Assignment

property loaded

Return True when the assignment name field is found.

Returns

True when 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

OpenToClose or list(SectionOpenToClose)

publish() → pages.tutor.calendar.Calendar[source]

Click the ‘Publish’ assignment button.

Returns

the instructor’s calendar

Return type

Calendar

save() → pages.tutor.calendar.Calendar

Click the ‘Publish’ assignment button.

Returns

the instructor’s calendar

Return type

Calendar

save_as_draft() → pages.tutor.calendar.Calendar[source]

Click the ‘Save as Draft’ assignment button.

Returns

the instructor’s calendar

Return type

Calendar

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 pages.tutor.assignment.ButtonTooltip(page, root=None)[source]

Bases: pypom.region.Region

The 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

class pages.tutor.assignment.CancelConfirm(page, root=None)[source]

Bases: pypom.region.Region

The 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

Assignment

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

Assignment

property title

Return the dialog box title.

Returns

the modal title

Return type

str

yes() → pages.tutor.calendar.Calendar[source]

Click on the ‘Yes’ button.

Returns

the instructor’s calendar

Return type

Calendar

class pages.tutor.assignment.DeleteConfirmation(page, root=None)[source]

Bases: pypom.region.Region

The 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

Calendar

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

class pages.tutor.assignment.Event(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.assignment.Assignment

An event creation or modification.

class pages.tutor.assignment.ExerciseSelector(page, root=None)[source]

Bases: pypom.region.Region

A section-grouped exercise selector and display.

class BookSection(page, root=None)[source]

Bases: pypom.region.Region

All 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

class Toolbar(page, root=None)[source]

Bases: pypom.region.Region

The assessment selection toolbar.

class Section(page, root=None)[source]

Bases: pypom.region.Region

A selected book section button in the toolbar.

property is_active

Return True if the section is currently displayed.

Returns

True if 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

select() → pages.tutor.assignment.ExerciseSelector[source]

Click on the section number button.

Returns

the exercise selector with the section displayed in the main window

Return type

ExerciseSelector

add_more_sections() → pages.tutor.assignment.SectionSelector[source]

Click on the ‘+ Add More Sections’ button.

Returns

the book section selector

Return type

SectionSelector

cancel() → pages.tutor.assignment.Homework[source]

Click the ‘Cancel’ button.

Returns

the homework builder

Return type

Homework

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

ExerciseSelector

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

ExerciseSelector

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

Homework

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

ExerciseSelector

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

ExerciseSelector

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

what_are_these() → pages.tutor.assignment.HomeworkTutorSelectionsTooltip[source]

Click on the ‘What are these?’ link.

Returns

the Tutor-selected problem explanation tooltip

Return type

HomeworkTutorSelectionsTooltip

property loaded

Wait until the loading animation is done.

Returns

True when the loading animation is not found, otherwise False

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

list(ExerciseSelector.BookSection)

property toolbar

Access the secondary toolbar buttons for exercise selection.

Returns

the exercise selection toolbar

Return type

Toolbar

class pages.tutor.assignment.ExerciseTableReview(page, root=None)[source]

Bases: pypom.region.Region

The exercise selection review.

class Assessment(page, root=None)[source]

Bases: pypom.region.Region

An exercise review card.

class Question(page, root=None)[source]

Bases: pypom.region.Region

An individual question within an assessment item.

class Answer(page, root=None)[source]

Bases: pypom.region.Region

An 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

True if the answer is correct, False if it is incorrect

Return type

bool

property letter

Return the answer letter.

Returns

the letter representing the answer

Return type

str

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

add_question() → None[source]

Include the assessment in the selection.

Returns

None

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

ExerciseTableReview

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

ExerciseTableReview

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).

Returns

the question or list of questions

Return type

Question or list(Question)

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

ExerciseTableReview

remove_question() → None[source]

Remove the assessment from the selection.

Returns

None

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

property tags

Return the tag key/value pairs.

Returns

the group of tag key:value pairs

Return type

dict(str, str)

class OverviewRow(page, root=None)[source]

Bases: pypom.region.Region

An 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

add_more_sections() → pages.tutor.assignment.SectionSelector[source]

Click the ‘+ Add More Sections’ button.

Returns

the homework section selector

Return type

SectionSelector

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

ExerciseTableReview

property loaded

Wait until the loading animation is done.

Returns

True when the loading animation is not found, otherwise False

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

ExerciseTableReview

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

what_are_these() → pages.tutor.assignment.HomeworkTutorSelectionsTooltip[source]

Click the ‘What are these?’ link.

Returns

the homework Tutor selections explanation tooltip

Return type

HomeworkTutorSelectionsTooltip

class pages.tutor.assignment.External(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.assignment.Assignment

An 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

class pages.tutor.assignment.Homework(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.assignment.Assignment

A 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

SectionSelector

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

StudentPreview

class pages.tutor.assignment.HomeworkTutorSelectionsTooltip(page, root=None)[source]

Bases: pages.tutor.assignment.ButtonTooltip

The ‘What are these?’ Tutor selections tooltip.

class pages.tutor.assignment.OpenToClose(page, root=None)[source]

Bases: pypom.region.Region

The 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

True if the section checkbox is checked, otherwise False

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/YYYY date to open the assignment

  • open_at (str) – a hh:mm xm time to open the assignment

  • due_on (str) – a MM/DD/YYYY date the assignment is due

  • due_at (str) – a hh:mm xm time the assignment is due

Returns

None

toggle() → None[source]

Click on the section checkbox.

Returns

None

class pages.tutor.assignment.Reading(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.assignment.Assignment

A reading assignment creation or modification.

class ReadingSelection(page, root=None)[source]

Bases: pypom.region.Region

The reading order list.

delete() → pages.tutor.assignment.Reading.ReadingSelection[source]

Remove the section from the reading assignment.

Returns

the reading selection pane

Return type

ReadingSelection

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

ReadingSelection

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

ReadingSelection

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

SectionSelector

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

StudentPreview

why_cant_i_see_the_questions() → pages.tutor.assignment.ReadingQuestionTooltip[source]

Click on the ‘see the questions’ FAQ question link.

Returns

the reading question FAQ tooltip

Return type

ReadingQuestionTooltip

class pages.tutor.assignment.ReadingQuestionTooltip(page, root=None)[source]

Bases: pages.tutor.assignment.ButtonTooltip

The reading questions informational tooltip.

class pages.tutor.assignment.SectionSelector(page, root=None)[source]

Bases: pypom.region.Region

A chapter and section selector for readings and homeworks.

class Chapter(page, root=None)[source]

Bases: pypom.region.Region

A book selection chapter.

class Section(page, root=None)[source]

Bases: pypom.region.Region

A book section within a chapter.

property checked

Return True if the checkbox is selected.

Returns

True if the section checkbox is checked and False if it is not

Return type

bool

property is_unnumbered

Return True if the section is not numbered.

Returns

True if the section does not have a section number, False if 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

SectionSelector

property title

Return the section title.

Returns

the section title

Return type

str

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

ReferenceBook

property checked

Return True if the checkbox is selected.

Returns

True if the chapter checkbox is checked and False if it is not

Return type

bool

property is_open

Return True if the chapter sections are displayed.

Returns

True if the chapter is open and False if 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

SectionSelector

property title

Return the chapter title.

Returns

the chapter title

Return type

str

toggle() → pages.tutor.assignment.SectionSelector[source]

Click on the chapter bar to open or close the chapter.

Returns

the book section selector

Return type

SectionSelector

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

Assignment or ExerciseSelector

cancel() → pages.tutor.assignment.Assignment[source]

Click the ‘Cancel’ button and return to the assignment wizard.

Returns

the assignment creation page

Return type

Assignment

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

Assignment

property loaded

Wait until the loading animation is done.

Returns

True when the loading animation is not found, otherwise False

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

Assignment or ExerciseSelector

property title

Return the card heading.

Returns

the card heading

Return type

str

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.TutorShared

The base page for the Tutor app.

class Nav(page, root=None)[source]

Bases: regions.tutor.nav.TutorNav

Use the shared region Tutor navigation.

class pages.tutor.base.TutorLoginBase(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.base.TutorShared

The base page for the Tutor URI root.

Used for / and /terms

class Footer(page, root=None)[source]

Bases: pypom.region.Region

The log in base footer.

go_to_rice() → pages.rice.home.Rice[source]

Click the Rice University link.

Returns

the Rice University home page

Return type

Rice

view_terms()[source]

View the general Tutor terms of service and privacy policy.

Returns

the OpenStax Tutor Beta terms and policy page

Return type

Terms

class Nav(page, root=None)[source]

Bases: pypom.region.Region

The log in base navigation.

go_home() → pages.tutor.base.TutorLoginBase[source]

Click on the logo.

Returns

the OpenStax Tutor Beta home page

Return type

TutorLoginBase

go_to_rice() → pages.rice.home.Rice[source]

Click on the Rice logo to view the Rice University home page.

Returns

the Rice University home page

Return type

Rice

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

view_help_articles() → pages.salesforce.home.Salesforce[source]

Click on the Help link to view Salesforce articles.

Returns

the OpenStax knowledge base webpage

Return type

Salesforce

property footer

Access the page footer.

Returns

the page footer element

Return type

Footer

class pages.tutor.base.TutorShared(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pypom.page.Page

Shared base page functions.

back() → pages.tutor.base.TutorShared[source]

Go back to the previous page.

Execute a one history step backwards request.

Returns

the current page

Return type

TutorShared

close_tab() → pages.tutor.base.TutorShared[source]

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

TutorShared

is_displayed() → bool[source]

Return True when the Tutor page is displayed.

Returns

True if the root element is currently displayed, otherwise False

Return type

bool

property is_safari

Return True if the browser in use is Safari.

Returns

True if the current browser is Safari, else False

Return type

bool

property loaded

Override the default loaded function.

Wait up to timeout seconds for the root element to be found within the DOM.

Returns

True when the root element is found

Return type

bool

property location

Return the current URL.

Returns

the current website URL

Return type

str

property nav

Access the page nav.

Returns

the OpenStax Tutor navigation bar

Return type

Nav

reload() → pages.tutor.base.TutorShared[source]

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

TutorShared

resize_window(width=1024, height=768) → None[source]

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

property url

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.Region

An 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

AddExternal or AddEvent or AddHomework or AddReading or QuickLook

:raises TutorException: if the

assignment type does not match a known assignment type

property flagged

Return True if the trouble flag is present.

Returns

True if the assignment has a trouble flag displayed on the calendar, else False

Return type

bool

property is_draft

Return True if the assignment is a saved draft.

Returns

True if the assignment is a saved draft, else False

Return type

bool

property is_open

Return True if the assignment is open for work.

Returns

True if the assignment is currently open for work, else False

Return type

bool

property is_published

Return True if the assignment is published.

Returns

True if the assignment is published, else False

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

class pages.tutor.calendar.Calendar(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.base.TutorBase

The instructor course calendar.

class Banner(page, root=None)[source]

Bases: pypom.region.Region

The header region of the course calendar.

add_assignment()[source]

Click on the ‘Add Assignment’ toggle button.

Returns

the course calendar

Return type

Calendar

browse_the_book()[source]

Click on the ‘Browse the Book’ button.

Returns

the reference book view in a new tab

Return type

ReferenceBook

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

Scores

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.Region

The instructor calendar.

class Day(page, root=None)[source]

Bases: pypom.region.Region

A 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

AddExternal or AddEvent or AddHomework or AddReading

: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

True if any assignments are due on this day, else False

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 days

Access the individual dates.

Returns

the list of visible days

Return type

list(Day)

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

Calendar

previous_month()[source]

Click on the left arrow to view the previous month.

Returns

the previous month’s calendar view

Return type

Calendar

property year

Return the currently displayed year.

Returns

the currently displayed month’s year

Return type

str

class Sidebar(page, root=None)[source]

Bases: pypom.region.Region

The assignment sidebar.

class AssignmentCopy(page, root=None)[source]

Bases: pypom.region.Region

An 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

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

True if the assignment sidebar is open and displayed, else False

Return type

bool

property reading_bar

Return the ‘Add Reading’ bar element.

Returns

the reading assignment bar

Return type

WebElement

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

Assignment

:raises TutorException if 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 date

  • by_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)

property banner

Access the course page header.

Returns

the course banner region

Return type

Banner

property calendar

Access the calendar.

Returns

the assignment calendar region

Return type

Calendar

clear_training_wheels() → None[source]

Clear any joyride modals.

Returns

None

property loaded

Return True when the loading message goes away.

Returns

True when 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)

property sidebar

Access the assignment sidebar.

Returns

the assignment creation and cloning sidebar region

Return type

Sidebar

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

pages.tutor.course module

The student course view.

class pages.tutor.course.AssignmentBar(page, root=None)[source]

Bases: pypom.region.Region

A 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

class pages.tutor.course.StudentCourse(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.base.TutorBase

The weekly course view for students.

class Banner(page, root=None)[source]

Bases: pypom.region.Region

The 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

class Performance(page, root=None)[source]

Bases: pypom.region.Region

The performance forecast sidebar.

class Key(page, root=None)[source]

Bases: pypom.region.Region

The 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

class Section(page, root=None)[source]

Bases: pypom.region.Region

A 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

True if not enough assessments have been worked from the section to generate a BigLearn CLUe, else False

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

Practice

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 empty_description

Return the forecast explanation if the sidebar is empty.

Returns

True if the forecast explanation is empty, else False

Return type

bool

property is_empty

Return True if the forecast has not been populated.

Returns

True if the forecast is empty, else False

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

Practice

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

view_all_topics()[source]

Click the ‘View All Topics’ button.

Returns

the student’s performance forecast

Return type

PerformanceForecast

class Survey(page, root=None)[source]

Bases: pypom.region.Region

A 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

class Week(page, root=None)[source]

Bases: pypom.region.Region

Assignments listed by week.

class Banner(page, root=None)[source]

Bases: pypom.region.Region

The 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

True if the title is found, else False

Return type

bool

start()[source]

Return the week’s starting date.

Returns

the start date for the week

Return type

datetime

title()[source]

Return the title or week date information.

Returns

title or week information for the week

Return type

str

class Key(page, root=None)[source]

Bases: pypom.region.Region

An 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 assignments

Access the assignment bars.

Returns

the list of assignments

Return type

list(AssignmentBar)

property banner

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)

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)

property banner

Access the course banner.

Returns

the course banner region

Return type

Banner

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

ReferenceBook

clear_training_wheels() → None[source]

Clear any joyride modals.

Returns

None

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

True if no loading message is found

Return type

bool

property notes

Access the notifications.

Returns

the notification region

Return type

Notifications

property performance_sidebar

Access the performance forecast sidebar.

Returns

the performance forecast recent work sidebar

Return type

Performance

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

Assignment

property survey

Access the research surveys.

Returns

the research survey region

Return type

Survey

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

StudentCourse

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

StudentCourse

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

True if the pending state is removed before the timer runs out

Return type

bool

property weeks

Access the assignment weeks.

Returns

the list of assignment weeks

Return type

list(Week)

pages.tutor.dashboard module

The dashboard (course picker) page object.

class pages.tutor.dashboard.Courses(page, root=None)[source]

Bases: pypom.region.Region

Courses sections.

class Course(page, root=None)[source]

Bases: pypom.region.Region

Individual 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

CloneCourse

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

Calendar or StudentCourse

property is_preview

Return True if the course is a preview course.

Returns

True if the course is a preview, else False

Return type

bool

property is_teacher

Return True if the current user is a course instructor.

Returns

True if the currently logged in user is an instructor for the course, else False

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 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

Course

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

Calendar or StudentCourse

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

Calendar or StudentCourse

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

Calendar or StudentCourse

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

Calendar or StudentCourse

class pages.tutor.dashboard.Dashboard(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.base.TutorBase

The OpenStax Tutor Beta dashboard.

class NoCourses(page, root=None)[source]

Bases: pypom.region.Region

No courses were found pane.

property explanation

Return the explanation text.

get_help()[source]

Click on the ‘Get help >’ link.

Returns

the OpenStax knowledge base webpage in a new tab

Return type

Salesforce

class Pending(page, root=None)[source]

Bases: pypom.region.Region

The 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

property verify_button

Return the verify now button.

Returns

the verify button

Return type

WebElement

verify_now()[source]

Click the ‘Verify now via chat’ button.

Returns

the Salesforce chat window

Return type

Chat

URL_TEMPLATE = '/dashboard'
create_a_course()[source]

Select the create course tile.

Returns

the course creation wizard

Return type

NewCourse

property current_courses

Return the current courses section.

Returns

the current courses region

Return type

Courses

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

Calendar or StudentCourse

: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

Calendar or StudentCourse

property nav

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

NoCourses

property past_courses

Return the past courses section.

Returns

the past courses region

Return type

Courses

property pending

Access the pending verification section, if found.

Returns

the pending verification text region or None

Return type

Pending

property preview_courses

Return the preview courses section.

Returns

the preview courses region

Return type

Courses

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

True if a training wheel modal is visible, else False

Return type

bool

pages.tutor.enrollment module

Student enrollment.

class pages.tutor.enrollment.BuyAccess(page, root=None)[source]

Bases: pages.tutor.enrollment.Modal

The product purchase modal.

buy_access_now() → pages.tutor.enrollment.PurchaseForm[source]

Click the ‘Buy access now’ button.

Returns

the purchase form modal

Return type

PurchaseForm

try_free() → pages.tutor.enrollment.FreeTrial[source]

Click the ‘Try free’ button.

Returns

the free trial modal

Return type

FreeTrial

class pages.tutor.enrollment.Enrollment(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pypom.page.Page

The 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

Signup or StudentID

property loaded

Return True if the enrollment introduction is loaded.

Returns

True if the enrollment introduction is loaded, otherwise False

Return type

bool

class pages.tutor.enrollment.FreeTrial(page, root=None)[source]

Bases: pages.tutor.enrollment.Modal

The 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

StudentCourse

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.Modal

A dialog box with internal iFrames.

class pages.tutor.enrollment.Modal(page, root=None)[source]

Bases: pypom.region.Region

A page modal.

property root

Return the root element for a page modal.

Returns

the root element for a page modal

Return type

WebElement

class pages.tutor.enrollment.PrivacyPolicy(page, root=None)[source]

Bases: pages.tutor.enrollment.Modal

The 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:

  1. the student course page with the product purchase modal open for paid courses

  2. 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

BuyAccess or StudentCourse

property loaded

Return True when ‘Terms of Service’ is found on the page.

Returns

True when 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

class pages.tutor.enrollment.PurchaseConfirmation(page, root=None)[source]

Bases: pages.tutor.enrollment.IframeModal

The 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

StudentCourse

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

True when 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.IframeModal

The 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

FreeTrial

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

True when 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

PurchaseConfirmation

Raises

TutorException if 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

class pages.tutor.enrollment.StudentID(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pypom.page.Page

Enter 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:

  1. the student course page with the privacy policy modal open

  2. 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

PrivacyPolicy or BuyAccess

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

True when 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.TutorBase

The 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

pages.tutor.enrollment.StudentID

property loaded

Return True when the policies are displayed.

Returns

True when 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

PrivacyPolicy

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.TutorLoginBase

The Tutor root page.

class Footer(page, root=None)[source]

Bases: pages.tutor.base.Footer

The Tutor root page footer.

view_gdpr()[source]

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

GeneralDataPrivacyRegulation

property description

Return the descriptive Tutor overview text.

Returns

the overview description

Return type

str

go_to_log_in()[source]

Click the ‘LOG IN’ button.

Returns

the Accounts log in page

Return type

AccountsHome

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

TutorMarketing

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

Dashboard

property logged_in

Return True if the user is logged into Tutor.

Returns

True if the user is logged into Tutor, else False

Return type

bool

service_pass_through()[source]

Click the log in button for an active Accounts user.

Returns

the user’s dashboard

Return type

Dashboard

: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.TutorLoginBase

The Tutor site general legal policies.

class Nav(page, root=None)[source]

Bases: pages.tutor.base.Nav

The terms base navigation.

go_to_log_in()[source]

Click the ‘LOG IN’ button.

Returns

the Accounts log in page

Return type

AccountsHome

class Policies(page, root=None)[source]

Bases: pypom.region.Region

The 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

Policies

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.TutorBase

Clone an existing course.

class Details(page, root=None)[source]

Bases: pypom.region.Region

Provide 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

True when 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

class Name(page, root=None)[source]

Bases: pypom.region.Region

Choose the course title or name.

property loaded

Return True when the course name input box is found.

Returns

True when 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

class Term(page, root=None)[source]

Bases: pypom.region.Region

Select the course term.

class Term(page, root=None)[source]

Bases: pypom.region.Region

A course term.

select() → None[source]

Click on the term option.

Returns

None

property selected

Return True if the term is currently selected.

Returns

True if the term is selected, otherwise False

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 loaded

Return True when course semesters/quarters are found.

Returns

True when 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)

back() → None[source]

Go to the previous step in the wizard.

Returns

None

cancel() → None[source]

Cancel the course creation wizard.

Returns

None

property details

Access the new course details pane.

Returns

the new course’s section request and student estimate pane

Return type

Details

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

True if on the course estimation step, False if not

Return type

bool

property loaded

Return True when the new course wizard root is found.

Returns

True when 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

Name

next() → Optional[pages.tutor.calendar.Calendar][source]

Continue to the next step in the wizard.

Returns

the instructor’s new calendar if on the course estimate step, otherwise None

Return type

Calendar or NoneType

property term

Access the new course term pane.

Returns

the new course’s term selection pane

Return type

Term

class pages.tutor.new_course.NewCourse(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.new_course.CloneCourse

Create a new Tutor course.

class BaseCourse(page, root=None)[source]

Bases: pypom.region.Region

Select the course to clone.

class Course(page, root=None)[source]

Bases: pypom.region.Region

A previous course.

property name

Return the existing course name.

Returns

the course name

Return type

str

select() → None[source]

Click on the course option.

Returns

None

property term

Return the existing course semester/quarter and year.

Returns

the course term

Return type

str

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

True when at least one course clone base is found

Return type

bool

Noindex

select_by_name(name: str) → None[source]

Select a course to clone by name.

Parameters

name (str) – the existing course name

Returns

None

:raises TutorException: if the name is

not found or is not available

class Course(page, root=None)[source]

Bases: pypom.region.Region

Select the course book.

class Book(page, root=None)[source]

Bases: pypom.region.Region

An 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

True if the book is the current course selection, otherwise False

Return type

bool

select() → None[source]

Click on the book option.

Returns

None

property title

Return the book title.

Returns

the book title

Return type

str

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

True when at least one book option is found

Return type

bool

Noindex

select_by_title(title: str) → None[source]

Select a course book by the book title.

Parameters

title (str) – the book title

Returns

None

:raises TutorException: if the title is

not found or is not available

class NewOrClone(page, root=None)[source]

Bases: pypom.region.Region

Create 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

True when 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

True if a previous course exists and can be cloned, otherwise False

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

BaseCourse

property course

Access the new course course pane.

Returns

the new course’s section request and student estimate pane

Return type

Course

property new_or_clone

Access the new course details pane.

Returns

the new course’s section request and student estimate pane

Return type

NewOrClone

pages.tutor.performance module

The instructor’s course settings page.

class pages.tutor.performance.BookSection(page, root=None)[source]

Bases: pypom.region.Region

A 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

Practice or PerformanceForecast

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

class pages.tutor.performance.PerformanceForecast(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.base.TutorBase

The performance forecast page.

class Bar(page, root=None)[source]

Bases: pypom.region.Region

A 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

class Guide(page, root=None)[source]

Bases: pypom.region.Region

The performance guide weakest guide and chapters.

class Chapter(page, root=None)[source]

Bases: pypom.region.Region

An individual book chapter row.

property chapter

Access the chapter performance data.

Returns

the chapter performance data

Return type

BookSection

property sections

Access the chapter sections performance data.

Returns

the list of assigned chapter sections performance data

Return type

list(BookSection)

class Weakest(page, root=None)[source]

Bases: pypom.region.Region

The 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

Practice or PerformanceForecast

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 chapters

Access the chapter rows.

Returns

the list of chapter rows

Return type

list(Chapter)

property weakest

Access the weakest row.

Returns

the weakest row

Return type

Weakest

class Section(page, root=None)[source]

Bases: pypom.region.Region

A 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

PerformanceForecast

property selected

Return True if the tab is currently active.

Returns

True if the tab is active, False otherwise

Return type

bool

back_to_scores()[source]

Click the ‘Back to Scores’ button.

Returns

the scores page

Return type

Scores

clear_training_wheels() → None[source]

Clear any joyride modals.

Returns

None

property forecast

Access the performance forecast rows.

Returns

the forecast panels

Return type

Guide

: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

True if 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

list(PerformanceForecast.Section)

property title

Return the page title.

Returns

the page title

Return type

str

view_section(name)[source]

View a course section by its name.

Returns

the performance forecast for the requested section or period

Return type

PerformanceForecast

:raises utils.tutor.TutorException: if the name doesn’t

match an available course section

pages.tutor.practice module

An OpenStax Tutor Beta practice session.

class pages.tutor.practice.ButtonTooltip(page, root=None)[source]

Bases: pypom.region.Region

The 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

class pages.tutor.practice.Practice(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.task.Homework

A practice session.

class Footer(page, root=None)[source]

Bases: pypom.region.Region

The practice session footer.

back_to() → Union[pages.tutor.course.StudentCourse, pages.tutor.performance.PerformanceForecast][source]

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

StudentCourse or PerformanceForecast

property title

Return the practice session title.

Returns

the practice session title

Return type

str

class FreeResponse(page, root=None)[source]

Bases: pypom.region.Region

A 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

True if the validation message is displayed, otherwise False

submit_this_answer() → pages.tutor.practice.Practice[source]

Submit the invalid free response.

Returns

the multiple choice answer step for the assessment

Return type

Practice

class MultipleChoice(page, root=None)[source]

Bases: pypom.region.Region

A multiple choice assessment step.

class Answer(page, root=None)[source]

Bases: pypom.region.Region

An 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

True if the answer is selected, otherwise False

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

select() → None[source]

Click on the answer to select it.

Returns

None

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 Nav(page, root=None)[source]

Bases: pypom.region.Region

The practice session assessment navigation.

class Icon(page, root=None)[source]

Bases: pypom.region.Region

A practice session step icon.

property is_actice

Return True if this step is currently active.

Returns

True if the step is active and displayed, otherwise False

Return type

bool

property position

Return the step’s position.

Returns

the step’s positon within the practice session

Return type

int

select() → pages.tutor.practice.Practice[source]

Click the icon to view the practice step.

Returns

the practice session with the selected step in the practice window

Return type

Practice

property step_id

Return the step identification number.

Returns

the step ID number

Return type

int

property completion

Access the completion/final step.

Returns

the completion step

Return type

Icon

property steps

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

Practice

:raises TutorException: if the answer button

is disabled

property answer_enabled

Return True if the ‘Answer’ button is enabled.

Returns

True if the Answer button is clickable, otherwise False

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

property footer

Access the practice assignment footer.

Returns

the footer region

Return type

Footer

property has_free_response

Return True if the assessment has a free response text box.

Returns

True if a free response textbox is present, else False

Return type

bool

property is_personalized

Return True if the assessment is personalized to the user.

Returns

True if the assessment is personalized, otherwise False

Return type

bool

property loaded

Return True when all loading messages are done.

Returns

True if 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

ButtonTooltip

property question

Access the step-type features of the assessment.

Returns

the inner assessment function - either multiple choice or a free response

Return type

MultipleChoice or FreeResponse

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

suggest_a_correction() → pages.web.errata.ErrataForm[source]

Click the ‘Suggest a correction’ link.

Returns

the errata submission form for the course book

Return type

ErrataForm

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.TutorBase

The 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.Page

The complete textbook reading experience.

class Content(page, root=None)[source]

Bases: pypom.region.Region

The 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

ReferenceBook

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

ReferenceBook

property previous_page_arrow

Return the previous page arrow button.

Returns

the previous page button

Return type

WebElement

class Highlights(page, root=None)[source]

Bases: pypom.region.Region

The highlighting summary page overlay.

class Note(page, root=None)[source]

Bases: pypom.region.Region

An 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

ReferenceBook

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

ReferenceBook

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

ReferenceBook

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

ReferenceBook

view()[source]

Click on the view in book link.

Returns

the reference book with the requested book section displayed in the content region

Return type

ReferenceBook

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

property menu_is_open

Return True if the section drop down menu is open.

Returns

True if the multi-select drop down menu is open, else False

Return type

bool

menu_toggle()[source]

Click on the drop down menu.

Returns

the reference book with the highlighting summary page open

Return type

ReferenceBook

property notes

Access each displayed highlight or annotation.

Returns

a list of displayed highlights and annotations

Return type

list(ReferenceBook.Highlights.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()[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

ReferenceBook

class Nav(page, root=None)[source]

Bases: pypom.region.Region

The reference book navigation controls.

click_menu_toggle()[source]

Click on the ToC toggle button.

Returns

the reference book

Return type

ReferenceBook

click_notes_summary_toggle()[source]

Click on the highlight summary page toggle.

Returns

the reference book

Return type

ReferenceBook

property is_teacher

Return True if the instructor toggle is available.

Returns

True if the user is an instructor, else False

Return type

bool

property menu_is_open

Return True if the ToC is open.

Returns

True if the table of contents is currently displayed, else False

Return type

bool

property menu_toggle

Return the table of contents toggle button.

Returns

the open/close toggle for the table of contents

Return type

WebElement

property note_summary_is_open

Return True if the highlight summary page is visible.

Returns

True if the highlighting summary page is visible, else False

Return type

bool

property notes_summary_toggle

Return the highlighting summary toggle button.

Returns

the open/close toggle for the highlighting summary

Return type

WebElement

property popover_content

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

property section_title

Return the currently displayed section title.

Returns

the title for the currently selected section

Return type

str

show_teacher_content()[source]

Click on the teacher content toggle.

Returns

the reference book

Return type

ReferenceBook

property teacher_content_toggle

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.Region

The reference book table of contents.

class Chapter(page, root=None)[source]

Bases: pypom.region.Region

A single book chapter list in the table of contents.

class Section(page, root=None)[source]

Bases: pypom.region.Region

A 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

view_section()[source]

Click the section link.

Returns

the reference book with the selected section in the content region

Return type

ReferenceBook

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

property chapters

Access the individual book chapters.

Returns

a list of available book chapters

Return type

list(Chapter)

property content

Access the currently selected section’s book content.

Returns

the current section content

Return type

Content

property highlights

Access the highlighting summary page.

Returns

the highlight/annotation summary page

Return type

Highlights

property nav

Access the reference book navigation bar.

Returns

the reference book navigation bar region

Return type

Nav

property table_of_contents

Access the table of contents.

Returns

the table of contents for the book

Return type

TableOfContents

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.TutorBase

The assignment review metrics.

class Assessment(page, root=None)[source]

Bases: pypom.region.Region

An assignment question.

class Answer(page, root=None)[source]

Bases: pypom.region.Region

An 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

True if this answer is correct for the assessment

Return type

bool

property letter

Return the answer letter.

Returns

the answer letter

Return type

str

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

suggest_a_correction() → pages.web.errata.Errata[source]

Click the ‘Suggest a correction’ link.

Returns

the Web errata form in a new tab

Return type

Errata

class Sidebar(page, root=None)[source]

Bases: pypom.region.Region

The review metrics assignment overview sidebar.

class Stats(page, root=None)[source]

Bases: pypom.region.Region

The sidebar section stats.

class BookSection(page, root=None)[source]

Bases: pypom.region.Region

The 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 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 Tab(page, root=None)[source]

Bases: pypom.region.Region

A course section or period selection tab.

property is_selected

Return True if the course section is currently selected.

Returns

True if 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

select() → pages.tutor.review.Metrics[source]

Click on the course section tab to display its review.

Returns

the assignment metrics for this course section or period

Return type

Metrics

property sections

Access the course section tab options.

Returns

the list of available course sections for this assignment

Return type

list(Tab)

property stats

Access the assignment statistics.

Returns

the sidebar statistics panel

Return type

Stats

class Toolbar(page, root=None)[source]

Bases: pypom.region.Region

The assignment navigation toolbar.

class Step(page, root=None)[source]

Bases: pypom.region.Region

An assignment navigation jump link.

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.

Returns

the instructor’s calendar or the scores page

Return type

Calendar or Scores

back_to_scores() → pages.tutor.scores.Scores[source]

Click the ‘Back to Scores’ button.

Returns

the instructor’s calendar or the scores page

Return type

Calendar or Scores

property steps

Access the assignment book section jump links.

Returns

the list of book section links in the assignment

Return type

list(Step)

property exercises

Access the assignment questions.

is_displayed() → bool[source]

Return True if the assignment metrics page is displayed.

Returns

True if the metrics page is displayed

Return type

bool

property loaded

Return True when the metrics columns are found.

Returns

True when 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)

property sidebar

Access the review metrics overview and section selector.

Returns

the sidebar

Return type

Sidebar

property toolbar

Access the assignment toolbar.

Returns

the assignment navigation toolbar

Return type

Toolbar

pages.tutor.roster module

The instructor’s course roster management page.

class pages.tutor.roster.AddInstructor(page, root=None)[source]

Bases: pages.tutor.roster.Modal

The 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

class pages.tutor.roster.AddSection(page, root=None)[source]

Bases: pages.tutor.roster.Modal

Add 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

CourseRoster

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.Tooltip

Move a student to another section tooltip.

class Section(page, root=None)[source]

Bases: pypom.region.Region

An available section for a student.

property name

Return the section name.

Returns

the section name

Return type

str

select()[source]

Click on the section name to transfer the student.

Returns

the course roster

Return type

CourseRoster

property sections

Return the list of available other sections.

Returns

the course roster

Return type

CourseRoster

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

CourseRoster

Raises

TutorException – if the section_name does not match an active course section or period name

class pages.tutor.roster.CourseRoster(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.base.TutorBase

The Tutor course roster.

class Roster(page, root=None)[source]

Bases: pypom.region.Region

The student roster tables.

class Section(page, root=None)[source]

Bases: pypom.region.Region

A section or period tab.

property is_active

Return True if the section is currently displayed.

Returns

True if the section is displayed else False

Return type

bool

property name

Return the section or period name.

Returns

the section or period name

Return type

str

select()[source]

Click on the section or period tab.

Click on the section or period tab to display that section’s active students.

Returns

the course roster with the selected section active

Return type

CourseRoster

class Student(page, root=None)[source]

Bases: pages.tutor.roster.User

A 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 True else the course roster

Return type

ReAddStudent or CourseRoster

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

ChangeSection or CourseRoster

: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

DropStudent or CourseRoster

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

AddSection or CourseRoster

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; if False open and return the Delete Section modal

Returns

the Delete Section modal if delete is False or the course roster if delete is True

Return type

DeleteSection or CourseRoster

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

RenameSection or CourseRoster

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

CourseRoster

: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

property students

Access the student rows.

Returns

the list of students in the current section or period

Return type

list(Student)

class Teachers(page, root=None)[source]

Bases: pypom.region.Region

The ‘Instructors’ table.

class Teacher(page, root=None)[source]

Bases: pages.tutor.roster.User

An instructor row with actions.

remove(remove_instructor=True)[source]

Remove this instructor from the course.

Returns

the course roster if remove_instructor is True else the remove instructor tooltip

Return type

CourseRoster or RemoveInstructor

add_instructor()[source]

Click the ‘Add Instructor’ link.

Returns

the open AddInstructor modal

Return type

AddInstructor

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 = 1 is the first instructor)

Returns

the instructor row

Return type

Teacher

Raises

TutorException – if a match isn’t found

property instructors

Return the current list of instructors.

Returns

the list of teachers in the instructor table

Return type

list(Teacher)

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

Teachers

property loaded

Return True when the instructor list is populated.

Returns

True when at least one instructor is found

Return type

bool

property roster

Access the student roster table.

Returns

the student rosters

Return type

Roster

property title

Return the page title.

Returns

the page title

Return type

str

class pages.tutor.roster.DeleteSection(page, root=None)[source]

Bases: pages.tutor.roster.Modal

Delete an existing section.

Note

Sections are not deleted; they are archived and may be reactivated by a Tutor administrator in the admin console.

cancel()[source]

Click on the ‘Cancel’ button.

Returns

the course roster

Return type

CourseRoster

delete()[source]

Click on the ‘Delete’ button confirming the section removal.

Returns

the course roster

Return type

CourseRoster

Raises

TutorException when the course period/section cannot be deleted

class pages.tutor.roster.DropStudent(page, root=None)[source]

Bases: pages.tutor.roster.Tooltip

Drop a current student from the course tooltip.

drop()[source]

Drop the student from the course.

Returns

the course roster

Return type

CourseRoster

class pages.tutor.roster.Modal(page, root=None)[source]

Bases: pypom.region.Region

A pop up modal with overlay.

close()[source]

Click the close link or ‘x’ button to close the modal.

Returns

the course roster

Return type

CourseRoster

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.Tooltip

Re-add a dropped student to the active roster tooltip.

restore()[source]

Readd the student to the course.

Returns

the course roster

Return type

CourseRoster

class pages.tutor.roster.RemoveInstructor(page, root=None)[source]

Bases: pages.tutor.roster.Tooltip

Remove a current course instructor tooltip.

remove()[source]

Remove the selected instructor from the course.

Returns

the course roster

Return type

CourseRoster

class pages.tutor.roster.RenameSection(page, root=None)[source]

Bases: pages.tutor.roster.AddSection

Edit 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

rename()[source]

Rename the current section.

Returns

the course roster

Return type

CourseRoster

class pages.tutor.roster.Tooltip(page, root=None)[source]

Bases: pypom.region.Region

A limited page tooltip action box.

property request

Return the action description text found in the header.

Returns

the action description

Return type

str

class pages.tutor.roster.User(page, root=None)[source]

Bases: pypom.region.Region

A 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

pages.tutor.scores module

The student and instructor scores page.

class pages.tutor.scores.LateWork(page, root=None)[source]

Bases: pages.tutor.scores.Tooltip

An instructor late work tool tip.

accept_late_score()

Click on the late work button.

Returns

the scores page

Return type

Scores

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

use_this_score()[source]

Click on the late work button.

Returns

the scores page

Return type

Scores

class pages.tutor.scores.Progress(page, root=None)[source]

Bases: pages.tutor.scores.Tooltip

A 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

class pages.tutor.scores.Scores(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.base.TutorBase

The shared scores page elements.

class Section(page, root=None)[source]

Bases: pypom.region.Region

A section or period tab.

property name

Return the tab/section/period name.

Returns

the tab name

Return type

str

select()[source]

Click on the tab to view the section scores table.

Returns

the scores page showing the table for the selected tab

Return type

Scores

class Table(page, root=None)[source]

Bases: pypom.region.Region

The scores table.

class Heading(page, root=None)[source]

Bases: pypom.region.Region

The table column headings and average information region.

class AssignmentInfo(page, root=None)[source]

Bases: pypom.region.Region

An 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

ASCENDING or DESCENDING or NO_SORT

review_assignment()[source]

Click on the ‘Review’ link to view the metrics.

Returns

the review metrics page for the assignment or the scores page for externals

Return type

Metrics or Scores

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

ASCENDING or DESCENDING or NO_SORT

sort_by_progress()[source]

Sort the table by the assignment progress.

Returns

the scores table sorted by the assignment progress

Return type

Scores

sort_by_score()[source]

Sort the table by the assignment scores.

Returns

the scores table sorted by the assignment scores

Return type

Scores

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

True if the averages panel is open else False

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

ASCENDING or DESCENDING or NO_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

set_weights()[source]

Open the weights modal.

Returns

the weights modal

Return type

SetWeights or ViewWeights

sort_by_name()[source]

Sort the table by last name.

Returns

the scores table sorted by last name

Return type

Scores

toggle_averages()[source]

Open or close the ‘Averages’ columns.

Returns

the scores table

Return type

Scores

view_weights()[source]

Open the weights modal.

Returns

the weights modal

Return type

SetWeights or ViewWeights

class Student(page, root=None)[source]

Bases: pypom.region.Region

A student row.

class Assignment(page, root=None)[source]

Bases: pypom.region.Region

A 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

True if the student worked at least part of the assignment after the assignment came due, else False

Return type

bool

property late_work_accepted

Return True if the late work has been accepted.

Returns

True if an instructor has accepted the late work as the new grade, else False

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

LateWork

view_student_work()[source]

Click on the score to view the student’s work.

Returns

the instructor’s view of the student’s assignment or the scores page is no work has been done

Return type

External or Homework or Reading or Scores

:raises TutorException: if the

assignment type isn’t known (external, homework, or reading)

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

property heading

Access the scores table heading information.

Returns

the table heading region

Return type

Heading

property legend

Return the legend text, if found.

Returns

the legend text or a blank string if not found

Return type

str

property students

Access the student row(s).

Returns

the list of student score rows

Return type

list(Student)

property active_show_as

Return the currently selected show as option.

Returns

Tutor.AS_PERCENTAGE or Tutor.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

Settings or StudentCourse or Calendar or ScoresBase

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

Settings or StudentCourse or Calendar or ScoresBase

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

Settings or StudentCourse or Calendar or ScoresBase

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

Scores

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

True if the current user is a teacher and has access to the instructor controls, else False

Return type

bool

property loaded

Return True when the scores table is found.

Returns

True when 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

Settings or StudentCourse or Calendar or ScoresBase

property modal_open

Return True if a modal is found open.

Returns

True if 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

StudentScores or Scores

show_as_percentage()[source]

Click the ‘%’ button to show scores as percentages.

Returns

the scores page

Return type

StudentScores or Scores

property table

Access the scores table.

Returns

the scores table

Return type

Table

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

True if 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

Scores

:raises TutorException: if a section is not

found to match by_name

class pages.tutor.scores.SetWeights(page, root=None)[source]

Bases: pages.tutor.scores.Weights

The instructor’s set weights modal.

cancel()[source]

Click the ‘Cancel’ button to close the weights dialog.

Returns

the scores page

Return type

Scores

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

SetWeights

: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

Scores

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

Article

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

True if the sum of the weight values is 100, else False

Return type

bool

class pages.tutor.scores.Tooltip(page, root=None)[source]

Bases: pypom.region.Region

A scores pop up tool tip.

class pages.tutor.scores.ViewWeights(page, root=None)[source]

Bases: pages.tutor.scores.Weights

The 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)

class pages.tutor.scores.Weights(page, root=None)[source]

Bases: pypom.region.Region

The scores page weight scoring.

close(x=False)[source]

Click on the ‘Close’, ‘x’, or ‘Cancel’ button.

Parameters

x (bool) – (optional) True if using the ‘x’ close button

Returns

the scores page

Return type

Scores or StudentScores

: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

True if 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.CourseSettingsModal

The timezone change modal.

class Timezone(page, root=None)[source]

Bases: pypom.region.Region

A timezone option for a course.

is_current()[source]

Return True if the timezone is currently selected.

Returns

True if the timezone option is currently selected, else False

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

select()[source]

Click on the timezone radio button.

Returns

the timezone modal

Return type

ChangeCourseTimezone

property active

Return the currently selected timezone.

Returns

the current timezone in use by the course

Return type

Timezone

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

save()[source]

Click on the Save button.

Returns

the course settings page

Return type

CourseSettings

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

ChangeCourseTimezone

:raise utils.tutor.TutorException: if the timezone does not

match an available option

property timezones

Access the available timezones for the course.

Returns

the list of available timezones

Return type

list(Timezone)

class pages.tutor.settings.Component(page, root=None)[source]

Bases: pypom.region.Region

A 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

class pages.tutor.settings.CourseSettings(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.base.TutorBase

The Tutor course settings page.

class DatesAndTime(page, root=None)[source]

Bases: pypom.region.Region

The 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

ChangeCourseTimezone

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

class StudentAccess(page, root=None)[source]

Bases: pypom.region.Region

The 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.Region

Direct 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

class DirectLinksOnly(page, root=None)[source]

Bases: pypom.region.Region

The LMS option is not available for the course.

find_out_more()[source]

Access the Salesforce LMS integration overview.

Returns

the LMS integration walkthrough on Salesforce

Return type

Salesforce

property sections

Access the individual section URLs.

Returns

the list of available section or period enrollment URLs

Return type

list(Section)

class Enrolled(page, root=None)[source]

Bases: pypom.region.Region

The 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

show_lms_keys_again()[source]

Click the link and display the LMS key modal.

Returns

the LMS key modal

Return type

LMSKeyPairings

class LMS(page, root=None)[source]

Bases: pypom.region.Region

LMS 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

Salesforce

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 vendors

Access the list of LMS vendors.

Returns

the list of available LMS providers

Return type

list(Vendor)

property panel

Return the correct subclass panel.

Returns

the subpanel according to the course settings

Return type

DirectAccess or DirectLinksOnly or Enrolled or LMS

property content

Access the main page content.

Returns

the student access content or the dates and times content

Return type

StudentAccess or DatesAndTime

property course_name

Return the course name.

Returns

the course name

Return type

str

dates_and_time() → None[source]

Click on the ‘DATES AND TIME’ tab.

Returns

None

edit_course_name()[source]

Click on the edit icon next to the course name.

Returns

the course rename modal

Return type

RenameCourse

property loaded

Return True when the settings page active nav tab is found.

Returns

True when the internal active nav tab is found

Return type

bool

property page_title

Return the page title.

Returns

the page title

Return type

str

student_access() → None[source]

Click on the ‘STUDENT ACCESS’ tab.

Returns

None

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 pages.tutor.settings.CourseSettingsModal(page, root=None)[source]

Bases: pypom.region.Region

The 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 True use the ‘x’ button in the upper right of the modal, otherwise use the footer button

Returns

the course settings page

Return type

CourseSettings

property title

Return the modal title.

Bases: pages.tutor.settings.CourseSettingsModal

The 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

CourseSettings

property description

Return the modal body content.

Returns

the text explaining what will happen if LMS integration is deactivated

Return type

str

im_sure()[source]

Click on the “I’m sure” button.

Clicking on the button switches the enrollment option back to ‘Give students direct links’ and closes the modal.

Returns

the course settings page

Return type

CourseSettings

class pages.tutor.settings.LMSKeyPairings(page, root=None)[source]

Bases: pages.tutor.settings.CourseSettingsModal

Key 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

Salesforce

property instructions

Return the integration instructions.

Returns

the basic LMS integration instructions

Return type

str

property lms_option

Access the LMS vendor options.

Returns

the LMS vendor options

Return type

list(Vendor)

class pages.tutor.settings.RenameCourse(page, root=None)[source]

Bases: pages.tutor.settings.CourseSettingsModal

The course renaming modal.

property name

Return the course name.

Returns

the current value of the course name input text box

Return type

str

rename()[source]

Click on the ‘Rename’ button.

Returns

the course settings page with the new course title displayed

Return type

CourseSettings

class pages.tutor.settings.Section(page, root=None)[source]

Bases: pypom.region.Region

Section 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

class pages.tutor.settings.Tab(page, root=None)[source]

Bases: pypom.region.Region

A section tab.

property is_open

Return True if the tab is currently selected.

Returns

True if the tab is currently active, else False

Return type

bool

property name

Return the name listed on the tab.

Returns

the name of the tab

Return type

str

select()[source]

Click on the tab to open it.

Returns

the course settings page

Return type

CourseSettings

class pages.tutor.settings.Vendor(page, root=None)[source]

Bases: pypom.region.Region

An 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

Ture if the vendor is currently selected else False

Return type

bool

property short_name

Return the internal vendor short name.

Returns

the LMS company short name

Return type

str

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.TutorBase

The shared assignment features.

class Content(page, root=None)[source]

Bases: pypom.region.Region

A placeholder for the assignment body.

property assignment_complete

Return True if the assignment completion step is displayed.

Returns

True if the assignment completion card is displayed

Return type

bool

property has_correct_answer

Return True if the correct answer is displayed.

Returns

True if 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

True if 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

True if 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

True if 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

True if the current assignment step contains mutliple choice answers

Return type

bool

class Footer(page, root=None)[source]

Bases: pypom.region.Region

The assignment footer.

back_to_dashboard() → pages.tutor.course.StudentCourse[source]

Click the ‘Back to Dashboard’ button.

Returns

the student course page

Return type

StudentCourse

property due_date

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

property title

Return the assignment name.

Returns

the assignment name

Return type

str

class Nav[source]

Bases: pypom.region.Region

A 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

Content

clear_training_wheels() → None[source]

Clear any joyride modals.

Returns

None

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)

property footer

Access the assignment footer content.

Returns

the assignment footer

Return type

Footer

property loaded

Return True when the various loading panes are gone.

Returns

True when the various loading message panes/SVGs are not found

Return type

bool

property nav

Access the assignment navigaton bar.

Returns

the assignment navigation bar for readings and homeworks

Return type

Nav or None

class pages.tutor.task.Event(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.task.Assignment

A calendar event.

class Content(page, root=None)[source]

Bases: pypom.region.Region

The 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

StudentCourse

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 pages.tutor.task.External(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.task.Assignment

An assignment found outside of OpenStax Tutor Beta.

class Content(page, root=None)[source]

Bases: pypom.region.Region

The 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

class pages.tutor.task.Homework(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.task.Assignment

A collection of assessments selected by the course instructor.

class Content(page, root=None)[source]

Bases: pages.tutor.task.Content

The 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

StudentCourse

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

PerformanceForecast

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

True if 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

MultipartQuestion or FreeResponse or MultipleChoice

Raises

TutorException if the assessment root element isn’t found

class Nav(page, root=None)[source]

Bases: pypom.region.Region

The homework step navigation.

class Step(page, root=None)[source]

Bases: pypom.region.Region

A homework step, review, or completion.

property answered

Return True if the step is answered.

Returns

True if the step is answered, otherwise False

Return type

bool

property correctness

Return the correctness for the step.

Returns

the correctness (answered correctly or incorrectly) of the step if past the due date and answered CORRECT or INCORRECT or NOT_ANSWERED or NOT_GRADED

Return type

str

property index

Return the exercise step index.

Returns

the exercise step index number or -1 for non- exercise steps

Return type

int

property is_active

Return True if the step is currently selected and active.

Returns

True if the step is active and displayed in the body, otherwise False

Return type

bool

select() → pages.tutor.task.Homework[source]

Select the step to display it in the main body.

Returns

the homework assignment with the selected step active

Return type

Homework

property selection

Return the selection type for the assessment.

Returns

the selection type for the assessment question or NOT_A_QUESTION for an interstitial card; standard responses will be CORE or PERSONALIZED or SPACED_PRACTICE

Return type

str

property step_id

Return the step identification number.

Returns

the homework step ID number

Return type

str

property step_type

Return the step type.

Returns

the step type EXERCISE or REVIEW_CARD or END_CARD

Return type

str

property title

Return the homework step title.

Returns

the homework step title

Return type

str

property steps

Access the individual homework steps.

Returns

the list of available steps

Return type

list(Step)

class pages.tutor.task.Reading(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.tutor.task.Assignment

A collection of book sections selected by the course instructor.

class AnnotationBox(page, root=None)[source]

Bases: pypom.region.Region

The 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

Reading

is_displayed() → bool[source]

Return True if the slide out edit box is displayed.

Returns

True when 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

AnnotationBox

previous() → pages.tutor.task.Reading.AnnotationBox[source]

Click the previous annotation up arrow button.

Returns

the previous annotation/highlight if one exists

Return type

AnnotationBox

save() → pages.tutor.task.Reading[source]

Click the save annotation checkmark button.

Returns

the current reading task step

Return type

Reading

see_all() → pages.tutor.task.Reading.Highlights[source]

Click the ‘See all’ annotations button.

Returns

the highlighting summary page

Return type

Highlights

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.Content

The reading assignment body.

class Caption(page, root=None)[source]

Bases: pypom.region.Region

An 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

back_to_dashboard() → pages.tutor.course.StudentCourse[source]

Click on the ‘Back to Dashboard’ button.

Returns

the student course page

Return type

StudentCourse

: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

True if 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

Reading

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

True if 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 FreeResponse or MultipleChoice

property paragraphs

Return a list of paragraphs found on the page.

Returns

the list of paragraphs

Return type

list(str)

previous_page() → pages.tutor.task.Reading[source]

Click on the left arrow button.

Returns

the previous step from the reading assignment

Return type

Reading

class Highlights(page, root=None)[source]

Bases: pypom.region.Region

The highlighting summary page.

class Note(page, root=None)[source]

Bases: pypom.region.Region

An 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

Highlights

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

Highlights

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

Highlights

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

Highlights

view() → pages.tutor.reference.ReferenceBook[source]

Click on the view in book link.

Returns

the reference book with the requested book section displayed in the content region

Return type

ReferenceBook

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

True when the main content is not displayed

Return type

bool

property menu_is_open

Return True if the section drop down menu is open.

Returns

True if the multi-select drop down menu is open, else False

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

Highlights

class Milestones(page, root=None)[source]

Bases: pypom.region.Region

The reading step milestone chart.

class Milestone(page, root=None)[source]

Bases: pypom.region.Region

A 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

True if the reading step is complete, otherwise False

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

close() → pages.tutor.task.Reading[source]

Click on the toggle to close the milestones pane.

Returns

the reading page

Return type

Reading

is_displayed() → bool[source]

Return True when the main page is hidden.

Returns

True when the main content is not displayed

Return type

bool

property milestones

Access the individual milestone cards.

Returns

the list of milestones reached within the reading assignment

Return type

list(Milestone)

class Nav(page, root=None)[source]

Bases: pypom.region.Region

The reading progress bar.

property progress

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

AnnotationBox

Raises

TutorException if 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

TutorException if 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

Reading or Highlights or Milestones

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

Reading or Milestones

property sidebar_buttons

Return the available annotation text bubbles.

Returns

the list of available annotations

Return type

list(WebElement)

Module contents