pages.web package

Submodules

pages.web.about module

OpenStax About Us Page.

class pages.web.about.AboutUs(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

About Us page.

URL_TEMPLATE = '/about'
class WhatWeDo(page, root=None)[source]

Bases: pypom.region.Region

The What we do panel.

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

Bases: pypom.region.Region

An information card.

click()[source]

Click the card.

property image

Access the card image.

property text

Return the card content.

property cards

Access the cards.

go_to_library()[source]

Follow the current library link.

go_to_tutor_marketing()[source]

Follow the OpenStax Tutor Beta link.

is_displayed()[source]

Return True if the panel is displayed.

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

Bases: pypom.region.Region

The Where we’re going panel.

go_to_research()[source]

Follow the research in learning science link.

go_to_student_learning()[source]

Follow the improving student learning link.

is_displayed()[source]

Return True if the panel is displayed.

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

Bases: pypom.region.Region

The Who we are panel.

go_to_faq()[source]

Follow the FAQ link.

go_to_foundations()[source]

Follow the philanthropic foundations link.

go_to_resources()[source]

Follow the educational resources link.

is_displayed()[source]

Return True if the panel is displayed.

property content_map

Return the content map element.

is_displayed()[source]

Return True when the About Us page is loaded.

property loaded

Wait until the three panels are displayed.

property what_we_do

Access the What we do panel.

property where_were_going

Access the Where we’re going panel.

property who_we_are

Access the Who we are panel.

exception pages.web.about.PageNotFound[source]

Bases: Exception

Page is not a known destination error.

pages.web.accessibility module

The OpenStax Web accessibility statement page.

class pages.web.accessibility.Accessibility(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The accessibility statement.

URL_TEMPLATE = '/accessibility-statement'
is_displayed()[source]

Return True if the first statement header is displayed.

property loaded

Wait until the statement is found.

property sections

Access the section headers.

pages.web.adopters module

OpenStax material adopters.

class pages.web.adopters.Adopters(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

Adopters page.

URL_TEMPLATE = '/adopters'
property adopters

Return the list of adopters.

is_displayed()[source]

Return True if the adopters page is loaded.

property loaded

Wait until the institution list is displayed.

pages.web.adoption module

The book adoption form.

class pages.web.adoption.Adoption(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The adoption form page.

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

Bases: pypom.region.Region

The adoption form.

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

Bases: pypom.region.Region

A book checkbox option.

property checked

Return True if the book option is checked.

property has_image

Return True if the book check option has an image.

property image

Return the image element.

select()[source]

Click the checkbox.

property title

Return the book title.

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

Bases: pypom.region.Region

A suggested school name.

property name

Return the school name.

select()[source]

Click on the school name to select it.

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

Bases: pypom.region.Region

Technology in use by the instructor or school.

property checked

Return True if the company option is checked.

property company

Return the company or product name.

select()[source]

Click the checkbox.

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

Bases: pypom.region.Region

Additional information concerning each book adoption.

adopted()[source]

Select the ‘Fully adopted’ option.

recommend()[source]

Select the ‘Recommending the book’ option.

property students

Return the students input element.

property students_error

Return the error message, if any, on the student field.

property title

Return the book title.

property using_error

Return the error message, if any, on the radio fields.

back()[source]

Click the Back button.

property books

Access the book selector checkboxes.

property email

Return the email input box.

property first_name

Return the first name input box.

property get_book_error

Return the book section error message.

property get_user_errors

Return the error messages.

property get_using_errors

Return the usage section error messages.

go_back(destination=<class 'pages.web.base.WebBase'>, url=None)[source]

Click the student GO BACK button.

property last_name

Return the last name input box.

property loaded

Return True when the form is visible.

next()[source]

Click the Next button.

property options

Return the option menu responses.

property other

Return the other option input box.

property phone

Return the phone number input box.

property school

Return the school name input box.

property school_suggestions

Return a list of school name suggestions.

Based on a filter of the text in the school name input box.

select(user_type, retry=0)[source]

Select a user type from the user drop down menu.

select_books(book_list)[source]

Select the checkboxes for submitted book list.

select_tech(providers, other=None)[source]

Select the tech partners in use.

set_using(book_list)[source]

Select the status and student count for each book.

property student_message

Return the message content for student users.

Drop the text from the child element first.

submit()[source]

Click the Submit form button.

property technology

Access the technology provider information sections.

property usage

Access the usage information section for each selected book.

URL_TEMPLATE = '/adoption'
property form

Access the adoption form.

go_to_interest(link=None)[source]

Switch to the interest form.

is_displayed()[source]

Return True if the adoption form is displayed.

property loaded

Wait until the form is found.

submit_adoption(user_type, first, last, email, phone, school, books, tech_providers=None, other_provider=None)[source]

Fill out and submit the adoption form.

Args:
user_type (str): the user’s role

Web.STUDENT, Web.INSTRUCTOR, Web.ADMINISTRATOR, Web.LIBRARIAN, Web.DESIGNER, Web.HOMESCHOOL, Web.ADJUNCT, or Web.OTHER

first (str): the user’s first name last (str): the user’s last name email (str): the user’s email address phone (str): the user’s telephone number school (str): the user’s school affiliation books (dict): a dictionaries of dictionaries for adopted books

Book short name (str): the shortened book title Adoption status (str): Web.ADOPTED or Web.RECOMMENDED Students (int): number of students being taught per semester

{
‘AP Biology’: {

‘status’: Web.ADOPTED, ‘students’: 30

}, <book-short-name>: {

‘status’: <status>, ‘students’: <students>

}

}

tech_providers (list): a list of technology partners under use

[Web.TechProviders.<provider>]

other_provider (str): a string of unlisted providers to be

used when Web.TechProviders.OTHER is in tech_providers

class pages.web.adoption.AdoptionConfirmation(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The adoption confirmation page.

URL_TEMPLATE = '/adoption-confirmation'
property another

Return the ‘Report another …’ link.

is_displayed()[source]

Return True if the ‘Report another …’ link is displayed.

property loaded

Wait until the confirmation is displayed.

report_another()[source]

Click on the ‘Report another …’ link.

property survey_available

Return True if a survey is available.

pages.web.base module

Basic page parent for all OpenStax Web pages.

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

Bases: pypom.page.Page

Base class.

back()[source]

Go back to the previous page.

close_tab()[source]

Close the current tab and switch to the remaining one.

Assumes 2 browser tabs are open.

property footer

Return Web footer.

property is_phone

Return True if the browser window is within the phone width.

property is_safari

Return True if the browser in use is Safari.

property loaded

Return True when the page-loaded class is added to the body tag.

property location

Return the current page URL.

Returns

the current page URL

Return type

str

open()[source]

Open the page.

property openstax_nav

Access the OpenStax header navigation.

property privacy_notice

Access the privacy notice.

reload()[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).

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

Set the browser window size.

Args:

width (int): browser window width, default 4:3 height (int): browser window height, default 4:3

property sticky_note

Access the sticky note.

property survey

Access the Pulse Insights pop up survey.

property url

Return the last segment of the current URL.

property web_nav

Access the website header navigation.

pages.web.blog module

The OpenStax blog.

class pages.web.blog.Article(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.blog.Blog

The OpenStax web log article.

URL_TEMPLATE = '/blog/{article}'
property disqus

Return the Disqus iframe.

Returns

the Disqus iframe element

Return type

WebElement

is_displayed()[source]

Return True if the blog article banner image is displayed.

Returns

True if the blog article banner image and the Disqus comments widget are displayed

Return type

bool

property title

Return the article title.

Returns

the blog article title

Return type

str

view_comments()[source]

Scroll to the Disqus comment section.

Returns

the blog article

Return type

Article

Scroll to the other blog article tiles.

Returns

the blog article

Return type

Article

wait_for_page_to_load()[source]

Override the page load function.

Wait for the other blog article tiles and the article banner to load.

Returns

None

class pages.web.blog.Blog(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The OpenStax web log.

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

Bases: pypom.region.Region

A blog entry overview tile.

property authors

Return the article authors and editors.

Returns

the article author(s)/editor(s) as a single string

Return type

str

property date

Return the article publish date string.

Returns

the article’s publish date string

Return type

str

property excerpt

Return the article excerpt or subheading.

Returns

the trimmed article excerpt or the article subheading plus the excerpt

Return type

str

get_date()[source]

Return a timezone-aware datetime of the publish date.

Returns

the article’s publish date as a timezone-aware datetime

Return type

datetime

property image

Return the tile picture element.

Returns

the tile’s banner image element

Return type

WebElement

is_displayed()[source]

Return True if the tile has children.

Returns

True if the tile is displayed and the tile has loaded child elements (it entered the viewable window for at least 0.1 seconds)

Return type

bool

property title

Return the article title.

Returns

the blog article title

Return type

str

view()[source]

Open the article.

Returns

the full blog entry article

Return type

Article

URL_TEMPLATE = '/blog'
property articles

Return a list of articles.

Include the pinned article, if it exists.

Returns

a list of available blog entries

Return type

list(Article)

get_newsletter()[source]

Select the ‘Sign Up’ button.

Returns

the OpenStax newsletter signup form in a new window

Return type

NewsletterSignup

get_rss()[source]

Click the RSS feed icon.

Returns

None

is_displayed()[source]

Return True if the blog pinned article is displayed.

Returns

True when the pinned blog article entry is displayed

Return type

bool

property loaded

Return True when all of the blog article images are loaded.

Returns

True when the blog article background images are loaded

Return type

bool

property other_posts

Return the other blog entry tiles.

Returns

a list of blog entries, excluding the pinned article

Return type

list(Article)

property pinned

Access the pinned entry.

Returns

the pinned blog entry tile

Return type

Tile

test_rss_feed()[source]

Query the RSS feed URL.

Returns

the result from a HEAD request to the RSS feed

Return type

Response

view_post(title=None, index=None)[source]

Open a blog entry to view the full article.

If no title or index is provided, return a random blog article

Parameters
  • title (str) – (optional) select an article to view by its title

  • index (int) – (optional) select an article by it list index

Returns

a blog article

Return type

Article

pages.web.book module

A marketing page for an OpenStax book.

class pages.web.book.Accordion(page, root=None)[source]

Bases: pypom.region.Region

A base region for phone-view expandable menus.

is_displayed()[source]

Return True if the menu is open.

property is_open

Return True if the menu is open.

toggle()[source]

Click on a toggle bar to open or close the menu.

class pages.web.book.AccordionSubRegion(page, root=None)[source]

Bases: pages.web.book.Accordion

A base region for accordion subsections.

class pages.web.book.Book(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

A book details page.

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

Bases: pypom.region.Region

The book details main region.

property digital_isbns

Return the digital book ISBNs.

property errata_append

Return the errata URL append.

property errata_text

Return the errata explanation text.

property has_nonsenior_authors

Return True if the contributing authors section exists.

property has_senior_authors

Return True if the senior authors section exists.

property ibook_isbns

Return the iBook ISBNs.

is_displayed()[source]

Return True if the book details content is visible.

property license

Return the license information.

property nonsenior_authors

Return the list of non-senior authors.

property options

Return the available sideboar options.

property print_isbns

Return the print book ISBNs.

property published_on

Return the publishing date.

property senior_authors

Return the list of senior authors.

submit_errata()[source]

Click on the ‘Suggest a correction’ button.

property summary

Return the book summary.

view_errata()[source]

Click on the ‘Errata list’ button.

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

Bases: pages.web.book.ResourceTab

The instructor resources tab.

is_displayed()[source]

Return True if the instructor resources content is visible.

property oer_commons

Return the OER Commons resource.

property partners

Return a list of available resources.

sign_up()[source]

Click the account sign up link.

property tech_options

Return the partners heading element.

view_webinars()[source]

Click on the ‘Find a webinar’ link.

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

Bases: pages.web.book.ResourceTab

The partner resources tab.

is_displayed()[source]

Return True if the partner resources content is visible.

property partners

Return a list of available resources.

property resources

Override the resource box property.

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

Bases: pypom.region.Region

The book details page for small devices.

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

Bases: pages.web.book.Accordion

The compact bood details pane.

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

Bases: pages.web.book.AccordionSubRegion

The authors information section.

property has_nonsenior_authors

Return True if the other authors section exists.

property has_senior_authors

Return True if the senior authors section exists.

property nonsenior_authors

Return a list of non-senior authors.

property senior_authors

Return a list of senior authors.

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

Bases: pages.web.book.AccordionSubRegion

The product details information section.

property digital_isbns

Return the digital book ISBNs.

property ibook_isbns

Return the iBook ISBNs.

property license

Return the license information.

property print_isbns

Return the print book ISBNs.

property authors

Access the authors section.

property product_details

Access the product details section.

property summary

Return the book summary text.

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

Bases: pages.web.book.Accordion

The compact errata information pane.

property errata_append

Return the errata URL append.

property errata_text

Return the errata explanation text.

submit_errata()[source]

Click on the ‘Suggest a correction’ button.

view_errata()[source]

Click on the ‘Errata list’ button.

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

Bases: pages.web.book.Accordion

The compact instructor resource pane.

property partners

Return the list of available partner resources.

resource_by_name(name)[source]

Return a resource box by its name.

property resources

Return the list of available instructor resources.

resources_by_option(option)[source]

Return a list of resources with a particular option.

resources_by_status(message)[source]

Return a list of resources with a particular status.

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

Bases: pages.web.book.Accordion

The compact student resource pane.

resource_by_name(name)[source]

Return a resource box by its name.

property resources

Return the list of available student resources.

resources_by_option(option)[source]

Return a list of resources with a particular option.

resources_by_status(message)[source]

Return a list of resources with a particular status.

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

Bases: pages.web.book.Accordion

The compact table of contents pane.

property chapters

Access the chapter list.

get(number=None, chapter=None)[source]

Return a particular chapter and scroll it into view.

view_online()[source]

View the book on CNX.org.

property details

Access the book details pane.

download_pdf()[source]

Click the download link.

property errata

Access the errata pane.

property ibooks

Return the available iBook links.

property instructor

Access the instructor resources pane.

property options

Return the available sideboar options.

property order_book

Access the book order options.

property student

Access the student resources pane.

submit_adoption_form()[source]

Go to the adoption form.

submit_interest_form()[source]

Go to the interest form.

property table_of_contents

Access the table of contents pane.

view_book_order_options()[source]

Open the Book Order modal.

view_bookshare()[source]

Open the Bookshare page for the textbook.

view_ibook(book=1)[source]

Open the iTunes store page for the iBook.

view_kindle()[source]

Open the Amazon store page for the Kindle ebook.

view_online()[source]

View the book on CNX.org.

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

Bases: pypom.region.Region

The large view sidebar.

download_pdf()[source]

Click the download link.

property ibooks

Return the available iBook links.

property options

Return the available sideboar options.

property order_book

Access the book order options.

property pdf_url

Return the book PDF download URL.

submit_adoption_form()[source]

Go to the adoption form.

submit_interest_form()[source]

Go to the interest form.

property table_of_contents

Access the book table of contents.

view_book_order_options()[source]

Open the Book Order modal.

view_bookshare(url=False)[source]

Open the Bookshare page for the textbook.

view_ibook(book=1, url=False)[source]

Open the iTunes store page for the iBook.

view_kindle(url=False)[source]

Open the Amazon store page for the Kindle ebook.

view_online(get_url=False)[source]

View the book on CNX.org.

view_table_of_contents()[source]

Open the Table of Contents slideout.

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

Bases: pages.web.book.ResourceTab

The student resources tab.

is_displayed()[source]

Return True if the student resources content is visible.

URL_TEMPLATE = '/details/books/{book_name}'
property details

Access the book details.

property instructor

Access the instructor resources.

is_displayed()[source]

Return True if the book details banner image is displayed.

is_interested()[source]

Click the interest report link.

is_using()[source]

Click the adoption report link.

property loaded

Return True when the book details page is loaded.

property phone

Access the book details for mobile devices.

select_tab(tab)[source]

Select a specific resource tab.

property sidebar

Access the sidebar links.

property student

Access the student resources.

property table_of_contents

Shortcut the table of contents.

property tabs

Return the resource tabs.

property title

Return the book title.

class pages.web.book.BookOrder(page, root=None)[source]

Bases: pages.web.book.Modal

The book order modal dialog box.

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

Bases: pypom.region.Region

An order box.

property additional_information

Return any post-button information.

property description

Return the box description.

select(url=True)[source]

Click on the order option.

property title

Return the intended user type.

property boxes

Access the order boxes.

class pages.web.book.Chapter(page, root=None)[source]

Bases: pypom.region.Region

An individual book chapter listing.

property chapter

Return the chapter number.

property sections

Return the section names.

property title

Return the chapter title.

class pages.web.book.CompCopyRequest(page, root=None)[source]

Bases: pages.web.book.Modal

The complementary book copy request form modal box.

cancel()[source]

Cancel out of the form.

property cover

Return the book cover image element.

get_error()[source]

Return the validation message if the students field is invalid.

property is_valid

Return True if the student input is valid.

property loaded

Return True when the modal content exists.

property students

Return the students enrollment input box.

submit()[source]

Submit the request form.

property title

Return the book title being requested.

class pages.web.book.CompCopyRequestReceipt(page, root=None)[source]

Bases: pages.web.book.Modal

The request receipt modal box.

close()[source]

Click the dialog close button.

property heading

Return the banner title text.

property loaded

Wait until the confirmation message is available.

property text

Return the confirmation message.

class pages.web.book.Modal(page, root=None)[source]

Bases: pypom.region.Region

A base setup for the page modals.

close()[source]

Close the order form.

is_displayed()[source]

Return True if the order modal is currently active.

property root

Override the root variable.

class pages.web.book.Partner(page, root=None)[source]

Bases: pypom.region.Region

A partner resource.

property cost

Return the resource average cost range.

Returns

the partner resource average cost range

Return type

str

property name

Return the partner’s name.

Returns

the partner resource name

Return type

str

property type

Return the partner resource type.

Returns

the partner resource type

Return type

str

view_partner() → pages.web.base.WebBase[source]

Click on the partner resource box.

Returns

the partners page displaying the partner resource information

Return type

Partners

class pages.web.book.Resource(page, root=None)[source]

Bases: pypom.region.Region

A resource box.

property can_be_downloaded

Return True if the resource is available for download.

property description

Return the resource description.

is_displayed()[source]

Return True if the box is displayed.

property is_external

Return True if the resource is an external site.

property is_locked

Return True if the resource is locked requiring a login.

select()[source]

Click on the resource box.

property status_message

Return the status message text.

property title

Return the resource title or company name.

class pages.web.book.ResourceTab(page, root=None)[source]

Bases: pypom.region.Region

A base region for instructor and student resources.

resource_by_name(name)[source]

Return a resource box by its name.

property resources

Return a list of available resources.

resources_by_option(option)[source]

Return a list of resources with a particular option.

resources_by_status(message)[source]

Return a list of resources with a particular status message.

property slogan

Return the instructor resource slogan.

class pages.web.book.TableOfContents(page, root=None)[source]

Bases: pypom.region.Region

The book table of contents slide-out display.

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

Bases: pypom.region.Region

A table of contents chapter or other primary content.

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

Bases: pypom.region.Region

A chapter or content sub-unit.

property number

Return the section or subsection number.

Returns

the section or subsection number, if found, otherwise an empty string

Return type

str

property title

Return the section or subsection title.

Returns

the section or subsection title

Return type

str

property unnumbered

Return True if the section or subsection is unnumbered.

Returns

True if the section or subsection is unnumbered

Return type

bool

property url

Return the CNX URL for the section.

Returns

the CNX URL for the linked section

Return type

str

property number

Return the chapter or content number.

Returns

the chapter or content number, if found, otherwise an empty string

Return type

str

property subsections

Access the chapter or content units.

Returns

the list of available units or subsections

Return type

list( Unit)

property title

Return the chapter or content title.

Returns

the chapter or content title

Return type

str

property unnumbered

Return True if the chapter or content is unnumbered.

Returns

True if the chapter or content is unnumbered

Return type

bool

property chapters

Access the chapter list.

close() → pages.web.book.Book[source]

Close the table of contents.

Returns

the book page

Return type

Book

get(number=None, chapter=None)[source]

Return a particular chapter and scroll it into view.

is_displayed() → bool[source]

Return True when the table of contents is open.

Returns

True when the table of contents is open

Return type

bool

property is_open

Return True when the table of contents is open.

Returns

True when the table of contents has height

Return type

bool

property preface

Return the book’s preface CNX URL.

Returns

the CNX URL for the book’s preface (the first link in the table of contents)

Return type

str

property sections

Access the table of contents sections.

Returns

the list of available chapters and other sections

Return type

list(Section)

view_online(get_url=False)[source]

View the book on CNX.org.

pages.web.bookstore_suppliers module

The textbook suppliers page.

class pages.web.bookstore_suppliers.Bookstore(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The print bookstore supplier page.

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

Bases: pypom.region.Region

A print copy price list.

property country

Return the price list country.

Returns

the country name for the pricing list

Return type

str

property url

Return the URL for the price list PDF.

Returns

the source URL for the price list PDF document

Return type

str

view()[source]

Click the ‘Order from’ button.

Returns

None

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

Bases: pypom.region.Region

A print copy provider.

property description

Return the bookstore company description.

Returns

the company description

Return type

str

property has_candian_flag

Return True if the Canadian flag icon is displayed.

Returns

True if the bookstore provider has a Canadian flag icon displayed

Return type

bool

property name

Return the bookstore name.

Returns

the bookstore company name

Return type

str

order_from()[source]

Click the ‘Order from’ button.

Returns

None

property url

Return the bookstore provider webpage URL.

Returns

the URL for the bookstore provider

Return type

str

URL_TEMPLATE = '/bookstore-suppliers'
property description

Return the explanation text.

Returns

the subheading text for either large or small displays

Return type

str

is_displayed() → bool[source]

Return True when the bookstore providers are found.

Returns

True when the preferred and other providers are found

Return type

bool

property other_providers

Access the non-preferred OpenStax book provider blocks.

Returns

the list of other available bookstore provider blocks

Return type

list(Provider)

property preferred_provider

Access the preferred OpenStax book provider block.

Returns

the preferred bookstore provider box

Return type

Provider

property price_lists

Access the book price list by available countries.

Returns

the list of book pricing by country

Return type

list(PriceList)

subjects_page() → pages.web.subjects.Subjects[source]

Click the ‘Subjects page’ link in the larger screen description.

Returns

the book subjects page

Return type

Subjects

:raises WebException: if the link is unavailable

because the user is viewing the page on a phone resolution

property title

Return the page heading.

Returns

the page heading

Return type

str

pages.web.careers module

The OpenStax jobs board.

class pages.web.careers.Careers(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The OpenStax jobs board.

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

Bases: pypom.region.Region

A job entry.

property title

Return the job title.

Returns

the job title

Return type

str

property url

Return the Rice Jobs posting URL.

Returns

the Rice jobs board posting for the position

Return type

str

view_position()[source]

Click on the position name to view the Rice Jobs board.

Returns

the job posting on the Rice Jobs board

Return type

RiceJobs

URL_TEMPLATE = '/careers'
is_displayed() → bool[source]

Return True if the heading is displayed.

Returns

True if the job list is populated

Return type

bool

property job_list

Return the content within the open positions element.

Returns

the job list content inner HTML

Return type

str

property jobs

Access the available jobs.

Returns

the list of available OpenStax jobs

Return type

list(Job)

property loaded

Return True when text content is found.

Returns

True when the text content is found and the async overlay is not

Return type

bool

pages.web.contact module

The Web contact form.

class pages.web.contact.Contact(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The web contact form.

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

Bases: pypom.region.Region

The Contact Us form.

ERROR = ' ~ span'
property email

Return the email input.

property errors

Return any form validation errors.

property message

Return the message body text box.

property name

Return the name input.

send()[source]

Submit the contact message.

property topic

Return the current message topic.

property topic_drop_down

Return the contact message subject drop down menu.

URL_TEMPLATE = '/contact'
property address

Return the OpenStax mailing address.

property form

Access the contact form.

is_displayed()[source]

Return True if the heading is displayed.

property loaded

Return True when the form and sidebar text are found.

property support

Return the user support link.

property title

Return the page title.

visit_the_support_center()[source]

Click on the support link.

class pages.web.contact.ContactConfirmation(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The post-contact form submission confirmation page.

property button

Return the subjects button.

is_displayed()[source]

Return True when loaded.

property loaded

Return True when the view subjects button is displayed.

property title

Return the page title.

view_subjects()[source]

Click on the Subjects button.

pages.web.donation module

pages.web.errata module

OpenStax book errata.

class pages.web.errata.Errata(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The errata list for a particular book.

ALL = 0
ASCENDING = 'sortdir1'
CORRECTED = 3
DATE = 0
DECISION = 4
DESCENDING = 'sortdir-1'
class ErrataItem(page, root=None)[source]

Bases: pages.web.errata.ErrataBase

An errata entry.

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

Bases: pypom.region.Region

An errata filter.

property is_selected

Return True if the filter is currently selected.

select()[source]

Select the errata filter.

property value

Return the filter option name.

ID = 1
IN_REVIEW = 1
class MobileErrataItem(page, root=None)[source]

Bases: pages.web.errata.ErrataBase

An errata entry for a mobile display.

REVIEWED = 2
SOURCE = 2
TYPE = 3
URL_TEMPLATE = '/errata/?book={book}'
property correction_schedule

Return the tooltip.

property errors

Access the individual errata entries.

filter_by(_filter=0)[source]

Select an errata display filter.

property filters

Access the errata filters.

is_displayed()[source]

Return True if the errata table is displayed.

property loaded

Wait for the page loader and table data.

If there isn’t data (eg a new book), sleep 3 seconds then return.

property order_options

Access the sort options.

sort_by(sort=0, direction='sortdir-1')[source]

Sort the errata list by a column header.

property title

Return the book title.

property tooltip

Return the tooltip anchor.

view_correction_schedule()[source]

Mouse over the schedule and check that it shows.

class pages.web.errata.ErrataBase(page, root=None)[source]

Bases: pypom.region.Region

Base region for errata entries.

property decision

Return the current errata decision.

property errata_id

Return the errata ID number.

property error_type

Return the errata type.

property found_in

Return the location of the error.

property source

Return the errata submission source.

submission_date()[source]

Return an aware date time.

property submitted_on

Return the date the errata was submitted.

view_errata()[source]

View the errata item in detail.

class pages.web.errata.ErrataDetail(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

A detailed view for a single errata item.

URL_TEMPLATE = '/errata/{_id}'
property completed_on

Return the date the errata review was completed.

property description

Return the full issue description.

property errata_id

Return the errata ID.

property errata_list

Return the errata list link element.

property error_type

Return the errata type.

property found_in

Return the location where the issue was found.

property in_review

Return the date the errata was submitted.

is_displayed()[source]

Return True if the progress bar is displayed.

property loaded

Return True when an errata ID is found.

return_to_errata_list()[source]

Return to the book’s errata list.

property reviewed_on

Return the date the errata was reviewed.

property source

Return the errata source location.

property status

Return the current status of the errata submission.

property submitted_on

Return the date the errata was submitted.

property title

Return the book title.

class pages.web.errata.ErrataForm(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The errata submission form.

URL_TEMPLATE = '/errata/form?book={book}'
is_displayed()[source]

Return True if the form is displayed.

property loaded

Return True when an errata form and book title are found.

property subject

Return the currently selected book title.

pages.web.faq module

The frequently asked questions page.

class pages.web.faq.FAQ(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The OpenStax frequently asked questions.

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

Bases: pypom.region.Region

A frequently asked question.

property answer

Return the answer text.

property answer_is_visible

Return True if the answer is visible.

property question

Return the question text.

toggle()[source]

Open or close the question.

URL_TEMPLATE = '/faq'
property heading

Return the heading text.

is_displayed()[source]

Return True if the main content is loaded.

property loaded

Return True if the hero banner is found.

property questions

Return the list of frequently asked questions.

property title

Return the page title.

visit_support()[source]

Click the ‘support page’ link.

pages.web.home module

OpenStax’s Web home page.

Bases: pypom.region.Region

Internal information regions.

click()[source]

Go to the link destination.

Return a ‘Destination’ so the function will fail if a new link is added.

is_displayed()[source]

Return True if the link root is displayed.

Return the link element.

property text

Return the resource blurb.

property title

Return the resource title.

class pages.web.home.WebHome(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

OpenStax Web home page.

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

Bases: pypom.region.Region

The banner carousel.

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

Bases: pypom.region.Region

An individual banner.

click()[source]

Go to the banner link destination.

Return a ‘Destination’ so the function will fail if a new banner link is added.

property destination

Return the destination URL.

property image

Return the image file name.

Retrieve the style for the background image. Extract the CSS URL using a regular expression. Strip off the CSS URL delimiter. Split the URL and return the filename.

is_displayed()[source]

Return True if the banner is visible.

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

Bases: pypom.region.Region

An individual sellection button.

click()[source]

Select a dot to display the corresponding banner.

property is_active

Return True if the banner’s dot is selected.

property banners

Access the banner.

property dots

Access the banner dot buttons.

is_displayed()[source]

Return True when the carousel is displayed.

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

Bases: pypom.region.Region

The Privacy and Cookies dialog box pop up.

property content

Return the dialog box text content.

Returns

the Privacy and Cookies dialog box text content

Return type

str

displayed() → bool[source]

Return True if the dialog box is displayed.

Returns

True if the dialog box is displayed

Return type

bool

got_it() → pages.web.home.WebHome[source]

Click the ‘Got it!’ button.

Returns

the home page

Return type

WebHome

privacy_policy() → pages.web.legal.PrivacyPolicy[source]

Click on the privacy policy link.

Returns

the privacy policy page

Return type

PrivacyPolicy

property title

Return the dialog box title.

Returns

the Privacy and Cookies dialog box title

Return type

str

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

Bases: pypom.region.Region

Education and page links.

property box_one

Return element one.

property box_two

Return element two.

Access the educational links.

property quote

Return the quote text.

show()[source]

Scroll the section into view.

property student

Return the student image element.

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

Bases: pypom.region.Region

Information buckets.

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

Bases: pages.web.home.Link

Individual information boxes.

property has_image

Return True if the box has an image.

select()[source]

Click the information bucket.

property box

Access the individual buckets.

show()[source]

Scroll the section into view.

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

Bases: pypom.region.Region

Quotes and page links.

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

Bases: pypom.region.Region

A single quote box.

property button

Return the button or link element.

click()[source]

Go to the link destination.

Return a ‘Destination’ so the function will fail if a new quote is added.

property has_button

Return True if the quote box has a link or button.

property has_image

Return True if the quote box has a background image.

property image

Return the image element.

is_displayed()[source]

Return True if the quote box is displayed.

show()[source]

Scroll the quote box into view.

property text

Return the quote text.

get(index)[source]

Return a particular quote box.

property quotes

Access the individual quotes.

URL_TEMPLATE = ''
property carousel

Access the book banner carousel.

property education

Access the education section and related links.

property information

Access the informational links.

is_displayed()[source]

Return True when the Web home page is displayed.

property loaded

Return True when the banner carousel and navs are displayed.

property privacy

Access the privacy and cookies notice.

Returns

the privacy and cookies dialog notice

Return type

Dialog

property quotes

Access the quote buckets.

pages.web.impact module

The OpenStax textbook impact webpage.

class pages.web.impact.Impact(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The Impact page.

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

Bases: pypom.region.Region

A student use stat box.

property description

Return the number’s description.

Returns

the stat number’s description/explanation

Return type

str

property number

Return the stat number.

Returns

the textbook use stat number

Return type

str

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

Bases: pypom.region.Region

A user testimonial box.

property content

Return the testimonial quote.

Returns

the textbook use testimonial text quote

Return type

str

read_more() → pages.web.blog.Article[source]

Click the testimonial ‘Read more >’ link.

Returns

the testimonial’s associated blog entry

Return type

Article

business_textbooks() → pages.web.subjects.Subjects[source]

Click the ‘business textbooks’ link.

Returns

the subjects page displaying the business books

Return type

Subjects

property description

Return the page description.

Returns

the impact page description

Return type

str

property disruption

Return the positive disruption to textbook prices statement.

Returns

the price disruption statement

Return type

str

property doerr_statement

Return the Ann Doerr education revolution statement.

Returns

the Ann Doerr revolution in education letter

Return type

str

explore_our_interactive_map() → pages.web.global_reach.GlobalReach[source]

Click the interactive map link.

Returns

the global reach page

Return type

GlobalReach

give_today(use_banner_button: bool = True) → pages.rice.riceconnect.RiceConnect[source]

Click a ‘Give today!’ button.

Parameters

use_banner_button (bool) – (optional) click the banner donation button when True or the Give section button when False

Returns

the RiceConnect OpenStax donation page

Return type

RiceConnect

property giving

Return the donation request.

Returns

the donation and support request

Return type

str

property heading

Return the page heading.

Returns

the impact page heading statement

Return type

str

is_displayed() → bool[source]

Return True if the impact page title and description are displayed.

Returns

True when the impact page title and description are displayed

Return type

bool

learn_more_about_openstax_tutor_beta() → pages.web.tutor.TutorMarketing[source]

Click the ‘Learn more about OpenStax Tutor Beta’ link.

Returns

the OpenStax Tutor Beta marketing page

Return type

TutorMarketing

property loaded

Return True when the impact page heading is found.

Returns

True when the impact page heading is found

Return type

bool

property looking_ahead

Return the OpenStax ecosystem outlook statement.

Returns

the planned direction statement for the OpenStax ecosystem

Return type

str

property partnerships

Return the textbook ecosystem partnerships statement.

Returns

the textbook ecosystem partnerships statement

Return type

str

property philanthropic_partners

Return the philanthropic partners statement and quote.

Returns

the philanthropic thank you and Bob Maxfield’s quote

Return type

str

see_a_full_list_of_our_partners() → pages.web.partners.Partners[source]

Click the partnership link.

Returns

the OpenStax ecosystem partners page

Return type

Partners

property student_reach

Return the student impact statement.

Returns

the student reach and impact statement

Return type

str

property student_reach_stats

Access the student impact number boxes.

Returns

the list of student impact boxes

Return type

list(StatBox)

property testimonials

Access the user testimonial quote boxes.

Returns

the list of user testimonial quote boxes

Return type

list(Testimonial)

property textbook_use

Return the global textbook use statement.

Returns

the global use of OpenStax textbooks statement

Return type

str

property tutor

Return the OpenStax Tutor Beta overview statement.

Returns

the OpenStax Tutor Beta overview statement

Return type

str

property vision_statement

Return the founding vision statement.

Returns

the founding vision statement

Return type

str

pages.web.interest module

The interest form page.

class pages.web.interest.Interest(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.adoption.Adoption

The book interest form.

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

Bases: pages.web.adoption.Form

The interest form.

heard(heard_on)[source]

Select each method of introduction to OpenStax.

receive(resources)[source]

Select each additional resource option.

property selected_books

Return a list of selected book elements.

property selection

Return a list of selected books.

property students

Return the semester student count element.

property using_error

Return the student section error message.

URL_TEMPLATE = '/interest'
go_to_adoption()[source]

Switch to the adoption form.

submit_interest(user_type, first, last, email, phone, school, books, students, additional_resources, heard_on, tech_providers=None, other_provider=None)[source]

Fill out and submit the interest form.

Args:
user_type (str): the user’s role

Web.STUDENT, Web.INSTRUCTOR, Web.ADMINISTRATOR, Web.LIBRARIAN, Web.DESIGNER, Web.HOMESCHOOL, Web.ADJUNCT, or Web.OTHER

first (str): the user’s first name last (str): the user’s last name email (str): the user’s email address phone (str): the user’s telephone number school (str): the user’s school affiliation books (list): a list of book short names students (int): the number of students taught in a semester

number must be greater than or equal to one

additional_resources (list): a list of additional resource options

Web.HOMEWORK, Web.COURSEWARE, and/or Web.TOOLS

heard_on (list): a list of marketing sources

Web.BY_WEB_SEARCH, Web.BY_COLLEAGUE, Web.AT_CONFERENCE, Web.BY_EMAIL, Web.BY_FACEBOOK, Web.BY_TWITTER, Web.BY_WEBINAR, Web.BY_PARTNER

tech_providers (list): a list of tech partners user use

[Web.TechProviders.<provider>]

other_providers (str): a string of unlisted providers to be used

when Web.TechProviders.OTHER is in tech_providers

class pages.web.interest.InterestConfirmation(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.adoption.AdoptionConfirmation

The interest confirmation page.

URL_TEMPLATE = '/interest-confirmation'
back_to_books()[source]

Return to the subjects page.

property response

Return the response text.

property subjects

Return the ‘Back to the books’ link.

pages.web.legal module

The legal / intellectual property frequently asked questions page.

class pages.web.legal.LegalBase(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The base page for the legal document pages.

property content

Return the content wrapper.

property heading

Return the heading.

is_displayed()[source]

Return True if the heading is displayed.

property loaded

Return True when the content is available.

property text

Return the body text.

property title

Return the heading text.

class pages.web.legal.License(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.legal.LegalBase

The OpenStax.org licensing overview page.

class Question(question)[source]

Bases: object

A question and answer pair.

property answer

Return the answer text.

property question

Return the question text.

URL_TEMPLATE = '/license'
property attribution_license

Return the Attribution 4.0 license link.

property creative_commons

Return the Creative Commons link.

property questions

Access the questions and their answers.

view_attribution_license()[source]

Click on the CCBY 4.0 license link.

view_creative_commons()[source]

Click on the Creative Commons link.

class pages.web.legal.PrivacyPolicy(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.legal.LegalBase

The OpenStax.org terms of use.

URL_TEMPLATE = '/privacy-policy'
property gdpr

Return the GDPR link.

property privacy_content

Return the privacy policy content.

property sections

Access the section headings.

view(section)[source]

Scroll to the selected section heading.

view_gdpr()[source]

View the Rice GDPR policy.

class pages.web.legal.Terms(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.legal.LegalBase

The OpenStax.org terms of use.

URL_TEMPLATE = '/tos'

pages.web.newsletter module

The OpenStax marketing newsletter signup form.

class pages.web.newsletter.NewsletterSignup(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The newsletter signup form.

URL_TEMPLATE = 'http://www2.openstax.org/l/218812/2016-10-04/lvk'
is_displayed()[source]

Return True if the form is displayed.

property loaded

Return True when the form is displayed.

pages.web.partners module

OpenStax Partners.

class pages.web.partners.Institutional(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The OpenStax Institutional Partners page.

URL_TEMPLATE = '/institutional-partnership'
is_displayed() → bool[source]

Return True when the page is displayed.

Returns

True when the page is loaded and the title is found

Return type

bool

property loaded

Return True when the page is loaded.

Returns

True when the async hide class is not found, the template URL is in use, and the title banner is found

Return type

bool

class pages.web.partners.Partners(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The OpenStax Partners page.

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

Bases: pypom.region.Region

A company logo and summary link.

Return the anchor link to the company’s summary.

Return the company logo.

property name

Return the company name.

view()[source]

Click the company logo.

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

Bases: pypom.region.Region

An OpenStax Ally company summary.

property availability

Return the links to the resources available for an ally.

property description

Return the full company description.

property description_segments

Return the pared list of description paragraphs.

property header

Return the company name object.

property name

Return the company name.

return_to_top()[source]

Click the ‘Return to top’ link.

Return the ‘Return to top’ link element.

URL_TEMPLATE = '/partners'
property banner

Return the page heading object.

property companies

Access the OpenStax Ally companies by their logos.

property current_filter

Return the current filter.

property description

Return the subheading.

property filter

Return the currently selected filter button.

property filter_buttons

Access the subject filter buttons.

filter_by(option)[source]

Filter allies by a subject.

is_displayed()[source]

Return True if the hero banner is displayed.

property loaded

Return True if the title is set and images are visible.

Return the OpenStax Ally logo.

property logo_description

Return the ally logo meaning.

property summaries

Access the OpenStax Ally company summaries.

summary_by_name(name)[source]

Return the summary for a particular company name.

property title

Return the banner text.

pages.web.press module

The press and marketing page.

class pages.web.press.Press(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The press and marketing page.

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

Bases: pypom.region.Region

An OpenStax MarComm point of contact.

property email

Return the contact email address.

property name

Return the contact person’s name.

property phone

Return the contact telephone number.

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

Bases: pypom.region.Region

An OpenStax expert.

property bio

Return the expert’s short biography.

property has_portrait

Return True if the portrait exists.

is_displayed()[source]

Return True if the portrait is loaded and in the frame.

property name

Return the expert’s name.

property portrait

Return the expert’s picture.

property role

Return the expert’s role or job description.

FIRST = ' .nav-buttons div:first-child'
HEADLINE = ' .headline-container:not([hidden]) .press-excerpt'
LAST = ' .nav-buttons div:last-child'
MAIN = '.main-body '
MOBILE = '.mobile-view '
class Mention(page, root=None)[source]

Bases: pypom.region.Region

A news article mentioning OpenStax.

check_article()[source]

Check the HEAD request for the article URL.

property date

Return a timezone-aware date of publication.

property headline

Return the article headline.

property headline_element

Return the headline element.

Return the logo.

select()[source]

Follow the article link.

property source

Return the source organization name.

property url

Return the article URL.

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

Bases: pypom.region.Region

A social media option.

Request the HEAD of the media page.

property name

Return the Social media company name.

property select

Go to the OpenStax social media page.

property url

Return the link URL.

property url_name

Return the case-lowered company name found in the URL.

URL_TEMPLATE = '/press'
check_press_kit()[source]

Request the HEAD of the press kit download.

property contact

Return the press contact information.

property current_menu_item

Return the currently selected mobile menu option.

property experts

Access the OpenStax experts cards.

is_displayed()[source]

Return True if the heading is displayed.

property loaded

Return True when the four root elements are found.

property mentions

Access the news articles mentioning OpenStax.

property menu_options

Return the list of selection options.

property mission_displayed

Return True if the mission statements are displayed.

property mission_statements

Return the list of mission statements.

property press_kit

Return the press kit download button.

property releases

Access the press releases.

see_fewer_releases()[source]

Toggle the fewer / more press releases switch.

see_more_releases()[source]

Toggle the fewer / more press releases switch.

select(option)[source]

Select a mobile menu option.

property social

Access the OpenStax social pages.

property title

Return the title.

view_newer_mentions()[source]

View newer news articles mentioning OpenStax.

view_newer_releases()[source]

View newer OpenStax press releases.

view_older_mentions()[source]

View older news articles mentioning OpenStax.

view_older_releases()[source]

View older OpenStax press releases.

property viewing_fewer_releases

Return True if viewing the top two press releases.

class pages.web.press.PressRelease(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

A press release page.

URL_TEMPLATE = '/press/{article}'
property author

Return the press release author.

property content

Return the press release content.

property date

Return a timezone-aware date of publication.

property headline

Return the headline text.

property is_an_article

Return True if the page is a press release article.

is_displayed()[source]

Return True if the press release sections are available.

property loaded

Return True when the press release text is displayed.

property other_releases

Access the press releases.

see_fewer_releases()[source]

Toggle the fewer / more press releases switch.

see_more_releases()[source]

Toggle the fewer / more press releases switch.

view_newer_releases()[source]

View newer OpenStax press releases.

view_older_releases()[source]

View older OpenStax press releases.

property viewing_fewer_releases

Return True if viewing the top two press releases.

class pages.web.press.Release(page, root=None)[source]

Bases: pypom.region.Region

An OpenStax press release snippet.

property author

Return the name from the byline.

property byline

Return the byline text.

property continue_reading

Return the ‘Continue reading’ link.

property date

Return a timezone-aware date of release.

property excerpt

Return the excerpt.

property headline

Return the press release headline.

select()[source]

Select a press release to view the entire text.

pages.web.research module

The Web research overview page.

class pages.web.research.Research(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The researchers page.

ALUMNI_FIRST = ':first-child .entry'
ALUMNI_LAST = ':last-child .entry'
class Bar(page, root=None)[source]

Bases: pypom.region.Region

A group bar for a phone view accordion menu.

property is_open

Return True if the accordion region is open.

property name

Return the bar region group name.

toggle()[source]

Open or close the bar region.

property toggle_bar

Return the toggle bar element.

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

Bases: pypom.region.Region

A current research project.

property summary

Return the research summary.

property topic

Return the research project topic.

view()[source]

Scroll to the individual card.

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

Bases: pypom.region.Region

An alumni researcher or external collaborator.

property is_visible

Return True if the person’s card is in the viewport.

property name

Return the member’s name.

property role

Return the member’s role or affiliation.

view()[source]

Scroll to the individual card.

FULL = 'tab-content'
MEMBER = ' .members-tab .card'
PHONE = '.accordion-item'
class Person(page, root=None)[source]

Bases: pages.web.research.Entry

A current member of the research team.

property headshot

Return the image element.

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

Bases: pypom.region.Region

A research publication.

property authors

Return the authors from the headline.

property document

Return the publication PDF URL.

property headline

Return the headline text.

property summary

Return the publication summary.

property title

Return the publication title from the headline.

view()[source]

Scroll to the individual card.

property year

Return the publication year from the headline.

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

Bases: pypom.region.Region

A group tab view.

property is_open

Return True if the tab is currently selected.

property name

Return the tab group name.

select()[source]

Select a group tab to view.

URL_TEMPLATE = '/research'
property alumni

Access the research alumni cards.

property banner

Return the banner image elements.

property bars

Access the phone view group bars.

property external

Access the external collaborator cards.

is_displayed()[source]

Return True if the research page is displayed.

property loaded

Override the base loader.

property mission

Return the mission statement body.

property projects

Access the research project cards.

property publications

Access the published research paper overviews.

property tabs

Access the research team display tabs.

property team

Access the current research team member cards.

property title

Return the banner title.

pages.web.subjects module

The Subjects page.

class pages.web.subjects.Book(page, root=None)[source]

Bases: pypom.region.Region

A single book title.

property image

Return the image element.

property image_source

Return the image source URL.

property language

Return the book language.

select()[source]

Click on the book cover.

property title

Return the book title.

property url

Return the book URL.

property url_append

Return the last part of the URL.

class pages.web.subjects.Subjects(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The subjects page.

AUTHORS = 0
class About(page, root=None)[source]

Bases: pypom.region.Region

An About Our Textbooks blurb.

property blurb

Return the blurb text.

property title

Return the blurb title.

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

Bases: pypom.region.Region

Subject category information.

property books

Return category books.

property is_visible

Return True if the category is displayed.

property section

Return the category title.

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

Bases: pypom.region.Region

Subject filters.

property is_selected

Return True if the filter is active.

property subject

Return the filter subject.

property value

Return the category value.

view_books()[source]

Select the filter category to view the topic textbooks.

PEER_REVIEWED = 2
SEQUENCE = 1
URL_TEMPLATE = '/subjects'
property about

Return the about blurb texts.

property ap

Return the subjects filtered by the AP titles.

property ap_books

Select active AP books.

property available_books

Select active books.

property bookshare_books

Select active books available through Bookshare.

property business

Return the subjects filtered by the business titles.

property business_books

Select active business books.

category_xpath = '//div[h2[text()="{subject}"]]'
property college_success

Return the subjects filtered by the College Success titles.

property comp_copy

Select the current editions of each book.

property current_books

Select the current editions of each book.

property essentials

Return the subjects filtered by the essentials titles.

property essentials_books

Select active essentials books.

filter_toggle()[source]

Click on the filter menu to show the filter options.

property filters

Return the available filters.

property humanities

Return the subjects filtered by the humanities titles.

property humanities_books

Select active humanities books.

is_displayed()[source]

Return True if the subjects page is displayed.

is_filtered_by(subject_filter)[source]

Return True if the books are filtered by the submitted subject.

property itunes_books

Select active books with an iBook eddition available.

property kindle_books

Select active books with a Kindle edition available.

property loaded

Override the base loader.

property locked_instructor

Select active books with locked instructor resources.

property locked_student

Select active books with locked student resources.

property math

Return the subjects filtered by math titles.

property math_books

Select active math books.

property old_book_editions

Select the books with a newer editions available.

open()[source]

Open the page.

property openstax_books

Select active books while excluding Polish versions.

property polish_books

Select active books in Polish.

property print_books

Select the books with a current print edition available.

property science

Return the subjects filtered by the science titles.

property science_books

Select active science books.

select_book(book_title)[source]

Return the book page for a specific title.

Parameters

book_title (str) – the full book title found in the alt field

Returns

the book page for the selected title

Return type

Book

select_random_book(_from='openstax', filter_current=False)[source]

Return a random book from the active list.

property social_sciences

Return the subjects filtered by the social sciences titles.

property social_sciences_books

Select active social science books.

property total_filters

Return the number the filter options available.

property unlocked_instructor

Select active books with unlocked instructor resources.

property unlocked_student

Select active books with unlocked student resources.

view_about_our_textbooks()[source]

Scroll to the textbook blurbs.

wait_for_page_to_load()[source]

Override the page wait.

pages.web.supporters module

The foundation and corporate supporters page.

class pages.web.supporters.Supporters(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The foundation and corporate supporters page.

URL_TEMPLATE = '/foundation'
property blurb

Return the subheading text.

is_displayed()[source]

Return True if the supporters page is displayed.

property loaded

Return whether the hero banner is found.

property supporters

Return the list of funders.

property title

Return the banner title.

pages.web.team module

The OpenStax team and advisor page.

class pages.web.team.Individual(page, root=None)[source]

Bases: pypom.region.Region

A base class for members of the OpenStax team.

property bio

Return the advisor’s biography.

property is_visible

Return True if the person’s card is in the viewport.

property name

Return the advisor’s name.

view()[source]

Scroll to the advisor’s card.

class pages.web.team.Team(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The OpenStax team and advisors page.

ADVISOR = ' .people-tab.inline-bios .card:not(.bio)'
class Advisor(page, root=None)[source]

Bases: pages.web.team.Individual

A strategic advisor bio.

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

Bases: pypom.region.Region

A group bar for a phone view accordion menu.

property is_open

Return True if the accordion region is open.

property name

Return the bar region group name.

toggle()[source]

Open or close the bar region.

property toggle_bar

Return the toggle bar element.

FAB = ' '
FULL = 'tab-content'
class FacultyAdvisor(page, root=None)[source]

Bases: pages.web.team.Individual

A faculty advisory board member bio.

PERSON = ' .people-tab:not(.inline-bios) .card:not(.bio)'
PHONE = 'accordion-region'
class Person(page, root=None)[source]

Bases: pages.web.team.Individual

A staff member bio.

property bio

Return the person’s biography blurb.

Use a script because the bio is inserted inline with the cards and doesn’t fall within the card tree.

property bio_visible

Return True if the bio is currently open.

property has_bio

Return True if the person has an associated biography.

property headshot

Return the headshot image.

property role

Return the person’s role at OpenStax.

select()[source]

Click on the person’s card to open or close the bio.

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

Bases: pypom.region.Region

A group tab view.

property is_open

Return True if the tab is currently selected.

property name

Return the tab group name.

select()[source]

Select a group tab to view.

URL_TEMPLATE = '/team'
property advisors

Access the strategic advisors bio cards.

property banner

Return the banner image element.

property bars

Access the phone view group bars.

property fab

Access the faculty adisory board bio cards.

is_displayed()[source]

Return True if the team page is displayed.

property loaded

Return True when banner is visible.

property people

Access the OpenStax staff bio cards.

property subheading

Return the subheading text.

property tabs

Access the group tabs.

property title

Return the page title.

pages.web.technology module

The technology page.

class pages.web.technology.Technology(driver, base_url=None, timeout=60, **url_kwargs)[source]

Bases: pages.web.base.WebBase

The technology options page.

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

Bases: pypom.region.Region

Resource access steps.

BOOK = '[data-value={book}]'
INSTRUCTOR = '.step:nth-child(2) '
TECHNOLOGY = '.step:last-child '
property book_selected

Return the resource link border stylings.

select_book(book)[source]

Select a book from the proxy menu.

property title

Return the resource heading text.

property title_box

Return the resource heading element.

view_instructor_resources()[source]

Click the instructor resource link.

view_technology_options()[source]

Click the technology options link.

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

Bases: pypom.region.Region

Tutor information.

property description

Return the description text.

go_to_openstax_tutor(base_url=None)[source]

Click the ‘Go to OpenStax Tutor’ button.

property heading

Return the heading text.

learn_more()[source]

Click the ‘Learn more’ button.

property title

Return the section banner title.

URL_TEMPLATE = '/technology'
property description

Return the page subheading text.

is_displayed()[source]

Return True if the technology page is displayed.

learn_more()[source]

Click the banner page link.

property loaded

Override the base loader.

property resources

Access the Steps section.

property title

Return the page title.

property tutor

Access the OpenStax Tutor beta section.

pages.web.tutor module

The OpenStax Tutor Beta marketing page.

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

Bases: pypom.region.Region

A marketing page section.

property description

Return the section description.

property heading

Return the heading text.

property section

Return the section header element.

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

Bases: pages.web.home.WebHome

The Tutor marketing page.

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

Bases: pages.web.tutor.Section

The ‘Frequently Asked Questions’ section.

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

Bases: pypom.region.Region

A frequently asked question.

property answer

Return the answer if the answer is visible.

property is_open

Return True if the answer is visible.

property question

Return the question text.

toggle()[source]

Open or close the question.

property description

Override the description field.

property questions

Access the individual questions.

view_support()[source]

Click the ‘Support page’ link.

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

Bases: pages.web.tutor.Section

The available features list.

property features

Return the current features.

property new_features

Return the list of new features.

property planned_features

Return the list of planned features.

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

Bases: pages.web.tutor.Section

The ‘How It Works’ section.

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

Bases: pypom.region.Region

A How It Works blurb box.

property description

Return the box description.

property icon

Return the icon element.

property title

Return the box title.

property boxes

Access the blurb boxes.

property how_it_works

Return the subheading text.

property subheading

Return the subheading element.

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

Bases: pages.web.tutor.Section

The ‘Learn More’ section.

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

Bases: pypom.region.Region

A Learn More button box.

property button

Return the button link.

click()[source]

Click on the link.

property description

Return the button description.

property buttons

Return the button boxes.

get_started(base_url=None)[source]

Click the ‘Get Started’ button.

join_a_webinar()[source]

Click the ‘Join a webinar’ button.

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

Bases: pages.web.tutor.Section

The ‘New Frontier’ section.

access_your_course(base_url=None)[source]

Click the ‘Access Your Course’ link.

learn_more()[source]

Click the ‘Learn More’ button.

Return the OpenStax Tutor beta logo.

property subheading

Return the subheading text.

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

Bases: pages.web.tutor.Section

The ‘Science behind OpenStax Tutor Beta’ section.

property particles

Return the flying particles canvas.

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

Bases: pypom.region.Region

The marketing page sidebar navigation.

alert_dot()[source]

Return the pulse dot element.

alert_text()[source]

Return the alert message text.

is_displayed()[source]

Return True if the sidebar has height.

property nav

Return the navigation dots.

select(nav)[source]

Select a nav dot.

view_faq()[source]

Jump to the FAQ section.

view_feature_matrix()[source]

Jump to the Feature Matrix section.

view_how_it_works()[source]

Jump to the How It Works section.

view_learn_more()[source]

Jump to the Learn More section.

view_new_frontier()[source]

Jump to the New Frontier section.

view_science()[source]

Jump to the Science section.

view_what_students_get()[source]

Jump to the What Students Get section.

view_where_money_goes()[source]

Jump to the Where Money Goes section.

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

Bases: pypom.region.Region

The marketing page sticky footer.

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

Bases: pypom.region.Region

A sticky footer button.

property button

Return the button link.

property description

Return the button description.

property buttons

Access the footer buttons.

get_started(base_url=None)[source]

Go to Tutor.

property is_visible

Return True if the footer is visible.

join_a_webinar()[source]

Go to the webinar blog post.

URL_TEMPLATE = '/openstax-tutor'
class WhatStudentsGet(page, root=None)[source]

Bases: pages.web.tutor.Section

The ‘What Students Get’ section.

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

Bases: pypom.region.Region

The student view introductory videos and images.

RECT = 'return arguments[0].getBoundingClientRect();'
SET_BAR = 'arguments[0].scrollLeft = {left}'
property description

Return the current image description.

property media_ready

Return True if the current media is ready.

property option_container

Return the option parent element.

property options

Return the list of available info buttons.

scroll_to(x=0, option=None, element=None)[source]

Scroll the option list.

view(option)[source]

Select and option to view.

property viewport

Return the image viewer.

property tutor

Access the student view intro carousel.

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

Bases: pages.web.tutor.Section

The ‘Where the Money Goes’ section.

property breakdown

Return the cost breakdown text.

property breakdown_image

Return the breakdown image element for any screen size.

property faq

Access the frequently asked questions section.

property features

Access the ‘Feature Matrix’ section.

property how_it_works

Access the ‘How It Works’ section.

property introduction

Access the ‘New Frontier’ section.

is_displayed()[source]

Return True if the marketing page is displayed.

property learn_more

Access the ‘Learn More’ section.

property loaded

Override the base loader.

Access the marketing page sticky footer.

property science

Access the ‘Science’ section.

property sections

Return a list of available sections.

property sidebar

Access the sidebar navigation.

view(section)[source]

Scroll to a particular section.

property what_students_get

Access the ‘What Students Get’ section.

property where_money_goes

Access the ‘Where Money Goes’ section.

pages.web.tutor.go_to_tutor(driver, logged_in, target, base_url=None)[source]

Go to the Tutor dashboard.

Module contents