pages.accounts package

Submodules

pages.accounts.base module

Basic page parent for all Accounts pages.

class pages.accounts.base.AccountsBase(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pypom.page.Page

The base page for each Accounts class.

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

Bases: pypom.region.Region

The main content region.

property header

Return the page heading.

Returns

the body content header

Return type

str

view_log_in() → pypom.page.Page[source]

Click the Log in tab.

Returns

the Accounts Log in page

Return type

AccountsHome

view_sign_up() → pypom.page.Page[source]

Click the Sign up tab.

Returns

the Accounts Log in page

Return type

AccountsHome

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

Bases: pypom.region.Region

The Accounts footer.

property copyright

Return the brief copyright message.

Returns

the short copyright message displayed on Accounts pages

Return type

str

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

Click the Rice University logo.

Returns

the Rice University home page

Return type

Rice

:raises AccountsException: if the Rice

webpage is not loaded

property is_displayed

Return True if the footer is displayed.

Returns

True if the Accounts footer is displayed

Return type

bool

Display the OpenStax Accounts copyright and licensing notice.

Returns

the copyright notice

Return type

Copyright

show_terms_of_use() → pypom.page.Page

Display the OpenStax Accounts policies.

Returns

the terms of use and privacy policy page

Return type

Terms

Display the OpenStax Accounts copyright and licensing notice.

Returns

the copyright notice

Return type

Copyright

view_terms_of_use() → pypom.page.Page[source]

Display the OpenStax Accounts policies.

Returns

the terms of use and privacy policy page

Return type

Terms

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

Bases: pypom.region.Region

The Accounts menu bar.

go_home() → pypom.page.Page[source]

Follow the OpenStax logo link back to the site home page.

Returns

the OpenStax.org web page

Return type

WebHome

property is_displayed

Return True if the menu bar is displayed.

Returns

True if the Accounts menu bar is displayed

Return type

bool

back() → pypom.page.Page[source]

Go to the previous page in the browser history.

Returns

the current page

Return type

AccountsBase

close_tab()[source]

Close the current tab and switch to the remaining one.

Note

Assumes 2 browser tabs are open; switches the window handle to the remaining tab.

Returns

None

property content

Access the Accounts’ page content.

Returns

the Accounts page content

Return type

Content

property footer

Access the Accounts’ page footer.

Returns

the Accounts page footer

Return type

Footer

is_displayed() → bool[source]

Return True when the Accounts content is displayed.

Returns

True when the Accounts main body content is displayed

Return type

bool

property is_safari

Return True if the browser in use is Safari.

Returns

True if the browser in use is Safari

Return type

bool

property loaded

Return True when the Accounts page is loaded.

Note

We delay the check by 1/2 second for Safari and Firefox to insure the page is loading prior to the full DOM load.

Returns

True when the Accounts content is found

Return type

bool

property location

Return the current URL.

Returns

the current page URL

Return type

str

property menu

Access the Accounts’ page menu bar, if found.

Returns

the Accounts’ menu bar or None if it is missing (Profile)

Return type

MenuBar or None

property page_source

Return the current page source HTML.

Returns

the current page source

Return type

str

reload() → pypom.page.Page[source]

Reload the current page.

Returns

the current page

Return type

AccountsBase

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

Set the browser window size.

Note

We default to a standard 4:3 ratio 1024px x 768px.

Parameters
  • width (int) – (optional) the desired browser window width

  • height (int) – (optional) the desired browser window height

Returns

None

property url

Return the last segment of the current URL.

Returns

the final segment of the current URL (everything after the last ‘/’)

Return type

str

pages.accounts.home module

Home page objects.

class pages.accounts.home.AccountsHome(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pages.accounts.base.AccountsBase

The Accounts log in page.

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

Bases: pages.accounts.base.Content, regions.accounts.social.SocialLogins

The log in pane.

property email

Return the current email field address.

Returns

the current email form field value

Return type

str

property email_error

Return the email error message.

Returns

the email field error message, if found

Return type

str

property email_has_error

Return True if the email field has an error.

Returns

True if an error message is displayed below the email field

Return type

bool

forgot_your_password() → pages.accounts.reset.ResetPassword[source]

Click the Forgot your password? link.

Returns

the Reset my password page

Return type

ResetPassword

property password

Return the current password field value.

Returns

the current password form field value

Return type

str

property password_error

Return the password error message.

Returns

the password field error message, if found

Return type

str

property password_has_error

Return True if the password field has an error.

Returns

True if an error message is displayed below the password field

Return type

bool

toggle_password_display() → pages.accounts.home.AccountsHome[source]

Toggle the password field to show or hide the value.

Returns

the Accounts log in page

Return type

AccountsHome

URL_TEMPLATE = '/i/login'
log_in(username: str, password: str, destination: Optional[pypom.page.Page] = None, base_url: Optional[str] = None, **kwargs) → pypom.page.Page[source]

Log a user into the site.

Parameters
  • username (str) – the username or email address for the user

  • password (str) – the password for the user

  • destination (Page) – (optional) a Page destination, if known

  • base_url (str) – (optional) the base URL for the destination Page

  • kwargs – (optional) additional keyword arguments for the Page

Returns

the user’s profile, a legal page, or the originating page

Return type

Page

service_log_in(user: str, password: str, destination: Optional[pypom.page.Page] = None, url: Optional[str] = None, **kwargs) → pypom.page.Page[source]

Log into the site with a specific user from another service.

Note

Included for backwards compatibility

student_signup(first_name: str, last_name: str, password: str, email: Optional[utils.email.RestMail] = None, page: Optional[pypom.page.Page] = None, base_url: Optional[str] = None) → pypom.page.Page[source]

Register a new student user.

Parameters
  • first_name (str) – the user’s first name

  • last_name (str) – the user’s last name

  • password (str) – the user’s selected password

  • email (RestMail) – (optional) a provided RestMail address; if one is not given, an automatically generated one will be used

  • page (Page) – (optional) the expected page return

  • base_url (str) – the template base URL for the returned page

Returns

the sign up page if there is an error, the user profile if the user signed up from Accounts, or the originating page if redirected from another OpenStax product

Return type

Page

pages.accounts.profile module

Profile page for logged in users.

class pages.accounts.profile.Alert(page, root=None)[source]

Bases: pypom.region.Region

A fade alert.

close() → Union[pypom.page.Page, pypom.region.Region][source]

Click the alert close ‘x’ button.

Returns

the alert box’s parent object

Return type

Page or Region

property message

Return the alert message.

Returns

the alert message text

Return type

str

class pages.accounts.profile.FieldEdit(page, root=None)[source]

Bases: pypom.region.Region

Accept and cancel field edit buttons.

accept() → pages.accounts.profile.Profile[source]

Click the accept checkmark button.

Returns

the user profile

Return type

Profile

cancel() → pages.accounts.profile.Profile[source]

Click the cancel x button.

Returns

the user profile

Return type

Profile

property error

Return the error message.

Returns

the field error message, if found

Return type

str

class pages.accounts.profile.GroupedProviders(page, root=None)[source]

Bases: pypom.region.Region

The available or in use log in options pane.

property providers

Return the list of enabled providers.

Returns

the list of currently enabled providers

Return type

list(Provider)

class pages.accounts.profile.Popup(page, root=None)[source]

Bases: pypom.region.Region

A confirmation pop up.

cancel() → pypom.page.Page[source]

Click the ‘Cancel’ button.

Returns

the current page

Return type

Page

property message

Return the pop up box message.

Returns

the pop up box text content

Return type

str

ok() → pypom.page.Page[source]

Click the ‘OK’ button.

Returns

the current page

Return type

Page

class pages.accounts.profile.Profile(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pages.accounts.base.AccountsBase

A user profile.

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

Bases: pypom.region.Region

The admin console links.

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

Bases: pypom.region.Region

The quick-links admin pop up console control.

Bases: pypom.region.Region

Accounts program links section.

view_api_documentation() → pages.accounts.admin.docs.APIDocumentation[source]

View the Accounts API v1 documentation.

Returns

the API v1 documentation

Return type

APIDocumentation

view_contracts() → pages.accounts.admin.contracts.Contracts[source]

View the FinePrint contracts.

Returns

the FinePrint terms of use and privacy policy contracts page

Return type

Contracts

view_oauth_applications() → pages.accounts.admin.security.Doorkeeper[source]

View the OAuth applications.

Returns

the Doorkeeper application list page

Return type

Doorkeeper

view_security_log() → pages.accounts.admin.security.Security[source]

View the Accounts security log.

Returns

the Accounts security log page

Return type

Security

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

Bases: pypom.region.Region

Miscellaneous tasks section.

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

Bases: pypom.region.Region

User section.

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

Bases: pypom.region.Region

class for the search list column.

edit() → pages.accounts.admin.users.Details[source]

Edit the selected user.

Returns

the user details page for the selected user

Return type

Details

property first_name

Return the user’s first name.

Returns

the user’s first name

Return type

str

property id

Return the user id.

Returns

the user identification number

Return type

str

property is_admin

Return True if the user is an administrator.

Returns

True if the user is an Accounts administrator

Return type

bool

property is_test

Return True if the user is a test user.

Returns

True if the user is marked as a test account

Return type

bool

property last_name

Return the user’s last name.

Returns

the user’s last name

Return type

str

sign_in_as() → pages.accounts.profile.Profile[source]

Sign in to Accounts as the user.

Returns

the selected user’s profile

Return type

Profile

property username

Return the username.

Returns

the username

Return type

str

view_security_log() → pages.accounts.admin.security.Security[source]

Return the security log for the user.

Returns

the security log for the user

Return type

Security

search_for(topic: str) → List[pages.accounts.profile.Profile.Console.PopupConsole.Users.Result][source]

Use the pop up console to search for a given string.

Parameters

topic (str) – the search string

Returns

the list of users matching the search string

Return type

list(Result)

view_full_console() → pages.accounts.admin.base.AccountsAdmin[source]

Click the ‘Full Console >>’ link.

Returns

the full administrator console

Return type

AccountsAdmin

Access the pop up console links tab.

Returns

the pop up console displaying the miscellaneous tab

Return type

Links

view_misc() → pages.accounts.profile.Profile.Console.PopupConsole.Misc[source]

Access the pop up console misc tab.

Returns

the pop up console displaying the miscellaneous tab

Return type

Misc

view_users() → pages.accounts.profile.Profile.Console.PopupConsole.Users[source]

Access the pop up console users tab.

Returns

the pop up console displaying the users tab

Return type

Users

property is_admin

Return True if the user is a site administrator.

Returns

True if the console links are found

Return type

bool

view_full_console() → pages.accounts.admin.base.AccountsAdmin[source]

Open the full admin console.

Returns

the full administrator console

Return type

AccountsAdmin

view_popup_console() → pages.accounts.profile.Profile.Console.PopupConsole[source]

Click the ‘Popup Console’ link.

Returns

the pop up console

Return type

Console

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

Bases: pypom.region.Region

The profile data pane.

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

Bases: pypom.region.Region

Account emails.

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

Bases: pages.accounts.profile.FieldEdit

An individual account email.

delete() → pages.accounts.profile.Popup[source]

Click the ‘Delete’ link.

Returns

the delete confirmation pop up

Return type

Popup

property email

Return the email address.

Returns

the email address

Return type

str

property is_confirmed

Return True if the email address is confirmed.

Returns

True if the unconfirmed warning is not found

Return type

bool

property is_expanded

Return True if the email pane is expanded.

Returns

True when the expanded class is found on the email root element

Return type

bool

let_other_users_find_me_by_this_email() → pages.accounts.profile.Profile.Content.Emails.Email[source]

Click the ‘Let other users find me…’ checkbox.

Returns

the email address section

Return type

Email

resend_confirmation_email() → pages.accounts.profile.Alert[source]

Click the ‘Resend confirmation email’ link.

Returns

the alert box for the email line

Return type

Alert

toggle() → pages.accounts.profile.Profile.Content.Emails.Email[source]

Click the email address to open or close the pane.

Returns

the email address section

Return type

Email

add_email_address() → pages.accounts.profile.Profile.Content.Emails.Email[source]

Click the ‘Add email address’ link.

Returns

the new account email entry form

Return type

Email

property emails

Access the current emails list.

Returns

the account emails

Return type

list(Email)

property new_email

Access the new email entry.

Returns

the new account email entry form

Return type

Email

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

Bases: pages.accounts.profile.GroupedProviders

Enabled log in providers.

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

Bases: pages.accounts.profile.FieldEdit

The user name.

change_name() → pages.accounts.profile.Profile.Content.Name[source]

Click the user’s name.

Returns

the user’s name pane

Return type

Name

property first_name

Return the current first name value.

Returns

the current user’s first name

Return type

str

property full_name

Return the current name value.

Returns

the current user’s name

Return type

str

get_name_parts() → Tuple[str, str, str, str][source]

Return the four name parts.

Returns

the four parts of a user profile name (title, first name, last name and suffix)

Return type

tuple(str, str, str, str)

property last_name

Return the current last name value.

Returns

the current user’s last name

Return type

str

property suffix

Return the current suffix value.

Returns

the current user’s suffix

Return type

str

property title

Return the current title value.

Returns

the current user’s title

Return type

str

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

Bases: pages.accounts.profile.GroupedProviders

Other provider options.

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

Bases: pages.accounts.profile.FieldEdit

The username.

change_username() → pages.accounts.profile.Profile.Content.Username[source]

Click the username.

Returns

the username pane

Return type

Username

clear_username() → pages.accounts.profile.Profile.Content.Username[source]

Click the clear field ‘x’ button.

Returns

the username pane

Return type

Username

property username

Return the current username.

Returns

the current username

Return type

str

property emails

Access the user emails section.

Returns

the user emails section

Return type

Emails

property enabled_providers

Access the enabled log in providers section.

Returns

the enabled log in providers section

Return type

EnabledProviders

property has_username

Return True if the current user has an assigned username.

Returns

True if the account has a username

Return type

bool

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

Click on the OpenStax logo.

Returns

the OpenStax.org web page

Return type

WebHome

log_out() → pypom.page.Page[source]

Click the ‘Log out’ link.

Returns

the Accounts sign in page

Return type

AccountsHome

property name

Access the user name section.

Returns

the name section

Return type

Name

property other_providers

Access the available log in providers section.

Returns

the available log in providers section

Return type

OtherProviders

redirect() → pypom.page.Page[source]

Click the redirect ‘x’ button.

Returns

the originating page or the user profile if the originator is Accounts

Return type

Page or Profile

property title

Return the page title.

Returns

the page title

Return type

str

property username

Access the username section.

Returns

the username section

Return type

Username

URL_TEMPLATE = '/i/profile'
property console

Access the admin console links.

Returns

the admin console links

Return type

Console

log_out() → pages.accounts.base.AccountsBase[source]

Click the content log out link.

Returns

the Accounts home page

Return type

AccountsHome

class pages.accounts.profile.Provider(page, root=None)[source]

Bases: pypom.region.Region

A log in provider.

add() → pypom.page.Page[source]

Add a new log in method to the account.

Returns

the password setup page, the Facebook log in page or the Google log in page

Return type

SetPassword, Facebook, or Google

delete() → Provider.Popup[source]

Remove the log in method from the account.

Returns

the confirmation pop up box

Return type

Popup

edit() → pages.accounts.reset.ChangePassword[source]

Edit the password log in method.

Returns

the change password form

Return type

ChangePassword

property name

Return the provider name.

Returns

the provider name

Return type

str

pages.accounts.signup module

Break the signup process out of the base.

class pages.accounts.signup.ChangeYourEmail(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pages.accounts.base.AccountsBase

The email change request page.

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

Bases: pages.accounts.base.Content, regions.accounts.fields.Email

The email change request pane.

send_my_pin() → Union[pages.accounts.signup.ChangeYourEmail, pages.accounts.signup.ConfirmEmail][source]

Click the ‘Send my PIN’ button.

Returns

the change your email page if there was an error or the email confirmation page

Return type

ChangeYourEmail or ConfirmEmail

URL_TEMPLATE = '/i/change_your_email'
class pages.accounts.signup.CompleteSignup(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pages.accounts.base.AccountsBase

The account setup completion page.

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

Bases: pages.accounts.base.Content

The signup completion pane.

property email

Return the email address used during registration.

Returns

the email address used during registration

Return type

str

exit() → pypom.page.Page[source]

Click the page return ‘x’ button.

Returns

the user profile or the origination page

Return type

Page

finish() → pypom.page.Page[source]

Click the ‘Finish’ button.

Returns

the account profile or the originating page

Return type

Page

property information

Return the email information message.

Returns

the email information message

Return type

str

URL_TEMPLATE = '/i/done'
class pages.accounts.signup.ConfirmEmail(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pages.accounts.base.AccountsBase

The email confirmation page.

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

Bases: pages.accounts.base.Content, regions.accounts.fields.Pin

The email confirmation pane.

confirm_my_account() → Union[pages.accounts.signup.ConfirmEmail, pages.accounts.signup.CompleteSignup][source]

Click the Continue button.

Returns

the email confirmation (second step) if there are errors or the completion page (third step)

Return type

ConfirmEmail or CompleteSignup

edit_your_email() → pages.accounts.signup.ChangeYourEmail[source]

Click the ‘edit your email’ link.

Returns

the change your email page

Return type

ChangeYourEmail

property email

Return the email address used during registration.

Returns

the email address used during registration

Return type

str

property information

Return the email information message.

Returns

the email information message

Return type

str

property pin

Return the current PIN value.

Returns

the current pin value

Return type

str

sign_up_with_a_different_email() → pages.accounts.signup.ChangeYourEmail[source]

Click the ‘sign up with a different email’ link.

Returns

the change your email page

Return type

ChangeYourEmail

URL_TEMPLATE = '/i/confirmation_form'
class pages.accounts.signup.EducatorSignup(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pages.accounts.signup.SignupOld

The educator sign up process.

class pages.accounts.signup.Signup(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pages.accounts.base.AccountsBase

The Accounts sign up process.

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

Bases: pages.accounts.base.Content

The sign up pane.

DESCRIPTION = ' ~ div'
property educator_description

Return the educator sign up explanation text.

Returns

the explanation why educators should register for an OpenStax account

Return type

str

sign_up_as_a_student() → pages.accounts.signup.StudentSignup[source]

Click the student sign up button.

Returns

the student registration process

Return type

StudentSignup

sign_up_as_an_educator() → pages.accounts.signup.EducatorSignup[source]

Click the educator sign up button.

Returns

the educator registration process

Return type

EducatorSignup

property student_description

Return the student sign up explanation text.

Returns

the explanation why students should register for an OpenStax account

Return type

str

URL_TEMPLATE = '/i/signup'
class pages.accounts.signup.SignupOld(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pages.accounts.base.AccountsBase

Legacy signup process.

ADMINISTRATOR = 'Administrator'
ADOPTED = 'Fully adopted and using it as the primary textbook'
DESIGNER = 'Instructional Designer'
FIRST = 1
GOOGLE = 'google'
GUERRILLA_MAIL = 'guerrilla'
INSTRUCTOR = 'Instructor'
INTEREST = 'Interested in using OpenStax in the future'
class InstructorNotice(page, root=None)[source]

Bases: pypom.region.Region

Complete the instructor signup.

get_confirmation_email()[source]

Get an e-mail confirmation when instructor access approved.

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

Bases: pypom.region.Region

Instructor verification fields.

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

Bases: pypom.region.Region

Book subject.

select()[source]

Select a book.

property title

Get the book title.

property phone

Return the telephone number field.

select_subjects(subject_list)[source]

Mark each interested subject.

property students

Return the student count field.

property subjects

Return a list of book subjects.

property using

Return the instructor’s intent field.

using_openstax(method)[source]

Select the current using state.

property webpage

Return the webpage verification field.

LAST = 2
LIBRARIAN = 'Librarian'
NOT_USING = 'Not using OpenStax'
OTHER = 'Other'
class PinVerification(page, root=None)[source]

Bases: pypom.region.Region

Pin verification.

clear_pin()[source]

Clear the pin field for Chrome and Firefox.

edit_email()[source]

Return to the user type selection.

property pin_failure

Return True if an error occurs during pin verification.

property verify_pin

Return the pin input.

RECOMMENDED = 'Recommending the book – my students buy a different book'
RESTMAIL = 'restmail'
STUDENT = 'Student'
SUBJECTS = [('accounting', 'Accounting'), ('algebra_and_trigonometry', 'Algebra and Trigonometry'), ('american_government', 'American Government'), ('anatomy_physiology', 'Anatomy and Physiology'), ('astronomy', 'Astronomy'), ('biology', 'Biology'), ('calculus', 'Calculus'), ('chemistry', 'Chemistry'), ('chem_atoms_first', 'Chemistry: Atoms First'), ('college_algebra', 'College Algebra'), ('college_physics_algebra', 'College Physics'), ('concepts_of_bio_non_majors', 'Concepts of Biology'), ('introduction_to_business', 'Introduction to Business'), ('introduction_to_sociology', 'Introduction to Sociology 2e'), ('introductory_statistics', 'Introductory Statistics'), ('microbiology', 'Microbiology'), ('pre_algebra', 'Prealgebra'), ('precalc', 'Precalculus'), ('economics', 'Principles of Economics'), ('macro_econ', 'Principles of Macroeconomics'), ('ap_macro_econ', 'Principles of Macroeconomics for AP® Courses'), ('micro_econ', 'Principles of Microeconomics'), ('ap_micro_econ', 'Principles of Microeconomics for AP® Courses'), ('psychology', 'Psychology'), ('ap_physics', 'The AP Physics Collection'), ('us_history', 'U.S. History'), ('university_physics_calc', 'University Physics'), ('not_listed', 'Not Listed')]
SUFFIX = 3
class SetPassword(page, root=None)[source]

Bases: pypom.region.Region

Set the user’s password.

property confirmation

Return the confirmation field.

property get_error

Return password error(s).

property has_error

Return True if error messages are displayed.

property password

Return the password field.

use_social_login()[source]

Go to the social login setup.

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

Bases: pypom.region.Region

Sign up using a social app profile.

URL_TEMPLATE = '/social'
property use_a_password

Use a non-social log in.

property use_facebook

Use Facebook to log in.

property use_google

Use Google to log in.

TITLE = 0
URL_TEMPLATE = '/signup'
class UserFields(page, root=None)[source]

Bases: pypom.region.Region

Standard user fields.

agree_to_terms()[source]

Accept the Accounts terms of use and the privacy policy.

property first_name

Return the first name field.

property last_name

Return the surname field.

property school

Return the school field.

toggle_news()[source]

Toggle between receiving and not receiving news.

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

Bases: pypom.region.Region

Initial signup pane for type selection.

property email

Return the email input.

log_in()[source]

Return to the login screen.

property role

Return the role select.

property warning

Return the warning text.

property warning_present

Return True if the e-mail warning is displayed.

account_signup(email, password=None, _type='Student', provider='restmail', tutor=False, destination=None, **kwargs)[source]

Single signup entry point.

Sign up a new user. Social, Random, and Name are mutually exclusive.

Parameters
  • email (str) – an accessible e-mail address

  • password (str) – the user password

  • _type (str) – (optional) the new user account type using * SignupOld.STUDENT (default) * SignupOld.INSTRUCTOR * SignupOld.ADMINISTRATOR * SignupOld.LIBRARIAN * SignupOld.DESIGNER * SignupOld.OTHER

  • provider (str) – (optional) the e-mail host, default: restmail google: Google Gmail guerrilla: GuerrillaMail restmail: RestMail API Email

  • tutor (bool) – (optional) True if the signup is for OpenStax Tutor, default: False

  • destination (str) – a URL destination if not Accounts default: None

  • **kwarys – arbitrary keyword arguments, see below

Returns

the new user’s profile page

Return type

pages.accounts.profile.Profile

Keyword Arguments
  • email_password (str) – Webmail login password

  • name (list``(``str)) – the user’s name as [title, first_name, last_name, suffix]

  • news (bool) – True if the newsletter checkbox should be checked, False if the checkbox should be cleared

  • phone (str) – the instructor’s telephone number

  • school (str) – the school name

  • social (str) – use a social login, either facebook or google

  • social_login (str) – the social account login

  • social_password (str) – the social account password

  • students (int) – the number of students in the course

  • subjects (list``(``str)) – a list of interested book subjects * accounting * algebra_and_trigonometry * american_government * anatomy_physiology * astronomy * biology * calculus * chemistry * chem_atoms_first * college_algebra * college_physics_algebra * concepts_of_bio_non_majors * introduction_to_business * introduction_to_sociology * introductory_statistics * microbiology * pre_algebra * precalc * economics * macro_econ * ap_macro_econ * micro_econ * ap_micro_econ * psychology * ap_physics * us_history * university_physics_calc * not_listed

  • use (str) – How is the instructor using OpenStax?

  • webpage (str) – the web URL showing the user as a known instructor

property error

Return the error message if present.

property instructor

Fill out the instructor verification.

instructor_access(role, school_email, phone_number, school, webpage, students=None, using=None, interests=None, get_newsletter=True)[source]

Request faculty access.

next(locator=None)[source]

Proceed to the next step in the process.

property notice

Request notice when instructor access is authorized.

property password

Fill out the password fields.

property pin

Verify the e-mail pin.

property social

Use a social login.

subject_list(size=1)[source]

Return a list of subjects for an elevated signup.

property user

Fill out the user data.

property user_type

Fill out the user type.

class pages.accounts.signup.StudentSignup(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pages.accounts.base.AccountsBase

The student sign up process.

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

Bases: pages.accounts.base.Content, regions.accounts.fields.Email, regions.accounts.fields.FirstName, regions.accounts.fields.LastName, regions.accounts.fields.Password, regions.accounts.social.SocialLogins

The sign up pane.

get_errors() → List[str][source]

Return a list of error messages found on the page.

Returns

the list of error messages found on the current page

Return type

list(str)

i_agree() → pages.accounts.signup.StudentSignup[source]

Click the I agree checkbox.

Returns

the Accounts student sign up page

Return type

StudentSignup

toggle_newsletter() → pages.accounts.signup.StudentSignup[source]

Click the OpenStax newsletter checkbox.

Returns

the Accounts student sign up page

Return type

StudentSignup

toggle_password_display() → pages.accounts.signup.StudentSignup[source]

Toggle the password field to show or hide the value.

Returns

the Accounts student sign up page

Return type

StudentSignup

URL_TEMPLATE = '/i/signup/student'

pages.accounts.signup_two module

Break the signup process out of the base.

class pages.accounts.signup_two.Pagination(page, root=None)[source]

Bases: pypom.region.Region

Shared page features.

next()[source]

Click the continuation button.

class pages.accounts.signup_two.Signup(driver, base_url=None, timeout=10, **url_kwargs)[source]

Bases: pages.accounts.base.AccountsBase

Signup process.

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

Bases: pages.accounts.signup_two.Pagination

Acceptance email.

property approval

Return the email request upon approval checkbox.

ok()[source]

Click the OK button.

receive_instructor_access_notice()[source]

Click the checkbox to receive notice.

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

Bases: pages.accounts.signup_two.Pagination

Book details.

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

Bases: pypom.region.Region

An OpenStax book.

property checkbox

Return the checkbox element.

property image

Return the image element.

property is_checked

Return True if the box is checked.

select()[source]

Select the book.

property title

Return the book title.

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

Bases: pypom.region.Region

The Terms of Use and Privacy Policy display window.

close()[source]

Close the modal.

property content

Return the modal content text.

agree_to_policies()[source]

Check the ‘I agree’ checkbox.

property agreement

Return the ‘I agree’ checkbox.

back()[source]

Return to the previous page.

property book_error

Return the book error.

property books

Return the list of available books.

create_account()[source]

Click the ‘Create Account’ button.

property newsletter

Return the newsletter checkbox.

no_newsletter()[source]

Uncheck the newsletter box.

property policy

Access the policy modal.

select_subjects(subject_list)[source]

Mark each interested or adopted book.

set_using(subject_list)[source]

Mark the adoption status and students for each book.

property students

Return the general student count input box.

view_privacy_policy()[source]

Open the Privacy Policy.

view_terms()[source]

Open the Terms of Use.

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

Bases: pages.accounts.signup_two.Pagination

Password assignment.

property confirmation

Return the password confirmation input field.

property password

Return the password input field.

property password_errors

Return the password errors.

submit()[source]

Click the ‘Submit’ button.

use_social_login()[source]

Go to the social login setup.

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

Bases: pages.accounts.signup_two.Pagination

Pin verification.

clear_pin()[source]

Clear the pin field for Chrome and Firefox.

confirm()[source]

Click the ‘Confirm’ button.

edit_email()[source]

Return to the user role selection to enter a new email.

property pin_error

Return the pin entry error message.

property verify_pin

Return the pin verification input box.

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

Bases: pages.accounts.signup_two.Pagination

User details.

property first_name

Return the first name input field.

property last_name

Return the last name input field.

property phone_number

Return the telephone number input field.

property profile_errors

Return a list of errors.

property school_name

Return the school name input field.

using_openstax(method)[source]

Select the current using state.

property webpage

Return the faculty verification webpage field.

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

Bases: pages.accounts.signup_two.Pagination

Basic user data.

property email

Return the email input box.

property email_box_is_visible

Return True if the email input box is visible.

property email_error

Return the email entry error.

log_in()[source]

Return to the login home page.

property role

Return the role select parent.

property warning

Return the warning text.

property warning_is_present

Return True if the warning is displayed.

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

Bases: pypom.region.Region

Sign up using a social app profile.

property use_a_password

Use a non-social log in.

property use_facebook

Use Facebook to log in.

property use_google

Use Google to log in.

URL_TEMPLATE = '/signup'
account_signup(email, password=None, role='Student', provider='restmail', destination=None, base_url=None, **kwargs)[source]

Single signup entry point.

property courseware

Access the courseware books.

property instructor_access

Access the approval confirmation fields.

property password

Access the password fields.

property pin_verification

Access the pin verification.

property profile

Access the profile fields.

property sign_up

Access the signup page elements.

Module contents