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

52 lines
1.5 KiB
Python

import logging
import typing
import configs.testpath
from scripts.utils import local_system
_PROCESS_NAME = '_squishserver'
_logger = logging.getLogger(__name__)
class SquishServer:
def __init__(
self,
host: str = '127.0.0.1',
port: int = 4322
):
self.path = configs.testpath.SQUISH_DIR / 'bin' / 'squishserver'
self.config = configs.testpath.ROOT / 'squish_server.ini'
self.host = host
self.port = port
self.pid = None
def start(self):
cmd = [
f'"{self.path}"',
'--configfile', str(self.config),
f'--host={self.host}',
f'--port={self.port}',
]
self.pid = local_system.execute(cmd)
def stop(self):
if self.pid is not None:
local_system.kill_process(self.pid, verify=True)
self.pid = None
# https://doc-snapshots.qt.io/squish/cli-squishserver.html
def configuring(self, action: str, options: typing.Union[int, str, list]):
local_system.run(
[f'"{self.path}"', '--configfile', str(self.config), '--config', action, ' '.join(options)])
def add_executable_aut(self, aut_id, app_dir):
self.configuring('addAUT', [aut_id, f'"{app_dir}"'])
def add_attachable_aut(self, aut_id: str, port: int):
self.configuring('addAttachableAUT', [aut_id, f'localhost:{port}'])
def set_aut_timeout(self, value: int = configs.timeouts.PROCESS_TIMEOUT_SEC):
self.configuring('setAUTTimeout', [str(value)])