예제 #1
0
    def register(self, communication_item):
        """
        :param core.communication.item.communication_item.CommunicationItem communication_item:
        """
        LOGGER('Registering request: {}'.format(communication_item))

        if communication_item not in self._board:
            communication_item.id = self._id_count
            self._board.append(communication_item)
            self._id_count += 1
        else:
            LOGGER('Item {} is already on board.'.format(communication_item))
예제 #2
0
 def remove(self, communication_item):
     """
     :param core.communication.item.communication_item.CommunicationItem communication_item:
     """
     LOGGER('Removing communication item: {}'.format(communication_item))
     if communication_item in self._board:
         self._board.remove(communication_item)
예제 #3
0
 def _logout():
     logout_page = BasePage(driver)
     with allure.step('Logout step'):
         LOGGER.info('Logout')
     logout_page.wait_for_element_and_click(*LoginPageLocators.LOGOUT_BTN)
예제 #4
0
 def _login():
     login_page = LoginPage(driver)
     with allure.step('Login step'):
         LOGGER.info(f'Login step with {USERNAME} and {PASSWORD}')
     login_page.login(USERNAME, PASSWORD)
 def log(self, msg):
     """ Prints log message
     :param msg: the message to be printed
     """
     LOGGER('{class_name}:{msg}'.format(class_name=self, msg=msg))
예제 #6
0
 def log_post(response):
     log_str = f'Got response:\n' \
               f'RESPONSE STATUS: {response.status_code}'
     LOGGER.info(f'{log_str}\n'
                 f'RESPONSE CONTENT: {response.text}\n\n')
예제 #7
0
 def log_pre(method, url, headers, data, expected_status):
     LOGGER.info(f'Performing {method} request:\n'
                 f'URL: {url}\n'
                 f'HEADERS: {headers}\n'
                 f'DATA: {data}\n\n'
                 f'Expected status: {expected_status}\n\n')
예제 #8
0
 def test_get_existing_user_data(self, data):
     LOGGER.info('Users: Get existing user data')
     api = UsersCRUD()
     user_data = api.get_user_data(SOURCE_URL, 86)
     assert user_data == data, \
         f'Actual user data: {user_data}\nExpected user data: {data}'