Vladimir Druzhinin fd64142295 Ci/74 jenkins file (#118)
* Set up Jenkins file

#74

* Fix Allure trend

* Display resolution changed on CI

* TestRail integration

* Fix test on create community

* Fix wallet tests

* Fix field description in jenkinsfile

* Test name and test scope parameters were split in Jenkinsfile

* Clean up moved in post stage

* Environment variables set up changed in JenkinsFile

* Fix test ID

* Fix warnings in JenkinsFile

* Copy artifacts directory changed

* Fix of two space indentations in Jenkinsfile

* Extra environment variable removed

* Move tests wallet in one folder

---------

Co-authored-by: Valentina Novgorodtceva <valentina@status.im>
2023-09-28 14:44:13 +02:00

33 lines
899 B
Python

import logging
import time
import allure
import squish
import configs
_logger = logging.getLogger(__name__)
@allure.step('Attaching to "{0}"')
def attach(aut_id: str, timeout_sec: int = configs.timeouts.PROCESS_TIMEOUT_SEC):
started_at = time.monotonic()
_logger.debug(f'Attaching to {aut_id}')
while True:
try:
context = squish.attachToApplication(aut_id)
_logger.info(f'AUT: {aut_id} attached')
return context
except RuntimeError as err:
_logger.debug(err)
time.sleep(1)
assert time.monotonic() - started_at < timeout_sec, f'Attach error: {aut_id}'
@allure.step('Detaching')
def detach():
for ctx in squish.applicationContextList():
ctx.detach()
assert squish.waitFor(lambda: not ctx.isRunning, configs.timeouts.APP_LOAD_TIMEOUT_MSEC)
_logger.info(f'All AUTs detached')