Chore/display (#234)

* Using the name of the display from CI in grabbing screenshots

#233

* Test fail
This commit is contained in:
Vladimir Druzhinin 2023-10-31 15:59:27 +01:00 committed by GitHub
parent 47cae96108
commit 299f54a89c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,4 @@
import os
import platform
IS_LIN = True if platform.system() == 'Linux' else False
@ -5,3 +6,5 @@ IS_MAC = True if platform.system() == 'Darwin' else False
IS_WIN = True if platform.system() == 'Windows' else False
OS_ID = 'lin' if IS_LIN else 'mac' if IS_MAC else 'win'
DISPLAY = os.getenv('DISPLAY', ':0')

View File

@ -58,7 +58,7 @@ def pytest_exception_interact(node):
screenshot = node_dir / 'screenshot.png'
if screenshot.exists():
screenshot = node_dir / f'screenshot_{datetime.now():%H%M%S}.png'
ImageGrab.grab(xdisplay=":0" if IS_LIN else None).save(screenshot)
ImageGrab.grab(xdisplay=configs.system.DISPLAY if IS_LIN else None).save(screenshot)
allure.attach(
name='Screenshot on fail',
body=screenshot.read_bytes(),

View File

@ -44,7 +44,7 @@ class AUT:
screenshot = configs.testpath.RUN / 'screenshot.png'
if screenshot.exists():
screenshot = configs.testpath.RUN / f'screenshot_{datetime.now():%H%M%S}.png'
ImageGrab.grab(xdisplay=":0" if IS_LIN else None).save(screenshot)
ImageGrab.grab(xdisplay=configs.system.DISPLAY if IS_LIN else None).save(screenshot)
allure.attach(
name='Screenshot on fail', body=screenshot.read_bytes(), attachment_type=allure.attachment_type.PNG)
self.stop()

View File

@ -18,7 +18,6 @@ from scripts.tools import image
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703084', 'Create community')
@pytest.mark.case(703084)
@pytest.mark.parametrize('params', [constants.community_params])
@pytest.mark.skip(reason="https://github.com/status-im/desktop-qa-automation/issues/167")
def test_create_community(user_account, main_screen: MainWindow, params):
with step('Create community'):
communities_portal = main_screen.left_panel.open_communities_portal()