Skip to content

Commit c348ef8

Browse files
committed
test: Users to handle new PF6 layout
1 parent 93c3473 commit c348ef8

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

pkg/lib/cockpit-components-form-helper.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const FormHelper = ({ helperText, helperTextInvalid, variant, icon, field
4040
<FormHelperText>
4141
<HelperText>
4242
<HelperTextItem
43+
// TODO @Venefilyn: Handle screenreader for this and add translation
4344
{...fieldId && { id: fieldId + '-helper' }}
4445
variant={formHelperVariant}
4546
icon={icon}>

test/common/testlib.py

+1
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,7 @@ def open_session_menu(self) -> None:
10751075
self.wait_visible("#toggle-menu")
10761076
if (self.attr("#toggle-menu", "aria-expanded") != "true"):
10771077
self.click("#toggle-menu")
1078+
self.wait_visible("#toggle-menu-menu")
10781079

10791080
def layout_is_mobile(self) -> bool:
10801081
if not self.current_layout:

test/verify/check-users

+8-7
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def performUserAction(browser, user, action):
4242

4343
def performGroupAction(browser, group, action):
4444
browser.click(f"#groups-list tbody tr:contains({group}) button.pf-v6-c-menu-toggle")
45-
browser.click(f"#groups-list tbody tr:contains({group}) .pf-v6-c-menu__list-item:contains({action}) button")
45+
browser.click(f"body > .pf-v6-c-menu .pf-v6-c-menu__list-item:contains({action}) button")
4646

4747

4848
def createUser(
@@ -569,7 +569,7 @@ class TestAccounts(testlib.MachineCase):
569569
b.wait(lambda: not is_locked())
570570
b.wait_not_present(admin_role_sel + f" .pf-v6-c-label:contains(:{m.get_admin_group()})")
571571
b.click("#account-groups > button")
572-
b.click(admin_role_sel + f" li:contains({m.get_admin_group()}) > button")
572+
b.click(f"body .pf-v6-c-menu li:contains({m.get_admin_group()}) > button")
573573
b.wait(is_admin)
574574
b.wait_not_present("#account-groups-helper")
575575

@@ -589,7 +589,7 @@ class TestAccounts(testlib.MachineCase):
589589
b.wait_text("#account-user-name", "jussi")
590590
b.wait_visible(admin_role_sel + f" .pf-v6-c-label:contains({m.get_admin_group()})")
591591
b.wait_not_present("#account-groups-helper")
592-
b.click(f".pf-v6-c-label-group__list .pf-v6-c-label__content:contains({m.get_admin_group()}) + span > button[aria-label='Close {m.get_admin_group()}']")
592+
b.click(f".pf-v6-c-label-group__list .pf-v6-c-label:contains({m.get_admin_group()}) .pf-v6-c-label__actions button[aria-label='Close {m.get_admin_group()}']")
593593
b.wait(lambda: not is_admin())
594594
b.wait_not_present(admin_role_sel + f" .pf-v6-c-label:contains({m.get_admin_group()})")
595595
if not m.ostree_image: # User is not shown as logged in when logged in through Cockpit
@@ -1040,7 +1040,7 @@ class TestAccounts(testlib.MachineCase):
10401040
# Try an invalid date
10411041
b.set_input_text("#account-expiration-input input", "blah")
10421042
b.click("#account-expiration .pf-v6-c-modal-box__footer button:contains(Change)")
1043-
b.wait_text("#account-expiration .pf-v6-c-form__helper-text .pf-m-error", "Invalid expiration date")
1043+
b.wait_text("#account-expiration .pf-v6-c-form__helper-text .pf-m-error", "Invalid expiration date: error status;")
10441044

10451045
# Now a valid date 30 days in the future
10461046
when = datetime.datetime.now(datetime.timezone.utc) + datetime.timedelta(days=30)
@@ -1069,7 +1069,7 @@ class TestAccounts(testlib.MachineCase):
10691069
# Try an invalid number
10701070
b.set_input_text("#password-expiration-input", "-3")
10711071
b.click("#password-expiration .pf-v6-c-modal-box__footer button:contains(Change)")
1072-
b.wait_text("#password-expiration .pf-v6-c-form__helper-text .pf-m-error", "Invalid number of days")
1072+
b.wait_text("#password-expiration .pf-v6-c-form__helper-text .pf-m-error", "Invalid number of days: error status;")
10731073

10741074
# Expire password every 30 days
10751075
b.set_input_text("#password-expiration-input", "30")
@@ -1216,10 +1216,11 @@ class TestAccounts(testlib.MachineCase):
12161216
# Primary group cannot be remove but others have a remove button
12171217
b.wait_visible(".pf-v6-c-label-group__list .pf-v6-c-label__content:contains(admin)")
12181218
b.wait_not_present(".pf-v6-c-label-group__list .pf-v6-c-label__content:contains(admin) + span > button")
1219-
b.wait_visible(f".pf-v6-c-label-group__list .pf-v6-c-label__content:contains({m.get_admin_group()}) + span > button[aria-label='Close {m.get_admin_group()}']")
1219+
close_button = f".pf-v6-c-label-group__list .pf-v6-c-label:contains({m.get_admin_group()}) .pf-v6-c-label__actions button[aria-label='Close {m.get_admin_group()}']"
1220+
b.wait_visible(close_button)
12201221

12211222
# Clicking on the close button removes the group
1222-
b.click(f".pf-v6-c-label-group__list .pf-v6-c-label__content:contains({m.get_admin_group()}) + span > button[aria-label='Close {m.get_admin_group()}']")
1223+
b.click(close_button)
12231224
b.wait_not_present(f".pf-v6-c-label-group__list .pf-v6-c-label__content:contains({m.get_admin_group()})")
12241225
b.wait_not_present(".pf-v5-c-select__menu")
12251226

0 commit comments

Comments
 (0)