def click_to_terms_of_service(self): elem = self.get_element(SignUp.terms_of_service) elem.click() BasePage.wait_page(self) BasePage.switch_to_window(self, get_driver(self).window_handles[1]) page = terms_of_service_page.TermsOfSetvice(get_driver(self)) return page
def logout(self): welcome = app_welcome_page.Welcome(get_driver(self)) if BasePage.get_url(self).__eq__(welcome.url_page()): welcome.click_to_logo() BasePage.click(self, By.CSS_SELECTOR, AppMain.profile_icon) BasePage.clickJS(self, By.CSS_SELECTOR, AppMain.logout_link) BasePage.wait_page(self) page = ws_page.WSMain(get_driver(self)) wait_title(get_driver(self), page.title_name) return page
def click_to_sign_up(self): BasePage.click(self, By.CSS_SELECTOR, SignUp.sign_up_button) BasePage.wait_page(self) welcome = app_welcome_page.Welcome(get_driver(self)) if BasePage.get_url(self).__eq__(page_url): return SignUp(get_driver(self)) elif welcome.is_url(): page = app_welcome_page.Welcome(get_driver(self)) return page else: return Exception("Unexpected behavior after pressing 'Sign up' button")
def click_to_logo(self): BasePage.click(self, By.CSS_SELECTOR, Welcome.header_logo) BasePage.wait_page(self) page = app_main_page.AppMain(get_driver(self)) return page
def close_tab(self): BasePage.tab_close(self) BasePage.switch_to_window(self, get_driver(self).window_handles[0]) page = sign_up_page.SignUp(get_driver(self)) return page
def click_to_logo(self): BasePage.click(self, By.CSS_SELECTOR, SignIn.logo) BasePage.wait_page(self) BasePage.switch_to_window(self, get_driver(self).window_handles[1]) page = ws_page.WSMain(get_driver(self)) return page
def click_sign_up_with_google(self): elem = self.get_element(sign_in_page.SignIn.sign_in_google_button) elem.click() BasePage.wait_page(self) return BasePage(get_driver(self))