tests: reorganise automated tests executed in prs for better visibility

This commit is contained in:
Anastasiya Semenkevich 2024-08-15 17:31:23 +03:00 committed by Anastasiya
parent b20cb42def
commit de7872546a
19 changed files with 453 additions and 398 deletions

View File

@ -7,15 +7,15 @@ import driver
from constants import UserAccount
from constants.community_settings import BlockPopupWarnings, ToastMessages
from gui.main_window import MainWindow
from . import marks
import configs
from tests.communities import marks
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/738772',
"Block or unblock someone in Status")
# @pytest.mark.case(738772)
@pytest.mark.case(738772)
@pytest.mark.parametrize('user_data_one, user_data_two, user_data_three', [
(configs.testpath.TEST_USER_DATA / 'squisher', configs.testpath.TEST_USER_DATA / 'athletic',
configs.testpath.TEST_USER_DATA / 'nervous')

View File

@ -76,59 +76,6 @@ def test_create_community(user_account, main_screen: MainWindow, params):
assert '1' in community.members
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703057', 'Edit community')
@pytest.mark.case(703057)
@pytest.mark.critical
@pytest.mark.parametrize('params', [
{
'name': 'Updated Name',
'description': 'Updated Description',
'logo': {'fp': configs.testpath.TEST_FILES / 'banner.png', 'zoom': None, 'shift': None},
'banner': {'fp': configs.testpath.TEST_FILES / 'tv_signal.png', 'zoom': None, 'shift': None},
'color': '#ff7d46',
'tags': ['Ethereum'],
'intro': 'Updated Intro',
'outro': 'Updated Outro'
}
])
def test_edit_community(main_screen: MainWindow, params):
with step('Enable creation of community option'):
settings = main_screen.left_panel.open_settings()
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
community_params = constants.community_params
main_screen.create_community(community_params['name'], community_params['description'],
community_params['intro'], community_params['outro'],
community_params['logo']['fp'], community_params['banner']['fp'])
with step('Edit community'):
community_screen = main_screen.left_panel.select_community(community_params['name'])
community_setting = community_screen.left_panel.open_community_settings()
edit_community_form = community_setting.left_panel.open_overview().open_edit_community_view()
edit_community_form.edit(params['name'], params['description'],
params['intro'], params['outro'],
params['logo']['fp'], params['banner']['fp'])
with step('Verify community parameters on settings overview'):
overview_setting = community_setting.left_panel.open_overview()
with step('Name is correct'):
assert overview_setting.name == params['name']
with step('Description is correct'):
assert overview_setting.description == params['description']
with step('Verify community parameters in community screen'):
community_setting.left_panel.back_to_community()
with step('Name is correct'):
assert community_screen.left_panel.name == params['name']
with step('Verify community parameters in community settings screen'):
settings_screen = main_screen.left_panel.open_settings()
community_settings = settings_screen.left_panel.open_communities_settings()
community_info = community_settings.communities[0]
assert community_info.name == params['name']
assert community_info.description == params['description']
assert '1' in community_info.members
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703252', 'Kick user')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703254', 'Edit chat - Delete any message')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/736991', 'Owner can ban member')

View File

@ -11,74 +11,7 @@ from . import marks
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703226', 'Add category')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703227', 'Remove category')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703233', 'Edit category title')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703234', 'Edit category - add channel')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703235', 'Edit category - remove channel')
@pytest.mark.case(703226, 703233, 703234, 703235, 703227)
@pytest.mark.parametrize(
'category_name, general_checkbox, channel_name, channel_description, channel_emoji, second_channel_name, '
'second_channel_description, second_channel_emoji',
[pytest.param('Category in general', True, 'Channel', 'Description', 'sunglasses', 'Second-channel',
'Description', 'sunglasses')])
@pytest.mark.critical
def test_create_edit_remove_community_category(main_screen: MainWindow, category_name, general_checkbox, channel_name,
channel_description, channel_emoji, second_channel_name, second_channel_description,
second_channel_emoji):
with step('Enable creation of community option'):
settings = main_screen.left_panel.open_settings()
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
with step('Create community and select it'):
community_params = constants.community_params
main_screen.create_community(community_params['name'], community_params['description'],
community_params['intro'], community_params['outro'],
community_params['logo']['fp'], community_params['banner']['fp'])
community_screen = main_screen.left_panel.select_community(community_params['name'])
with step('Create community category and verify that it displays correctly'):
community_screen.create_category(category_name, general_checkbox)
with step('Verify category'):
community_screen.verify_category(category_name)
with step('Create community channel inside category'):
community_screen.left_panel.open_new_channel_popup_in_category().create(channel_name, channel_description,
channel_emoji).save()
with step('Create community channel outside of category'):
community_screen.create_channel(second_channel_name, second_channel_description, second_channel_emoji)
with step('Verify that selected channel is listed outside of category'):
assert community_screen.left_panel.get_channel_or_category_index(second_channel_name) == 0
with step('Open edit category popup'):
category_popup = community_screen.edit_category()
category_popup.enter_category_title("New category").click_checkbox_by_index(0)
category_popup.save()
with step('Verify that selected channel is now listed inside category'):
assert community_screen.left_panel.get_channel_or_category_index(second_channel_name) == 3
with step('Open edit category popup'):
category_popup = community_screen.edit_category()
category_popup.click_checkbox_by_index(2)
category_popup.save()
with step('Verify that selected channel is now listed outside of category'):
assert community_screen.left_panel.get_channel_or_category_index(second_channel_name) == 0
with step('Delete category'):
community_screen.delete_category()
with step('Verify category is not in the list'):
assert category_name not in community_screen.left_panel.categories_items
with step('Verify created channel and general channel are still in the list'):
new_channel = community_screen.left_panel.get_channel_parameters(channel_name)
general_channel = community_screen.left_panel.get_channel_parameters('general')
assert new_channel in community_screen.left_panel.channels
assert general_channel in community_screen.left_panel.channels
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703272', 'Member role cannot add category')

