Skip to content

Commit 5857ef3

Browse files
committed
test: Fix check-pages
1 parent 5f4b907 commit 5857ef3

File tree

2 files changed

+21
-21
lines changed

2 files changed

+21
-21
lines changed

test/common/testlib.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -754,9 +754,9 @@ def set_input_text(
754754
def set_file_autocomplete_val(self, group_identifier: str, location: str) -> None:
755755
self.set_input_text(f"{group_identifier} .pf-v6-c-menu-toggle input", location)
756756
# select the file
757-
self.wait_text(f"{group_identifier} ul li:nth-child(1) button", location)
758-
self.click(f"{group_identifier} ul li:nth-child(1) button")
759-
self.wait_not_present(f"{group_identifier} .pf-v6-c-menu")
757+
self.wait_text(".pf-v6-c-menu ul li:nth-child(1) button", location)
758+
self.click(".pf-v6-c-menu ul li:nth-child(1) button")
759+
self.wait_not_present(".pf-v6-c-menu")
760760
self.wait_val(f"{group_identifier} .pf-v6-c-menu-toggle input", location)
761761

762762
@contextlib.contextmanager

test/verify/check-pages

+18-18
Original file line numberDiff line numberDiff line change
@@ -600,39 +600,39 @@ OnCalendar=daily
600600
b.focus("#demo-file-ac input[type=text]")
601601
b.input_text(stuff + "/")
602602
# need to wait for the widget's "fast typing" inhibition delay to trigger the completion popup
603-
b.wait_in_text("#demo-file-ac li:nth-of-type(1) button", stuff + "/")
604-
b.wait_in_text("#demo-file-ac li:nth-of-type(2) button", "dir/")
605-
b.wait_in_text("#demo-file-ac li:nth-of-type(3) button", "dir1/")
606-
b.wait_in_text("#demo-file-ac li:nth-of-type(4) button", "file1.txt")
607-
b.click("#demo-file-ac li:nth-of-type(2) button")
603+
b.wait_in_text(".pf-v6-c-menu li:nth-of-type(1) button", stuff + "/")
604+
b.wait_in_text(".pf-v6-c-menu li:nth-of-type(2) button", "dir/")
605+
b.wait_in_text(".pf-v6-c-menu li:nth-of-type(3) button", "dir1/")
606+
b.wait_in_text(".pf-v6-c-menu li:nth-of-type(4) button", "file1.txt")
607+
b.click(".pf-v6-c-menu li:nth-of-type(2) button")
608608

609609
# clear the file completion widget
610610
b.click("#demo-file-ac div:first-of-type div:first-of-type button:nth-of-type(1)")
611611
# test if input matches one entry, but is the prefix of other entry, widget should not descend into directory
612612
b.focus("#demo-file-ac input[type=text]")
613613
b.input_text(stuff + "/dir")
614-
b.wait_in_text("#demo-file-ac li:nth-of-type(1) button", stuff + "/dir")
615-
b.wait_in_text("#demo-file-ac li:nth-of-type(2) button", stuff + "/dir1")
614+
b.wait_in_text(".pf-v6-c-menu li:nth-of-type(1) button", stuff + "/dir")
615+
b.wait_in_text(".pf-v6-c-menu li:nth-of-type(2) button", stuff + "/dir1")
616616

617617
# clear the file completion widget
618618
b.click("#demo-file-ac div:first-of-type div:first-of-type button:nth-of-type(1)")
619619
b.focus("#demo-file-ac input[type=text]")
620620
b.input_text(stuff + "/")
621-
b.wait_in_text("#demo-file-ac li:nth-of-type(1) button", stuff + "/")
622-
b.wait_in_text("#demo-file-ac li:nth-of-type(4) button", "file1.txt")
623-
b.click("#demo-file-ac li:nth-of-type(4) button")
624-
b.wait_not_present("#demo-file-ac li")
621+
b.wait_in_text(".pf-v6-c-menu li:nth-of-type(1) button", stuff + "/")
622+
b.wait_in_text(".pf-v6-c-menu li:nth-of-type(4) button", "file1.txt")
623+
b.click(".pf-v6-c-menu li:nth-of-type(4) button")
624+
b.wait_not_present(".pf-v6-c-menu")
625625

626626
# now update file1, check robustness with dynamic events
627627
m.execute(f"touch {stuff}/file1.txt")
628628
b.focus("#demo-file-ac input[type=text]")
629629
time.sleep(1)
630630
b.key("Backspace", 5)
631631
# input is now $stuff/file
632-
b.wait_in_text("#demo-file-ac li:nth-of-type(1) button", "file1.txt")
632+
b.wait_in_text(".pf-v6-c-menu li:nth-of-type(1) button", "file1.txt")
633633
b.key("Backspace", 4)
634634
# input is now $stuff/, so all listings should be available
635-
b.wait_in_text("#demo-file-ac li:nth-of-type(4) button", "file1.txt")
635+
b.wait_in_text(".pf-v6-c-menu li:nth-of-type(4) button", "file1.txt")
636636

637637
# add new file
638638
m.execute(f"touch {stuff}/other")
@@ -644,10 +644,10 @@ OnCalendar=daily
644644
b.key("Backspace", 6)
645645
time.sleep(1)
646646
b.input_text("stuff/")
647-
b.wait_in_text("#demo-file-ac li:nth-of-type(5) button", "other")
647+
b.wait_in_text(".pf-v6-c-menu li:nth-of-type(5) button", "other")
648648
# close the selector
649649
b.click("#demo-file-ac input")
650-
b.wait_not_present("#demo-file-ac li")
650+
b.wait_not_present(".pf-v6-c-menu")
651651

652652
# Create test folder with known files
653653
m.execute("mkdir /home/admin/newdir")
@@ -659,15 +659,15 @@ OnCalendar=daily
659659
b.wait_val("#demo-file-ac-preselected input", "/home/admin/newdir/file1")
660660
# open the selector
661661
b.click("#demo-file-ac-preselected input")
662-
b.wait_visible("#demo-file-ac-preselected .pf-v6-c-menu")
662+
b.wait_visible(".pf-v6-c-menu")
663663
# close and open again to reload the dir (which just got created)
664664
b.click("#demo-file-ac-preselected .pf-v6-c-menu-toggle__button")
665-
b.wait_not_present("#demo-file-ac-preselected .pf-v6-c-menu")
665+
b.wait_not_present(".pf-v6-c-menu")
666666
b.click("#demo-file-ac-preselected input")
667667
# selection has all the files in the directory
668668
paths = ["/home/admin/newdir", "/home/admin/newdir/dir1", "/home/admin/newdir/dir2", "/home/admin/newdir/file1", "/home/admin/newdir/file2"]
669669
for i in range(5):
670-
b.wait_in_text(f"#demo-file-ac-preselected li:nth-of-type({i + 1}) button", paths[i])
670+
b.wait_in_text(f".pf-v6-c-menu li:nth-of-type({i + 1}) button", paths[i])
671671

672672
@testlib.skipOstree("No PCP available")
673673
@testlib.skipImage("pcp not currently in testing", "debian-testing")

0 commit comments

Comments
 (0)