2023-10-09 09:38:48 +00:00
|
|
|
import allure
|
2023-08-04 18:27:03 +00:00
|
|
|
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()
|
2023-10-25 12:38:48 +00:00
|
|
|
squish_server.set_cursor_animation()
|
2023-10-27 11:44:45 +00:00
|
|
|
squish_server.set_aut_timeout()
|
2023-08-04 18:27:03 +00:00
|
|
|
break
|
|
|
|
except AssertionError as err:
|
|
|
|
attempt -= 1
|
|
|
|
if not attempt:
|
|
|
|
pytest.exit(err)
|
|
|
|
yield squish_server
|
|
|
|
squish_server.stop()
|
2023-10-09 17:04:29 +00:00
|
|
|
if squish_server.config.exists():
|
|
|
|
allure.attach.file(str(squish_server.config), 'Squish server config')
|
2023-10-11 10:38:55 +00:00
|
|
|
squish_server.config.unlink()
|