Third-party components

Logger for steps

ui_tests.third_party.logger.log(func)[source]

Decorator to log function with arguments and execution time.

Custom hamcrest matchers

class ui_tests.third_party.matchers.calling(func)[source]

Custom calling to return result after call.

ui_tests.third_party.matchers.check_that(actual, matcher, message)[source]

Wrapper over assert_that to add step in allure report.

class ui_tests.third_party.matchers.returns(matcher, timeout)[source]

Matcher to check that a result is being matched during timeout.

Interprocess locker

class ui_tests.third_party.process_mutex.Lock(filename)[source]

Process mutex.

acquire()[source]

Acquire lock.

release()[source]

Release lock.

Step decorator

ui_tests.third_party.step.step(obj)[source]

Decorator over allure.step and logger.log.

Utils

ui_tests.third_party.utils.generate_ids(prefix=None, postfix=None, count=1)[source]

Generate unique IDs.

ui_tests.third_party.utils.get_unwrapped_func(func)[source]

Get original function under decorator.

Decorator hides original function inside itself. But in some cases it’s important to get access to original function, for ex: for documentation.

Parameters:func (function) – function that can be potentially a decorator which hides original function
Returns:unwrapped function or the same function
Return type:function
ui_tests.third_party.utils.slugify(string)[source]

Replace non-alphanumeric symbols to underscore in string. :param string: string to replace :type string: str

Returns:replace string
Return type:str

Video capture of display

class ui_tests.third_party.video_recorder.VideoRecorder(file_path, resolution, frame_rate=30)[source]

Video capture of display.

clear()[source]

Remove video file.

start()[source]

Start video capture.

stop()[source]

Stop video capture.