Skip to content

Commit

Permalink
Merge branch 'master' into percy_troublshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
jordan-mcgillivray005 committed Jun 25, 2024
2 parents d723565 + 5bef854 commit ffa2a3f
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 50 deletions.
24 changes: 0 additions & 24 deletions keywords/webui/certificates.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,30 +724,6 @@ def delete_certificate_by_name(cls, card: str, certificate_name: str) -> None:
WebUI.delay(1)
Common.assert_progress_bar_not_visible()

@classmethod
def select_acme_first_domain_option(cls, option: str) -> None:
"""
This method click on ACME First Domain and select an option.
:param option: The domain name.
Example:
- Certificates.select_acme_first_domain_option('test.com')
"""
# TODO: This will will be replaced by select_Field when the data-test get fix
Common.click_on_element('//*[@data-test="select"]')
Common.click_on_element(xpaths.common_xpaths.option_field(option))

@classmethod
def select_acme_second_domain_option(cls, domain_id: str) -> None:
"""
This method click on ACME Second Domain and select an option.
:param domain_id: The domain id in the list.
Example:
- Certificates.select_acme_second_domain_option('www.test.com')
"""
Common.select_option('1', f'1-{domain_id}')

@classmethod
def select_acme_server_directory_uri_option(cls, option: str) -> None:
"""
Expand Down
16 changes: 0 additions & 16 deletions keywords/webui/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from selenium.webdriver.common.keys import Keys

from helper.cli import SSH_Command_Line
from helper.reporting import take_screenshot
from helper.webui import WebUI
from helper.global_config import private_config
from helper.global_config import shared_config
Expand Down Expand Up @@ -1214,21 +1213,6 @@ def navigate_to_login_screen(cls, ip: str) -> None:
WebUI.get(f'http://{ip}/ui/sessions/signin')
assert WebUI.wait_until_visible(xpaths.common_xpaths.button_field('log-in')) is True

@classmethod
def print_defect_and_screenshot(cls, ticketnumber: str) -> None:
"""
This method prints the NAS ticket number and screenshots.
:param ticketnumber: The ticket number to display with the failure.
Example:
- Common.print_defect_and_screenshot('NAS-999999')
"""
print(f'##### This test has an associated NAS ticket number: | {ticketnumber} | #####')
take_screenshot(ticketnumber)
# TODO: Refactor into webui to be a list that gets added to each time it is called.
# Then add to global conftest to print at the end.

@classmethod
def reboot_system(cls) -> None:
"""
Expand Down
14 changes: 6 additions & 8 deletions keywords/webui/data_protection.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,20 +271,18 @@ def assert_replication_page_delete_replication_task_button_is_restricted(cls, na
return COM.assert_element_is_restricted('//button[contains(@data-test,"-delete")]')

@classmethod
def assert_replication_page_enabled_replication_task_checkbox_is_restricted(cls, name: str) -> bool:
def assert_replication_page_enabled_replication_task_toggle_is_restricted(cls, name: str) -> bool:
"""
This method returns True if the delete replication task button is locked and not clickable, otherwise returns False.
This method returns True if the enable replication task toggle is locked and not clickable, otherwise returns False.
:param name: name of the replication task
:return: True if the delete replication task button is locked and not clickable, otherwise returns False.
:return: True if the enable replication task toggle is locked and not clickable, otherwise returns False.
Example:
- Data_Protection.assert_replication_page_enabled_replication_task_checkbox_is_restricted("rep_name")
- Data_Protection.assert_replication_page_enabled_replication_task_toggle_is_restricted("rep_name")
"""
# name = COM.convert_to_tag_format(name)
# TODO: Update when NAS-129103 is fixed
# return COM.assert_element_is_locked_and_not_clickable(xpaths.common_xpaths.checkbox_field(f'{name}-enabled'))
return COM.assert_element_is_restricted(xpaths.common_xpaths.any_xpath('//*[starts-with(@data-test,"checkbox-")]'))
name = COM.convert_to_tag_format(name)
return COM.assert_toggle_is_restricted(xpaths.common_xpaths.toggle_field(f'enabled-replication-task-{name}-row-toggle'))

@classmethod
def assert_replication_page_replication_task_name(cls, name: str) -> bool:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import allure
import pytest

from helper.global_config import private_config
Expand All @@ -11,6 +12,9 @@
from keywords.ssh.permissions import Permissions_SSH as PERM_SSH


@allure.tag("Datasets", "Dataset Permissions", "NFSv4")
@allure.epic("Datasets")
@allure.feature("Dataset Permissions")
class Test_NFSv4_UI_Create:
@pytest.fixture(scope='class', autouse=True)
def setup_test(self):
Expand All @@ -35,6 +39,8 @@ def teardown_test(self):
COM.verify_logged_in_user_correct(private_config['USERNAME'], private_config['PASSWORD'])
NAV.navigate_to_dashboard()

@allure.tag("Create")
@allure.story("Create Dataset Permissions Using UI")
def test_create_dataset_with_nfsv4_acl(self):
"""
This test creates a new dataset and sets it with the NFSv4 ACL Type and verifies the permissions are set.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
from keywords.ssh.permissions import Permissions_SSH as PERM_SSH


@allure.tag("Datasets", "Dataset Custom Presets", "POSIX")
@allure.epic("Datasets")
@allure.feature("Dataset Custom Presets")
@pytest.mark.parametrize('posix_acl_custom', get_data_list('dataset_permission/posix_acl_custom'), scope='class')
class Test_POSIX_Custom_Preset:
@pytest.fixture(scope='class', autouse=True)
Expand Down Expand Up @@ -64,6 +67,8 @@ def teardown_test(self, posix_acl_custom):
COM.verify_logged_in_user_correct(private_config['USERNAME'], private_config['PASSWORD'])
NAV.navigate_to_dashboard()

@allure.tag("Read")
@allure.story("Dataset Recursive Custom Presets Permissions Using UI")
@allure.issue("NAS-128105", name="NAS-128105")
def test_verify_posix_custom_preset_permissions_via_UI(self, posix_acl_custom):
"""
Expand All @@ -82,6 +87,8 @@ def test_verify_posix_custom_preset_permissions_via_UI(self, posix_acl_custom):
assert PERM.verify_dataset_mask_permissions_name() is True
assert PERM.verify_dataset_mask_permissions(posix_acl_custom['mask_perm']) is True

@allure.tag("Read")
@allure.story("Dataset Recursive Custom Presets Permissions Using SSH")
def test_verify_posix_custom_preset_permissions_via_SSH(self, posix_acl_custom):
"""
This test verifies the ability to create and use a custom POSIX ACL preset and verifies the permissions via SSH.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import allure
import pytest

from helper.data_config import get_data_list
Expand All @@ -12,6 +13,9 @@
from keywords.ssh.permissions import Permissions_SSH as PERM_SSH


@allure.tag("Datasets", "Dataset Presets", "POSIX")
@allure.epic("Datasets")
@allure.feature("Dataset Presets")
@pytest.mark.parametrize('posix_acl_preset', get_data_list('dataset_permission/posix_acl_preset'), scope='class')
class Test_POSIX_Presets:
@pytest.fixture(scope='class', autouse=True)
Expand Down Expand Up @@ -50,6 +54,8 @@ def teardown_test(self, posix_acl_preset):
COM.verify_logged_in_user_correct(private_config['USERNAME'], private_config['PASSWORD'])
NAV.navigate_to_dashboard()

@allure.tag("Read")
@allure.story("Dataset Recursive Presets Permissions Using UI")
def test_verify_posix_preset_permissions_via_UI(self, posix_acl_preset):
"""
This test verifies the UI on the permissions card of the dataset that has been set with POSIX Preset Permissions.
Expand Down Expand Up @@ -80,6 +86,8 @@ def test_verify_posix_preset_permissions_via_UI(self, posix_acl_preset):
assert PERM.verify_dataset_builtin_admin_group_default_permissions_name() is True
assert PERM.verify_dataset_builtin_admin_group_default_permissions(posix_acl_preset['gba_default_perm']) is True

@allure.tag("Read")
@allure.story("Dataset Recursive Presets Permissions Using SSH")
def test_verify_posix_preset_permissions_via_SSH(self, posix_acl_preset):
"""
This test verifies that the dataset that has been set with POSIX Preset Permissions has the changes reflected via CLI.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
from keywords.ssh.common import Common_SSH as COM_SSH


@allure.tag("Datasets", "Dataset Permissions", "POSIX")
@allure.epic("Datasets")
@allure.feature("Dataset Permissions")
@pytest.mark.parametrize('posix_acl_recursive_permissions', get_data_list('dataset_permission/posix_acl_recursive_permissions'), scope='class')
class Test_POSIX_Recursive_Permissions:
@pytest.fixture(scope='class', autouse=True)
Expand Down Expand Up @@ -70,6 +73,8 @@ def teardown_test(self, posix_acl_recursive_permissions):
COM.verify_logged_in_user_correct(private_config['USERNAME'], private_config['PASSWORD'])
NAV.navigate_to_dashboard()

@allure.tag("Read")
@allure.story("Dataset Recursive Permissions Using UI")
@allure.issue('NAS-128726', 'NAS-128726')
def test_recursive_permissions_via_UI(self, posix_acl_recursive_permissions):
"""
Expand Down Expand Up @@ -132,6 +137,8 @@ def test_recursive_permissions_via_UI(self, posix_acl_recursive_permissions):
assert PERM.verify_dataset_other_default_permissions(posix_acl_recursive_permissions['other_default_perm']) is True
assert PERM.verify_dataset_permissions_edit_button() is True

@allure.tag("Read")
@allure.story("Dataset Recursive Permissions Using SSH")
def test_recursive_permissions_via_SSH(self, posix_acl_recursive_permissions):
"""
This test verifies the ability to use recursive permissions application and verifies the permissions via SSH
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import allure
import pytest

from helper.data_config import get_data_list
Expand All @@ -12,6 +13,9 @@
from keywords.ssh.permissions import Permissions_SSH as PERM_SSH


@allure.tag("Datasets", "Dataset Permissions", "UNIX")
@allure.epic("Datasets")
@allure.feature("Dataset Permissions")
@pytest.mark.parametrize('unix_perms', get_data_list('dataset_permission/unix_permissions'), scope='class')
class Test_Unix_Permissions:
@pytest.fixture(scope='function', autouse=True)
Expand Down Expand Up @@ -50,6 +54,8 @@ def teardown_test(self, unix_perms):
COM.verify_logged_in_user_correct(private_config['USERNAME'], private_config['PASSWORD'])
NAV.navigate_to_dashboard()

@allure.tag("Read")
@allure.story("Dataset Permissions UI")
def test_verify_dataset_permissions_card_ui(self, unix_perms):
"""
This test verifies the UI on the permissions card of the dataset that has been set with Unix Permissions.
Expand All @@ -66,6 +72,8 @@ def test_verify_dataset_permissions_card_ui(self, unix_perms):
assert PERM.verify_dataset_other_permissions('Read | Execute') is True
assert PERM.verify_dataset_permissions_edit_button() is True

@allure.tag("Update")
@allure.story("Edit Dataset Permissions Using UI")
def test_edit_dataset_permissions_card(self, unix_perms) -> None:
"""
This test edits the dataset via WebUI and checks that the changes display and the access level via cli is the same.
Expand Down Expand Up @@ -98,6 +106,8 @@ def test_edit_dataset_permissions_card(self, unix_perms) -> None:
PERM.verify_dataset_access(unix_perms['pool'], unix_perms['dataset'], unix_perms['groupname'], private_config['PASSWORD'], unix_perms['group_access'])
PERM.verify_dataset_access(unix_perms['pool'], unix_perms['dataset'], unix_perms['othername'], private_config['PASSWORD'], unix_perms['other_access'])

@allure.tag("Delete")
@allure.story("Delete Dataset Permissions Using UI")
def test_verify_removed_access(self, unix_perms):
"""
This test edits the dataset via WebUI and checks that the changes display and the access level via cli is the same.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def test_read_only_admin_can_not_enable_and_disable_replication_task(self, rep):
"""
assert COM.assert_toggle_is_restricted(f'enabled-replication-task-{rep["task-name"]}-row-toggle') is True
DP.click_card_page_link('Replication Tasks')
# TODO: fix this when NAS-129103 is updated
assert COM.assert_toggle_is_restricted(f'enabled-replication-task-{rep["task-name"]}-row-toggle') is True
COM.click_link('breadcrumb-data-protection')
API_PUT.set_replication_task_enabled(rep['task-name'], False)
Expand Down
2 changes: 1 addition & 1 deletion test_cases/webui/shares/nfs/test_edit_nfs_share.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,4 +329,4 @@ def test_nfsv3_share_disabled_share(self, nfs_data):
assert COMSHARE.assert_share_path('nfs', nfs_data['share_page_path']) is True
assert COMSHARE.is_share_enabled('nfs', nfs_data['share_page_path']) is False

# TODO: Add in CLI test component to ensure share cannot be used when disabled. TE-1415
# TODO: Add in CLI test component to ensure share cannot be used when disabled. TEN-902

0 comments on commit ffa2a3f

Please sign in to comment.