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))
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)
def _logout(): logout_page = BasePage(driver) with allure.step('Logout step'): LOGGER.info('Logout') logout_page.wait_for_element_and_click(*LoginPageLocators.LOGOUT_BTN)
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))
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')
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')
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}'