def callback(): login = '******' password = '******' try: # Login via email qalib.WHICH_PLATFORM = "" browser, logs = qalib.set_up("chrome", "stdout", "false") qalib.load_main_page(browser, logs) except: result.append("Main page opened") try: qalib.element_click(browser, logs, 3, By.XPATH, '//*[@id="hs-eu-confirmation-button"]') result.append("Cookie is accepted") except: result.append("Something wrong with cookies") try: qalib.login(browser, logs, login, password) #qalib.wait_until_with_exception(browser, logs, 10, EC.visibility_of_element_located((By.XPATH, "//h2[@class='MuiTypography-root-8 MuiTypography-subtitle2-20']"))) result.append("Login via email successfully passed") except: result.append("Login via email failed") qalib.result_of_the_test(result)
def callback(): # login = '******' # gpassword = '******' try: qalib.WHICH_PLATFORM = "" browser, logs = qalib.set_up("chrome", "stdout", "false") qalib.load_main_page(browser, logs) result.append("Success") except: result.append("Fail") try: qalib.element_click(browser, logs, 3, By.XPATH, '//*[@id="hs-eu-confirmation-button"]') result.append("Cookie is accepted") except: result.append("Something wrong with cookies") qalib.element_click(browser, logs, qalib.DEFAULT_SLEEP, By.XPATH, "//h2[contains(text(),'login')]") qalib.element_click( browser, logs, qalib.DEFAULT_SLEEP, By.CLASS_NAME, 'MuiTypography-root MuiTypography-caption MuiTypography-colorPrimary') print('Clicking forgot-password button..') initial_handle = browser.current_window_handle qalib.element_send_keys(browser, logs, qalib.DEFAULT_SLEEP, By.ID, 'outlined-helperText', '*****@*****.**') qalib.result_of_the_test(result) qalib.tear_down(browser, logs)
def callback(): login = '******' password = '******' try: qalib.WHICH_PLATFORM = "dev." browser, logs = qalib.set_up("chrome", "stdout", "false") qalib.load_main_page(browser, logs) result.append("Main page successfully opened") except: result.append("Opening main page failed") try: qalib.element_click(browser, logs, 3, By.XPATH, '//*[@id="hs-eu-confirmation-button"]') result.append("Cookie is accepted") except: result.append("Something wrong with cookies") try: qalib.element_click(browser, logs, 3, By.XPATH, "//h2[contains(text(),'login')]") sleep(2) qalib.element_click( browser, logs, 3, By.XPATH, "//div[@class='social-auth__icon social-auth__icon-facebook']") window_before = browser.window_handles[0] window_after = browser.window_handles[1] browser.switch_to_window(window_after) qalib.element_send_keys(browser, logs, 3, By.ID, "email", login) qalib.element_send_keys(browser, logs, 3, By.ID, "pass", password) qalib.element_click(browser, logs, 3, By.NAME, value="login") browser.switch_to_window(window_before) sleep(4) qalib.wait_until_with_exception(browser, logs, 10, EC.title_is('OPN Platform')) sleep(4) result.append("Login via facebook successfully passed") except: result.append("Login via facebook failed") qalib.result_of_the_test(result)
def callback(): login = '******' password = '******' try: # Login via linkedin qalib.WHICH_PLATFORM = "" browser, logs = qalib.set_up("chrome", "stdout", "false") qalib.load_main_page(browser, logs) result.append("Main page successfully opened") except: result.append("Opening main page failed") try: qalib.element_click(browser, logs, 3, By.XPATH, '//*[@id="hs-eu-confirmation-button"]') result.append("Cookie is accepted") except: result.append("Something wrong with cookies") try: qalib.element_click(browser, logs, 3, By.XPATH, "//h2[contains(text(),'login')]") sleep(2) qalib.element_click( browser, logs, 3, By.XPATH, "//div[@class='social-auth__icon social-auth__icon-linkedin']") qalib.wait_until_with_exception( browser, logs, 10, EC.title_is('LinkedIn Login, LinkedIn Sign in | LinkedIn')) result.append("Page successfully forwarded to linkedin") except: result.append("Something wrong with linkedin") try: browser.find_element_by_xpath("//input[@id='username']").send_keys( login) browser.find_element_by_xpath("//input[@id='password']").send_keys( password) qalib.element_click( browser, logs, 3, By.XPATH, "//button[@class='btn__primary--large from__button--floating']") qalib.wait_until_with_exception(browser, logs, 10, EC.title_is('OPN Platform')) result.append("Login via linkedin successfully passed") except: result.append("Login via linkedin failed") qalib.result_of_the_test(result)
def callback(): login = '******' password = '******' try: # Login via email qalib.WHICH_PLATFORM = "dev." browser, logs = qalib.set_up("chrome", "stdout", "false") qalib.load_main_page(browser, logs) qalib.login(browser, logs, login, password) #qalib.wait_until_with_exception(browser, logs, 10, EC.visibility_of_element_located((By.XPATH, "//h2[@class='MuiTypography-root-8 MuiTypography-subtitle2-20']"))) result.append("Login via email successfully passed") except: result.append("Login via email failed") qalib.result_of_the_test(result)
def callback(): login = '******' password = '******' try: qalib.WHICH_PLATFORM = "" browser, logs = qalib.set_up("chrome", "stdout", "false") qalib.load_main_page(browser, logs) sleep(4) result.append("Main page successfully opened") except: result.append("Opening main page failed") try: qalib.element_click(browser, logs, 3, By.XPATH, '//*[@id="hs-eu-confirmation-button"]') result.append("Cookie is accepted") except: result.append("Something wrong with cookies") try: qalib.element_click(browser, logs, 3, By.XPATH, "//h2[contains(text(),'login')]") sleep(2) qalib.element_click( browser, logs, 3, By.XPATH, "//div[@class='social-auth__icon social-auth__icon-google']") window_before = browser.window_handles[0] window_after = browser.window_handles[1] browser.switch_to_window(window_after) sleep(3) qalib.element_send_keys(browser, logs, 3, By.ID, "identifierId", login, Keys.ENTER) qalib.element_send_keys(browser, logs, 3, By.ID, "password", password, Keys.ENTER) browser.switch_to_window(window_before) sleep(4) qalib.wait_until_with_exception(browser, logs, 10, EC.title_is('OPN Platform')) sleep(4) result.append("Login via facebook successfully passed") except: result.append("Login via facebook failed") qalib.result_of_the_test(result) qalib.tear_down(browser, logs)