Chore/display (#234)
* Using the name of the display from CI in grabbing screenshots #233 * Test fail
This commit is contained in:
parent
0f41c2c3cf
commit
46e77e14e9
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
import platform
|
import platform
|
||||||
|
|
||||||
IS_LIN = True if platform.system() == 'Linux' else False
|
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
|
IS_WIN = True if platform.system() == 'Windows' else False
|
||||||
|
|
||||||
OS_ID = 'lin' if IS_LIN else 'mac' if IS_MAC else 'win'
|
OS_ID = 'lin' if IS_LIN else 'mac' if IS_MAC else 'win'
|
||||||
|
|
||||||
|
DISPLAY = os.getenv('DISPLAY', ':0')
|
||||||
|
|
|
@ -58,7 +58,7 @@ def pytest_exception_interact(node):
|
||||||
screenshot = node_dir / 'screenshot.png'
|
screenshot = node_dir / 'screenshot.png'
|
||||||
if screenshot.exists():
|
if screenshot.exists():
|
||||||
screenshot = node_dir / f'screenshot_{datetime.now():%H%M%S}.png'
|
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(
|
allure.attach(
|
||||||
name='Screenshot on fail',
|
name='Screenshot on fail',
|
||||||
body=screenshot.read_bytes(),
|
body=screenshot.read_bytes(),
|
||||||
|
|
|
@ -44,7 +44,7 @@ class AUT:
|
||||||
screenshot = configs.testpath.RUN / 'screenshot.png'
|
screenshot = configs.testpath.RUN / 'screenshot.png'
|
||||||
if screenshot.exists():
|
if screenshot.exists():
|
||||||
screenshot = configs.testpath.RUN / f'screenshot_{datetime.now():%H%M%S}.png'
|
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(
|
allure.attach(
|
||||||
name='Screenshot on fail', body=screenshot.read_bytes(), attachment_type=allure.attachment_type.PNG)
|
name='Screenshot on fail', body=screenshot.read_bytes(), attachment_type=allure.attachment_type.PNG)
|
||||||
self.stop()
|
self.stop()
|
||||||
|
|
|
@ -18,7 +18,6 @@ from scripts.tools import image
|
||||||
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703084', 'Create community')
|
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703084', 'Create community')
|
||||||
@pytest.mark.case(703084)
|
@pytest.mark.case(703084)
|
||||||
@pytest.mark.parametrize('params', [constants.community_params])
|
@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):
|
def test_create_community(user_account, main_screen: MainWindow, params):
|
||||||
with step('Create community'):
|
with step('Create community'):
|
||||||
communities_portal = main_screen.left_panel.open_communities_portal()
|
communities_portal = main_screen.left_panel.open_communities_portal()
|
||||||
|
|
Loading…
Reference in New Issue