View File

@ -5,208 +5,16 @@ from allure_commons._allure import step
import configs
import constants
import driver
from constants.community_settings import ToastMessages, LimitWarnings, PermissionsElements
from gui.components.changes_detected_popup import PermissionsChangesDetectedToastMessage
from gui.components.delete_popup import DeletePermissionPopup
from constants.community_settings import LimitWarnings
from gui.main_window import MainWindow
from gui.screens.community_settings import PermissionsIntroView
from . import marks
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703632',
'Manage community: Adding new permissions, Editing permissions, Deleting permission')
@pytest.mark.case(703632, 705014, 705016)
@pytest.mark.parametrize('params', [constants.community_params])
@pytest.mark.critical
def test_add_edit_and_remove_permissions(main_screen: MainWindow, params):
with step('Enable creation of community option'):
settings = main_screen.left_panel.open_settings()
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
main_screen.create_community(params['name'], params['description'],
params['intro'], params['outro'],
params['logo']['fp'], params['banner']['fp'])
permission_data = [
{
'checkbox_state': True,
'first_asset': 'Dai Stablecoin',
'second_asset': False,
'amount': '10',
'allowed_to': 'becomeMember',
'in_channel': False,
'asset_title': '10 DAI',
'second_asset_title': False,
'allowed_to_title': 'Become member'
},
{
'checkbox_state': True,
'first_asset': 'Ether',
'second_asset': False,
'amount': '1',
'allowed_to': 'becomeAdmin',
'in_channel': False,
'asset_title': '1 ETH',
'second_asset_title': False,
'allowed_to_title': 'Become an admin'
},
{
'checkbox_state': True,
'first_asset': 'Ether',
'second_asset': 'Dai Stablecoin',
'amount': '10',
'allowed_to': 'viewAndPost',
'in_channel': '#general',
'asset_title': '10 ETH',
'second_asset_title': '10 DAI',
'allowed_to_title': 'View and post'
},
{
'checkbox_state': True,
'first_asset': 'Ether',
'second_asset': 'Dai Stablecoin',
'amount': '10',
'allowed_to': 'viewOnly',
'in_channel': '#general',
'asset_title': '10 ETH',
'second_asset_title': '10 DAI',
'allowed_to_title': 'View only'
},
{
'checkbox_state': False,
'first_asset': False,
'second_asset': False,
'amount': False,
'allowed_to': 'becomeAdmin',
'in_channel': False,
'asset_title': False,
'second_asset_title': False,
'allowed_to_title': 'Become an admin'
}
]
with step('Open add new permission page'):
community_screen = main_screen.left_panel.select_community(params['name'])
community_setting = community_screen.left_panel.open_community_settings()
permissions_intro_view = community_setting.left_panel.open_permissions()
for index, item in enumerate(permission_data):
with step('Create new permission'):
permissions_settings = permissions_intro_view.add_new_permission()
permissions_settings.set_who_holds_checkbox_state(permission_data[index]['checkbox_state'])
permissions_settings.set_who_holds_asset_and_amount(permission_data[index]['first_asset'],
permission_data[index]['amount'])
permissions_settings.set_who_holds_asset_and_amount(permission_data[index]['second_asset'],
permission_data[index]['amount'])
permissions_settings.set_is_allowed_to(permission_data[index]['allowed_to'])
permissions_settings.set_in(permission_data[index]['in_channel'])
permissions_settings.create_permission()
with step('Check toast message for permission creation'):
toast_messages = main_screen.wait_for_notification()
message = toast_messages[0]
assert ToastMessages.CREATE_PERMISSION_TOAST.value in toast_messages, \
f"Toast message is incorrect, current message is {message}"
with step('Created permission is displayed on permission page'):
if permission_data[index]['asset_title'] is not False:
assert driver.waitFor(
lambda: permission_data[index]['asset_title'] in permissions_settings.get_who_holds_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
if permission_data[index]['second_asset_title'] is not False:
assert driver.waitFor(lambda: permission_data[index][
'second_asset_title'] in permissions_settings.get_who_holds_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
if permission_data[index]['allowed_to_title'] is not False:
assert driver.waitFor(lambda: permission_data[index][
'allowed_to_title'] in permissions_settings.get_is_allowed_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
if permission_data[index]['in_channel'] is False:
assert driver.waitFor(
lambda: params['name'] in permissions_settings.get_in_community_in_channel_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
if permission_data[index]['in_channel']:
assert driver.waitFor(lambda: permission_data[index][
'in_channel'] in permissions_settings.get_in_community_in_channel_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
with step('Edit permission'):
edit_permission_view = permissions_intro_view.open_edit_permission_view()
if permission_data[index]['allowed_to'] is 'becomeAdmin' and permission_data[index][
'checkbox_state'] is True:
permissions_settings.set_who_holds_checkbox_state(False)
elif permission_data[index]['checkbox_state'] is False:
permissions_settings.set_allowed_to_from_permission('becomeMember')
else:
edit_permission_view.switch_hide_permission_checkbox(True)
changes_popup = PermissionsChangesDetectedToastMessage().wait_until_appears()
with step('Confirm changes and verify that permission was changed'):
changes_popup.update_permission()
if permission_data[index]['allowed_to'] is 'becomeAdmin' and permission_data[index][
'checkbox_state'] is True:
if permission_data[index]['asset_title'] is not False:
assert driver.waitFor(lambda: permission_data[index][
'asset_title'] not in permissions_settings.get_who_holds_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
if permission_data[index]['second_asset_title'] is not False:
assert driver.waitFor(
lambda: permission_data[index][
'second_asset_title'] not in permissions_settings.get_who_holds_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
elif permission_data[index]['checkbox_state'] is False:
assert driver.waitFor(lambda: 'Become member' in permissions_settings.get_is_allowed_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
else:
assert driver.waitFor(lambda: permissions_intro_view.is_hide_icon_visible,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
with step('Check toast message for edited permission'):
messages = main_screen.wait_for_notification()
assert ToastMessages.UPDATE_PERMISSION_TOAST.value in messages, \
f"Toast message is incorrect, current message is {message}"
with step('Delete permission'):
permissions_intro_view.click_delete_permission()
DeletePermissionPopup().wait_until_appears().delete()
with step('Verify that permission was deleted'):
assert driver.waitFor(lambda: PermissionsIntroView().is_visible)
with step('Check toast message for deleted permission'):
messages = main_screen.wait_for_notification()
assert ToastMessages.DELETE_PERMISSION_TOAST.value in messages, \
f"Toast message is incorrect, current message is {message}"
with step('Create new permission'):
new_permission_data = {
'checkbox_state': True,
'first_asset': 'ETH',
'amount': '6',
'allowed_to': 'becomeMember'
}
permissions_settings = permissions_intro_view.add_new_permission()
permissions_settings.set_who_holds_checkbox_state(new_permission_data['checkbox_state'])
permissions_settings.set_who_holds_asset_and_amount(new_permission_data['first_asset'],
new_permission_data['amount'])
permissions_settings.set_is_allowed_to(new_permission_data['allowed_to'])
permissions_settings.create_permission()
with step('Duplicate created permission and verify correct duplicate warning appears'):
permission_view = permissions_intro_view.click_duplicate_permission()
assert permission_view.get_warning_text() == PermissionsElements.DUPLICATE_WARNING.value
permissions_settings.set_who_holds_asset_and_amount('Aragon', '10')
permissions_settings.create_permission()
with step('Duplicated permission is displayed on permission page'):
assert driver.waitFor(
lambda: '10 ANT' in permissions_settings.get_who_holds_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/739309',
'Can create up to 5 member role permissions')
@pytest.mark.case(739309)
@pytest.mark.parametrize('params', [constants.community_params])
def test_add_5_member_role_permissions(main_screen: MainWindow, params):
with step('Enable creation of community option'):

View File

@ -0,0 +1,3 @@
import pytest
marks = pytest.mark.critical

View File

@ -0,0 +1,79 @@
import allure
import pytest
from allure_commons._allure import step
import constants
from gui.main_window import MainWindow
from . import marks
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703226', 'Add category')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703227', 'Remove category')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703233', 'Edit category title')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703234', 'Edit category - add channel')
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703235', 'Edit category - remove channel')
@pytest.mark.case(703226, 703233, 703234, 703235, 703227)
@pytest.mark.parametrize(
'category_name, general_checkbox, channel_name, channel_description, channel_emoji, second_channel_name, '
'second_channel_description, second_channel_emoji',
[pytest.param('Category in general', True, 'Channel', 'Description', 'sunglasses', 'Second-channel',
'Description', 'sunglasses')])
@pytest.mark.critical
def test_create_edit_remove_community_category(main_screen: MainWindow, category_name, general_checkbox, channel_name,
channel_description, channel_emoji, second_channel_name, second_channel_description,
second_channel_emoji):
with step('Enable creation of community option'):
settings = main_screen.left_panel.open_settings()
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
with step('Create community and select it'):
community_params = constants.community_params
main_screen.create_community(community_params['name'], community_params['description'],
community_params['intro'], community_params['outro'],
community_params['logo']['fp'], community_params['banner']['fp'])
community_screen = main_screen.left_panel.select_community(community_params['name'])
with step('Create community category and verify that it displays correctly'):
community_screen.create_category(category_name, general_checkbox)
with step('Verify category'):
community_screen.verify_category(category_name)
with step('Create community channel inside category'):
community_screen.left_panel.open_new_channel_popup_in_category().create(channel_name, channel_description,
channel_emoji).save()
with step('Create community channel outside of category'):
community_screen.create_channel(second_channel_name, second_channel_description, second_channel_emoji)
with step('Verify that selected channel is listed outside of category'):
assert community_screen.left_panel.get_channel_or_category_index(second_channel_name) == 0
with step('Open edit category popup'):
category_popup = community_screen.edit_category()
category_popup.enter_category_title("New category").click_checkbox_by_index(0)
category_popup.save()
with step('Verify that selected channel is now listed inside category'):
assert community_screen.left_panel.get_channel_or_category_index(second_channel_name) == 3
with step('Open edit category popup'):
category_popup = community_screen.edit_category()
category_popup.click_checkbox_by_index(2)
category_popup.save()
with step('Verify that selected channel is now listed outside of category'):
assert community_screen.left_panel.get_channel_or_category_index(second_channel_name) == 0
with step('Delete category'):
community_screen.delete_category()
with step('Verify category is not in the list'):
assert category_name not in community_screen.left_panel.categories_items
with step('Verify created channel and general channel are still in the list'):
new_channel = community_screen.left_panel.get_channel_parameters(channel_name)
general_channel = community_screen.left_panel.get_channel_parameters('general')
assert new_channel in community_screen.left_panel.channels
assert general_channel in community_screen.left_panel.channels

View File

@ -0,0 +1,63 @@
import allure
import pytest
from allure_commons._allure import step
from . import marks
import configs.testpath
import constants
from gui.main_window import MainWindow
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703057', 'Edit community')
@pytest.mark.case(703057)
@pytest.mark.critical
@pytest.mark.parametrize('params', [
{
'name': 'Updated Name',
'description': 'Updated Description',
'logo': {'fp': configs.testpath.TEST_FILES / 'banner.png', 'zoom': None, 'shift': None},
'banner': {'fp': configs.testpath.TEST_FILES / 'tv_signal.png', 'zoom': None, 'shift': None},
'color': '#ff7d46',
'tags': ['Ethereum'],
'intro': 'Updated Intro',
'outro': 'Updated Outro'
}
])
def test_edit_community(main_screen: MainWindow, params):
with step('Enable creation of community option'):
settings = main_screen.left_panel.open_settings()
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
community_params = constants.community_params
main_screen.create_community(community_params['name'], community_params['description'],
community_params['intro'], community_params['outro'],
community_params['logo']['fp'], community_params['banner']['fp'])
with step('Edit community'):
community_screen = main_screen.left_panel.select_community(community_params['name'])
community_setting = community_screen.left_panel.open_community_settings()
edit_community_form = community_setting.left_panel.open_overview().open_edit_community_view()
edit_community_form.edit(params['name'], params['description'],
params['intro'], params['outro'],
params['logo']['fp'], params['banner']['fp'])
with step('Verify community parameters on settings overview'):
overview_setting = community_setting.left_panel.open_overview()
with step('Name is correct'):
assert overview_setting.name == params['name']
with step('Description is correct'):
assert overview_setting.description == params['description']
with step('Verify community parameters in community screen'):
community_setting.left_panel.back_to_community()
with step('Name is correct'):
assert community_screen.left_panel.name == params['name']
with step('Verify community parameters in community settings screen'):
settings_screen = main_screen.left_panel.open_settings()
community_settings = settings_screen.left_panel.open_communities_settings()
community_info = community_settings.communities[0]
assert community_info.name == params['name']
assert community_info.description == params['description']
assert '1' in community_info.members

View File

@ -0,0 +1,207 @@
import allure
import pytest
from allure_commons._allure import step
import configs
import constants
import driver
from constants.community_settings import ToastMessages, LimitWarnings, PermissionsElements
from gui.components.changes_detected_popup import PermissionsChangesDetectedToastMessage
from gui.components.delete_popup import DeletePermissionPopup
from gui.main_window import MainWindow
from gui.screens.community_settings import PermissionsIntroView
from . import marks
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703632',
'Manage community: Adding new permissions, Editing permissions, Deleting permission')
@pytest.mark.case(703632, 705014, 705016)
@pytest.mark.parametrize('params', [constants.community_params])
@pytest.mark.critical
def test_add_edit_and_remove_permissions(main_screen: MainWindow, params):
with step('Enable creation of community option'):
settings = main_screen.left_panel.open_settings()
settings.left_panel.open_advanced_settings().enable_creation_of_communities()
main_screen.create_community(params['name'], params['description'],
params['intro'], params['outro'],
params['logo']['fp'], params['banner']['fp'])
permission_data = [
{
'checkbox_state': True,
'first_asset': 'Dai Stablecoin',
'second_asset': False,
'amount': '10',
'allowed_to': 'becomeMember',
'in_channel': False,
'asset_title': '10 DAI',
'second_asset_title': False,
'allowed_to_title': 'Become member'
},
{
'checkbox_state': True,
'first_asset': 'Ether',
'second_asset': False,
'amount': '1',
'allowed_to': 'becomeAdmin',
'in_channel': False,
'asset_title': '1 ETH',
'second_asset_title': False,
'allowed_to_title': 'Become an admin'
},
{
'checkbox_state': True,
'first_asset': 'Ether',
'second_asset': 'Dai Stablecoin',
'amount': '10',
'allowed_to': 'viewAndPost',
'in_channel': '#general',
'asset_title': '10 ETH',
'second_asset_title': '10 DAI',
'allowed_to_title': 'View and post'
},
{
'checkbox_state': True,
'first_asset': 'Ether',
'second_asset': 'Dai Stablecoin',
'amount': '10',
'allowed_to': 'viewOnly',
'in_channel': '#general',
'asset_title': '10 ETH',
'second_asset_title': '10 DAI',
'allowed_to_title': 'View only'
},
{
'checkbox_state': False,
'first_asset': False,
'second_asset': False,
'amount': False,
'allowed_to': 'becomeAdmin',
'in_channel': False,
'asset_title': False,
'second_asset_title': False,
'allowed_to_title': 'Become an admin'
}
]
with step('Open add new permission page'):
community_screen = main_screen.left_panel.select_community(params['name'])
community_setting = community_screen.left_panel.open_community_settings()
permissions_intro_view = community_setting.left_panel.open_permissions()
for index, item in enumerate(permission_data):
with step('Create new permission'):
permissions_settings = permissions_intro_view.add_new_permission()
permissions_settings.set_who_holds_checkbox_state(permission_data[index]['checkbox_state'])
permissions_settings.set_who_holds_asset_and_amount(permission_data[index]['first_asset'],
permission_data[index]['amount'])
permissions_settings.set_who_holds_asset_and_amount(permission_data[index]['second_asset'],
permission_data[index]['amount'])
permissions_settings.set_is_allowed_to(permission_data[index]['allowed_to'])
permissions_settings.set_in(permission_data[index]['in_channel'])
permissions_settings.create_permission()
with step('Check toast message for permission creation'):
toast_messages = main_screen.wait_for_notification()
message = toast_messages[0]
assert ToastMessages.CREATE_PERMISSION_TOAST.value in toast_messages, \
f"Toast message is incorrect, current message is {message}"
with step('Created permission is displayed on permission page'):
if permission_data[index]['asset_title'] is not False:
assert driver.waitFor(
lambda: permission_data[index]['asset_title'] in permissions_settings.get_who_holds_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
if permission_data[index]['second_asset_title'] is not False:
assert driver.waitFor(lambda: permission_data[index][
'second_asset_title'] in permissions_settings.get_who_holds_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
if permission_data[index]['allowed_to_title'] is not False:
assert driver.waitFor(lambda: permission_data[index][
'allowed_to_title'] in permissions_settings.get_is_allowed_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
if permission_data[index]['in_channel'] is False:
assert driver.waitFor(
lambda: params['name'] in permissions_settings.get_in_community_in_channel_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
if permission_data[index]['in_channel']:
assert driver.waitFor(lambda: permission_data[index][
'in_channel'] in permissions_settings.get_in_community_in_channel_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
with step('Edit permission'):
edit_permission_view = permissions_intro_view.open_edit_permission_view()
if permission_data[index]['allowed_to'] is 'becomeAdmin' and permission_data[index][
'checkbox_state'] is True:
permissions_settings.set_who_holds_checkbox_state(False)
elif permission_data[index]['checkbox_state'] is False:
permissions_settings.set_allowed_to_from_permission('becomeMember')
else:
edit_permission_view.switch_hide_permission_checkbox(True)
changes_popup = PermissionsChangesDetectedToastMessage().wait_until_appears()
with step('Confirm changes and verify that permission was changed'):
changes_popup.update_permission()
if permission_data[index]['allowed_to'] is 'becomeAdmin' and permission_data[index][
'checkbox_state'] is True:
if permission_data[index]['asset_title'] is not False:
assert driver.waitFor(lambda: permission_data[index][
'asset_title'] not in permissions_settings.get_who_holds_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
if permission_data[index]['second_asset_title'] is not False:
assert driver.waitFor(
lambda: permission_data[index][
'second_asset_title'] not in permissions_settings.get_who_holds_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
elif permission_data[index]['checkbox_state'] is False:
assert driver.waitFor(lambda: 'Become member' in permissions_settings.get_is_allowed_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
else:
assert driver.waitFor(lambda: permissions_intro_view.is_hide_icon_visible,
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)
with step('Check toast message for edited permission'):
messages = main_screen.wait_for_notification()
assert ToastMessages.UPDATE_PERMISSION_TOAST.value in messages, \
f"Toast message is incorrect, current message is {message}"
with step('Delete permission'):
permissions_intro_view.click_delete_permission()
DeletePermissionPopup().wait_until_appears().delete()
with step('Verify that permission was deleted'):
assert driver.waitFor(lambda: PermissionsIntroView().is_visible)
with step('Check toast message for deleted permission'):
messages = main_screen.wait_for_notification()
assert ToastMessages.DELETE_PERMISSION_TOAST.value in messages, \
f"Toast message is incorrect, current message is {message}"
with step('Create new permission'):
new_permission_data = {
'checkbox_state': True,
'first_asset': 'ETH',
'amount': '6',
'allowed_to': 'becomeMember'
}
permissions_settings = permissions_intro_view.add_new_permission()
permissions_settings.set_who_holds_checkbox_state(new_permission_data['checkbox_state'])
permissions_settings.set_who_holds_asset_and_amount(new_permission_data['first_asset'],
new_permission_data['amount'])
permissions_settings.set_is_allowed_to(new_permission_data['allowed_to'])
permissions_settings.create_permission()
with step('Duplicate created permission and verify correct duplicate warning appears'):
permission_view = permissions_intro_view.click_duplicate_permission()
assert permission_view.get_warning_text() == PermissionsElements.DUPLICATE_WARNING.value
permissions_settings.set_who_holds_asset_and_amount('Aragon', '10')
permissions_settings.create_permission()
with step('Duplicated permission is displayed on permission page'):
assert driver.waitFor(
lambda: '10 ANT' in permissions_settings.get_who_holds_tags_titles(),
configs.timeouts.UI_LOAD_TIMEOUT_MSEC)

View File

@ -16,7 +16,7 @@ import constants
from constants import UserAccount
from gui.main_window import MainWindow
from . import marks
from tests.messages import marks
pytestmark = marks

View File

@ -6,7 +6,7 @@ import pytest
from allure import step
import constants
from . import marks
from tests.onboarding import marks
import configs.timeouts
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp

View File

@ -4,7 +4,7 @@ from allure_commons._allure import step
from constants.onboarding import KeysExistText
from driver.aut import AUT
from . import marks
from tests.onboarding import marks
import configs.system
import constants
@ -31,7 +31,6 @@ def keys_screen(main_window) -> KeysView:
@pytest.mark.case(703040, 736372)
@pytest.mark.parametrize('user_account', [constants.user.user_account_one])
@pytest.mark.parametrize('autocomplete, default_name', [
pytest.param(False, 'Account 1'),
pytest.param(True, 'Account 1', marks=pytest.mark.critical)
])
def test_import_seed_phrase(keys_screen, main_window, aut: AUT, user_account, default_name: str, autocomplete: bool):

View File

@ -0,0 +1,87 @@
import allure
import pyperclip
import pytest
from allure_commons._allure import step
from . import marks
import configs.testpath
import constants
import driver
from constants import UserAccount
from gui.components.onboarding.before_started_popup import BeforeStartedPopUp
from gui.components.onboarding.beta_consent_popup import BetaConsentPopup
from gui.components.splash_screen import SplashScreen
from gui.main_window import MainWindow
from gui.screens.onboarding import AllowNotificationsView, WelcomeToStatusView, SyncResultView, SyncDeviceFoundView, \
YourEmojihashAndIdenticonRingView
pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703592', 'Sync device during onboarding')
@pytest.mark.case(703592)
@pytest.mark.critical
def test_sync_device_during_onboarding(multiple_instances):
user: UserAccount = constants.user_with_random_attributes_1
main_window = MainWindow()
with multiple_instances(user_data=None) as aut_one, multiple_instances(user_data=None) as aut_two:
with step('Get syncing code in first instance'):
aut_one.attach()
main_window.prepare()
main_window.authorize_user(user)
sync_settings_view = main_window.left_panel.open_settings().left_panel.open_syncing_settings()
sync_settings_view.is_instructions_header_present()
sync_settings_view.is_instructions_subtitle_present()
if configs.DEV_BUILD:
sync_settings_view.is_backup_button_present()
setup_syncing = main_window.left_panel.open_settings().left_panel.open_syncing_settings().set_up_syncing(
user.password)
sync_code = setup_syncing.syncing_code
setup_syncing.done()
main_window.hide()
with step('Verify syncing code is correct'):
sync_code_fields = sync_code.split(':')
assert sync_code_fields[0] == 'cs3'
assert len(sync_code_fields) == 5
with step('Open sync code form in second instance'):
aut_two.attach()
main_window.prepare()
BeforeStartedPopUp().get_started()
wellcome_screen = WelcomeToStatusView().wait_until_appears()
sync_view = wellcome_screen.sync_existing_user().open_sync_code_view()
with step('Paste sync code on second instance and wait until device is synced'):
sync_start = sync_view.open_enter_sync_code_form()
pyperclip.copy(sync_code)
sync_start.click_paste_button()
sync_device_found = SyncDeviceFoundView()
assert driver.waitFor(
lambda: 'Device found!' in sync_device_found.device_found_notifications, 15000)
try:
assert driver.waitForObjectExists(SyncResultView().real_name, 15000), \
f'Sync result view is not shown within 15 seconds'
except (Exception, AssertionError) as ex:
raise ex
sync_result = SyncResultView()
assert driver.waitFor(
lambda: 'Device synced!' in sync_result.device_synced_notifications, 23000)
assert user.name in sync_device_found.device_found_notifications
with step('Sign in to synced account'):
sync_result.sign_in()
SplashScreen().wait_until_hidden()
YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next()
if configs.system.get_platform() == "Darwin":
AllowNotificationsView().start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()
with step('Verify user details are the same with user in first instance'):
online_identifier = main_window.left_panel.open_online_identifier()
assert online_identifier.get_user_name == user.name, \
f'Name in online identifier and display name do not match'

View File

@ -3,7 +3,7 @@ import pytest
from allure_commons._allure import step
import driver
from . import marks
from tests.settings import marks
import configs
from gui.components.back_up_your_seed_phrase_banner import BackUpSeedPhraseBanner

View File

@ -4,7 +4,7 @@ import string
import allure
import pytest
from allure_commons._allure import step
from . import marks
from tests.settings.settings_wallet import marks
import constants
import driver

View File

@ -5,7 +5,7 @@ import allure
import pytest
from allure_commons._allure import step
from . import marks
from tests.settings.settings_wallet import marks
import configs
import driver
@ -39,6 +39,7 @@ def test_wallet_settings_add_saved_address(main_screen: MainWindow, address: str
assert driver.waitFor(
lambda: name in settings_saved_addresses.get_saved_address_names_list(),
configs.timeouts.APP_LOAD_TIMEOUT_MSEC), f'Address: {name} not found'
# TODO change timeout after https://github.com/status-im/status-desktop/issues/16121
with step('Verify toast message when adding saved address'):
messages = main_screen.wait_for_notification()

View File

@ -30,74 +30,6 @@ def sync_screen(main_window) -> SyncCodeView:
return wellcome_screen.sync_existing_user().open_sync_code_view()
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703592', 'Sync device during onboarding')
@pytest.mark.case(703592)
@pytest.mark.critical
def test_sync_device_during_onboarding(multiple_instances):
user: UserAccount = constants.user_with_random_attributes_1
main_window = MainWindow()
with multiple_instances(user_data=None) as aut_one, multiple_instances(user_data=None) as aut_two:
with step('Get syncing code in first instance'):
aut_one.attach()
main_window.prepare()
main_window.authorize_user(user)
sync_settings_view = main_window.left_panel.open_settings().left_panel.open_syncing_settings()
sync_settings_view.is_instructions_header_present()
sync_settings_view.is_instructions_subtitle_present()
if configs.DEV_BUILD:
sync_settings_view.is_backup_button_present()
setup_syncing = main_window.left_panel.open_settings().left_panel.open_syncing_settings().set_up_syncing(
user.password)
sync_code = setup_syncing.syncing_code
setup_syncing.done()
main_window.hide()
with step('Verify syncing code is correct'):
sync_code_fields = sync_code.split(':')
assert sync_code_fields[0] == 'cs3'
assert len(sync_code_fields) == 5
with step('Open sync code form in second instance'):
aut_two.attach()
main_window.prepare()
BeforeStartedPopUp().get_started()
wellcome_screen = WelcomeToStatusView().wait_until_appears()
sync_view = wellcome_screen.sync_existing_user().open_sync_code_view()
with step('Paste sync code on second instance and wait until device is synced'):
sync_start = sync_view.open_enter_sync_code_form()
pyperclip.copy(sync_code)
sync_start.click_paste_button()
sync_device_found = SyncDeviceFoundView()
assert driver.waitFor(
lambda: 'Device found!' in sync_device_found.device_found_notifications, 15000)
try:
assert driver.waitForObjectExists(SyncResultView().real_name, 15000), \
f'Sync result view is not shown within 15 seconds'
except (Exception, AssertionError) as ex:
raise ex
sync_result = SyncResultView()
assert driver.waitFor(
lambda: 'Device synced!' in sync_result.device_synced_notifications, 23000)
assert user.name in sync_device_found.device_found_notifications
with step('Sign in to synced account'):
sync_result.sign_in()
SplashScreen().wait_until_hidden()
YourEmojihashAndIdenticonRingView().verify_emojihash_view_present().next()
if configs.system.get_platform() == "Darwin":
AllowNotificationsView().start_using_status()
SplashScreen().wait_until_appears().wait_until_hidden()
if not configs.system.TEST_MODE and not configs._local.DEV_BUILD:
BetaConsentPopup().confirm()
with step('Verify user details are the same with user in first instance'):
online_identifier = main_window.left_panel.open_online_identifier()
assert online_identifier.get_user_name == user.name, \
f'Name in online identifier and display name do not match'
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/703631', 'Wrong sync code')
@pytest.mark.case(703631)
@pytest.mark.parametrize('wrong_sync_code', [

View File

@ -1,3 +0,0 @@
import pytest
marks = pytest.mark.user_guide

View File

@ -11,8 +11,7 @@ pytestmark = marks
@allure.testcase('https://ethstatus.testrail.net/index.php?/cases/view/738783','Share your address')
@pytest.mark.case(738783)
@pytest.mark.transaction
def test_share_wallet_address(main_screen: MainWindow, default_name):
def test_share_wallet_address(main_screen: MainWindow):
with step('Open wallet and choose default account'):
default_name = 'Account 1'
wallet = main_screen.left_panel.open_wallet()