示例#1
0
def login(driver, admin):
    """Вход в систему"""
    page = AuthPage(driver)
    page.username = admin.login
    page.password = admin.password
    page.click_login_button()
    yield
示例#2
0
    def setUp(self):
        browser = os.environ.get('BROWSER', os.environ['BROWSER'])

        self.driver = Remote(command_executor='http://127.0.0.1:4444/wd/hub',
                             desired_capabilities=getattr(
                                 DesiredCapabilities, browser).copy())
        self.driver.maximize_window()

        self.MESSAGE_TEXT = "testNumber1"
        self.BOT_1_LOGIN = "******"
        self.BOT_2_LOGIN = "******"
        self.PASSWORD = os.environ['PASSWORD']
        self.CURRENT_DIALOG_URL = ""

        self.dialog_page = DialogPage(self.driver)
        self.message_page = MessagePage(self.driver)
        self.auth_page = AuthPage(self.driver)
        self.auth_page.sign_in(self.BOT_1_LOGIN, self.PASSWORD)
        self.main_page = MainPage(self.driver)
        self.main_page.open_messages()
        self.URL_OF_DIALOG_WITH_ME = "https://ok.ru/messages/575662066926"
        self.URL_OF_MESSAGES = "https://ok.ru/messages"

        self.NEED_TO_BLOCK_USER = False
        self.NEED_TO_CHANGE_ACC = False

        self.create_dialog()
        self.CURRENT_DIALOG_URL = self.driver.current_url
示例#3
0
def test_UserLogin(browser):
    load_dotenv()
    username = os.getenv('USERNAME')
    nav = HeaderNav(browser)
    auth = AuthPage(browser)
    nav.navigate_to('signin')
    auth.input_login_credentials()
    auth.click_sigin_button()
    assert nav.verify_user_login(username)
示例#4
0
    def test_signin_existing_user(self, admin):
        user = admin

        page = AuthPage(self.driver)
        page.username = user.login
        page.password = user.password
        page = page.click_login_button()

        assert page.user_is_signin()
示例#5
0
    def setUp(self):
        # browser = os.environ.get('BROWSER', 'FIREFOX')
        browser = os.environ.get('BROWSER', 'CHROME')

        self.driver = Remote(command_executor='http://127.0.0.1:4444/wd/hub',
                             desired_capabilities=getattr(
                                 DesiredCapabilities, browser).copy())
        self.send_message = False
        auth_page = AuthPage(self.driver)
        auth_page.sign_in(self.USEREMAIL, self.PASSWORD)
示例#6
0
文件: tests.py 项目: 112Nick/QA
    def setUp(self):
        browser = os.environ.get('BROWSER', 'FIREFOX')

        self.driver = Remote(command_executor='http://127.0.0.1:4444/wd/hub',
                             desired_capabilities=getattr(
                                 DesiredCapabilities, browser).copy())
        print 'setUp'
        auth_page = AuthPage(self.driver)
        auth_page.sign_in("technopark2", "testQA1")
        main_page = MainPage(self.driver)
        main_page.open_messages()  # Open chat's window
示例#7
0
    def setUp(self):
        # browser = os.environ.get('BROWSER', 'FIREFOX')
        browser = os.environ.get('BROWSER', 'CHROME')

        self.driver = Remote(command_executor='http://127.0.0.1:4444/wd/hub',
                             desired_capabilities=getattr(
                                 DesiredCapabilities, browser).copy())
        auth_page = AuthPage(self.driver)
        auth_page.sign_in(self.USEREMAIL, self.PASSWORD)
        main_page = MainPage(self.driver)
        self.assertEqual(self.USERNAME, main_page.get_username(),
                         "Usernames are not the same")
示例#8
0
    def setUp(self):
        # browser = os.environ.get('BROWSER', 'FIREFOX')
        browser = os.environ.get('BROWSER', 'CHROME')

        # Create a desired capabilities object as a starting point.
        capabilities = DesiredCapabilities.CHROME.copy()
        capabilities['platform'] = "ANY"
        capabilities['version'] = ""

        self.driver = Remote(command_executor='http://172.20.10.2:5555/wd/hub',
                             desired_capabilities=capabilities)
        auth_page = AuthPage(self.driver)
        auth_page.sign_in(self.USERNAME, self.PASSWORD)
        main_page = MainPage(self.driver)
示例#9
0
def test_logged_user_cannot_login_using_direct_link(browser):

    register_new_user(browser, get_account())
    page = AuthPage(browser).open()

    assert 'My account'.upper() == page.title
示例#10
0
def test_recover_password_navigate_back_breadcrumb(password_page):
    index = password_page.nav_items.index('Authentication')
    password_page.navigate(index)
    expected_page = AuthPage(password_page.driver)
    assert 'Authentication'.upper() == expected_page.title
示例#11
0
def auth_page(browser) -> AuthPage:
    return AuthPage(browser).open()
示例#12
0
 def click_logout_button(self):
     self._click(NavBlockLocators.LOG_OUT_LINK_LOCATOR)
     self.alert_accept()
     from pages.auth import AuthPage
     return AuthPage(self._driver)