def __init__(self, driver): self.driver = driver self.logger = LogGen.log_gen() self.email_form = EmailForm(self.driver) self.login_form = LoginForm(self.driver) self.site_selection = SiteSelection(self.driver) self.launch_page = LaunchPage(self.driver)
def test_subscribe_btn_signed_out(self): self.profile_page.sign_out() self.profile_page.open_stranger_profile() self.profile_page.subscribe() try: LoginForm(self.driver).wait_until_visible() self.assertTrue(LoginForm(self.driver).is_visible()) except TimeoutException: self.fail('Auth modal does not show up')
class LoginActions: def __init__(self, driver): self.driver = driver self.logger = LogGen.log_gen() self.email_form = EmailForm(self.driver) self.login_form = LoginForm(self.driver) self.site_selection = SiteSelection(self.driver) self.launch_page = LaunchPage(self.driver) def login_steps(self, email, password): self.launch_page.click_continue_button() self.email_form.text_email_id(email) self.email_form.click_continue_button() self.login_form.text_pwd(password) self.login_form.click_continue_button() self.site_selection.click_done_button()
class MeetingTest(BaseTest): def setUp(self): super().setUp() self.meeting_steps = MeetingSteps(self.driver) self.meeting_steps.open_page() self.login_form = LoginForm(self.driver) def test_click_like_without_auth(self): self.meeting_steps.click_like() self.login_form.wait_until_visible() self.assert_(self.login_form.is_visible()) def test_click_go_button_without_auth(self): self.meeting_steps.click_go_button() self.login_form.wait_until_visible() self.assert_(self.login_form.is_visible()) def test_click_meet_member(self): self.meeting_steps.click_meet_member() def test_click_go_button_with_auth(self): self.auth() self.meeting_steps.open_page() self.meeting_steps.click_go_button() self.meeting_steps.handle_go_button() def test_click_like_with_auth(self): self.auth() self.meeting_steps.open_page() self.meeting_steps.click_like() self.meeting_steps.handle_like()
def __init__(self, driver): self.driver = driver self.page = Page(self.driver) self.product_page = Product(self.driver) self.top_banner = TopBanner(self.driver) self.login_form = LoginForm(self.driver) self.latest_sale = LatestSale(self.driver) self.quick_view = QuickView(self.driver) self.shopping_cart = ShoppingCart(self.driver) self.wish_list = WishList(self.driver) self.top_menu = TopMenu(self.driver) self.browse_our_categories = BrowseCategories(self.driver) self.category = Category(self.driver)
class PeopleTest(BaseTest): def setUp(self): super().setUp() self.people_steps = PeopleSteps(self.driver) self.people_steps.open_page() self.login_form = LoginForm(self.driver) def test_click_disguisht(self): self.people_steps.click_disguisht() self.login_form.wait_until_visible() self.assert_(self.login_form.is_visible()) def test_click_like_icon(self): self.people_steps.click_like_icon() self.login_form.wait_until_visible() self.assert_(self.login_form.is_visible()) def test_click_download_more(self): self.people_steps.click_download_more()
def setUp(self): super().setUp() self.people_steps = PeopleSteps(self.driver) self.people_steps.open_page() self.login_form = LoginForm(self.driver)
def load_page(context, url): if url == "Lead Capture Form": LeadCaptureForm(context.browser).load_page() LoginForm(context.browser).bypass_login_form()
def test_login_scenarios(self, setup, base_test): self.driver = setup self.my_site = MySite(self.driver) self.logout_action = LogoutActions(self.driver) self.launch_page = LaunchPage(self.driver) self.email_form = EmailForm(self.driver) self.login_form = LoginForm(self.driver) self.site_selection = SiteSelection(self.driver) # read excel and get the row count # self.filepath = '../testdata/testdata.xlsx' self.tc_sheet = 'login_scenarios' self.col_cnt = ReadData.getColCount(self.filepath, self.tc_sheet) self.row_cnt = ReadData.getRowCount(self.filepath, self.tc_sheet) for r in range(2, self.row_cnt + 1): # read values from excel self.logger.info(f"Testing for test data {r - 1}") self.email = ReadData.readData(self.filepath, self.tc_sheet, r, 2) self.password = ReadData.readData(self.filepath, self.tc_sheet, r, 3) self.exptitle = ReadData.readData(self.filepath, self.tc_sheet, r, 4) self.expresult = ReadData.readData(self.filepath, self.tc_sheet, r, 5) # login actions self.launch_page.click_continue_button() self.email_form.text_email_id(self.email) self.email_form.click_continue_button() self.login_form.text_pwd(self.password) self.login_form.click_continue_button() sleep(5) page_header = self.my_site.get_page_header() if page_header != 'Log In': self.site_selection.click_done_button() # verify the title after login self.act_title = self.my_site.get_title() if self.act_title == self.exptitle: # pass login for valid data if self.expresult == "login success": assert True self.logger.info( "*** test case pass as login success for valid data***" ) ReadData.writeData(self.filepath, self.tc_sheet, r, 6, "Pass") self.logout_action.logout_steps() # fail login for valid data elif self.expresult == "login fail": assert False self.logger.info( "***test case fail as login success for invalid data***" ) ReadData.writeData(self.filepath, self.tc_sheet, r, 6, "Fail") self.logout_action.logout_steps() else: self.driver.back() self.driver.back() if self.expresult == "login fail": self.logger.info( "*** test case pass as login fail for in valid data***" ) ReadData.writeData(self.filepath, self.tc_sheet, r, 6, "Pass") assert True else: self.logger.info( "*** test case fail as login fail for in valid data***" ) ReadData.writeData(self.filepath, self.tc_sheet, r, 6, "Fail") assert False
def login_form(self): return LoginForm(self.driver)
def setUp(self): super().setUp() self.meetings_steps = MeetingsSteps(self.driver) self.meetings_steps.open_page() self.login_form = LoginForm(self.driver)
class MeetingsTest(BaseTest): def setUp(self): super().setUp() self.meetings_steps = MeetingsSteps(self.driver) self.meetings_steps.open_page() self.login_form = LoginForm(self.driver) def test_card_like_auth(self): self.auth() self.meetings_steps.like_card() self.meetings_steps.handle_like() def test_card_like_without_auth(self): self.meetings_steps.like_card() self.login_form.wait_until_visible() self.assert_(self.login_form.is_visible()) def test_slide_like_without_auth(self): self.meetings_steps.like_slide() self.login_form.wait_until_visible() self.assert_(self.login_form.is_visible()) def test_slide_go_button_without_auth(self): self.meetings_steps.go_button() self.login_form.wait_until_visible() self.assert_(self.login_form.is_visible()) def test_slide_go_button_auth(self): self.auth() self.meetings_steps.go_button() self.meetings_steps.handle_go_button() def test_slide_like_auth(self): self.auth() self.meetings_steps.like_slide() self.meetings_steps.handle_like() def test_click_slide(self): self.meetings_steps.click_slide() self.meetings_steps.wait_page_load('https://onmeet.ru/meeting?meetId=29') self.assert_('https://onmeet.ru/meeting' in self.driver.current_url) def test_click_card(self): self.meetings_steps.click_card() self.meetings_steps.wait_page_load('https://onmeet.ru/meeting?meetId=29') self.assert_('https://onmeet.ru/meeting' in self.driver.current_url) def test_click_remove_filters(self): self.meetings_steps.click_remove_filters() self.meetings_steps.wait_page_load('https://onmeet.ru/meetings') self.assertEqual('https://onmeet.ru/meetings', self.driver.current_url) def test_click_my_meetings(self): self.meetings_steps.click_my_meetings() self.login_form.wait_until_visible() self.assert_(self.login_form.is_visible()) def test_click_disguisht(self): self.meetings_steps.click_disguisht() self.login_form.wait_until_visible() self.assert_(self.login_form.is_visible())