Vladimir Druzhinin 0219df1eba chore: Improve AUT methods (#223)
- Close and Detach methods are merged
- Saving pid in Aut changed to close after AttachError
- Collect all pid that use port
2023-10-27 13:44:45 +02:00

27 lines
707 B
Python

import allure
import pytest
from driver.server import SquishServer
@pytest.fixture(scope='session')
def start_squish_server():
squish_server = SquishServer()
squish_server.stop()
attempt = 3
while True:
try:
squish_server.start()
squish_server.set_cursor_animation()
squish_server.set_aut_timeout()
break
except AssertionError as err:
attempt -= 1
if not attempt:
pytest.exit(err)
yield squish_server
squish_server.stop()
if squish_server.config.exists():
allure.attach.file(str(squish_server.config), 'Squish server config')
squish_server.config.unlink()