Skip to content

Commit 3ba964f

Browse files
committed
Rename various classes in tests
1 parent 8d073c6 commit 3ba964f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+704
-704
lines changed

pkg/systemd/overview-cards/usageCard.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ export class UsageCard extends React.Component {
135135
<Progress value={this.state.cpuUsed}
136136
className="pf-m-sm"
137137
min={0} max={100}
138-
variant={ this.state.cpuUsed > 90 ? ProgressVariant.danger : null }
138+
variant={ this.state.cpuUsed > 90 ? ProgressVariant.danger : undefined }
139139
label={ this.state.cpuUsed + '% ' + cores_str }
140140
aria-labelledby="system-usage-cpu-progress"
141141
measureLocation={ProgressMeasureLocation.outside} />

test/common/storagelib.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -145,12 +145,12 @@ def dialog_wait_open(self):
145145

146146
def dialog_wait_alert(self, text1, text2=None):
147147
def has_alert_title():
148-
t = self.browser.text('#dialog .pf-v5-c-alert__title')
148+
t = self.browser.text('#dialog .pf-v6-c-alert__title')
149149
return text1 in t or (text2 is not None and text2 in t)
150150
self.browser.wait(has_alert_title)
151151

152152
def dialog_wait_title(self, text):
153-
self.browser.wait_in_text('#dialog .pf-v5-c-modal-box__title', text)
153+
self.browser.wait_in_text('#dialog .pf-v6-c-modal-box__title', text)
154154

155155
def dialog_field(self, field):
156156
return f'#dialog [data-field="{field}"]'
@@ -193,8 +193,8 @@ def dialog_set_val(self, field, val):
193193
self.browser.set_checked(sel + " input[type=checkbox]", val=True)
194194
self.browser.set_input_text(sel + " [type=text]", val)
195195
elif ftype == "combobox":
196-
self.browser.click(sel + " button.pf-v5-c-menu-toggle__button")
197-
self.browser.click(sel + f" .pf-v5-c-menu li:contains('{val}') button")
196+
self.browser.click(sel + " button.pf-v6-c-menu-toggle__button")
197+
self.browser.click(sel + f" .pf-v6-c-menu li:contains('{val}') button")
198198
else:
199199
self.browser.set_val(sel, val)
200200

@@ -228,7 +228,7 @@ def dialog_wait_val(self, field, val, unit=None):
228228

229229
def dialog_wait_error(self, field, val):
230230
# XXX - allow for more than one error
231-
self.browser.wait_in_text('#dialog .pf-v5-c-form__helper-text .pf-m-error', val)
231+
self.browser.wait_in_text('#dialog .pf-v6-c-form__helper-text .pf-m-error', val)
232232

233233
def dialog_wait_not_present(self, field):
234234
self.browser.wait_not_present(self.dialog_field(field))
@@ -367,7 +367,7 @@ def doit():
367367
self.dialog_wait_close()
368368
return True
369369
except Exception:
370-
dialog_text = self.browser.text('#dialog .pf-v5-c-alert__title')
370+
dialog_text = self.browser.text('#dialog .pf-v6-c-alert__title')
371371
for err in errors:
372372
if err in dialog_text:
373373
print("WARNING: retrying dialog")
@@ -583,10 +583,10 @@ def card(self, title):
583583
return f"[data-test-card-title='{title}']"
584584

585585
def card_parent_link(self):
586-
return ".pf-v5-c-breadcrumb__item:nth-last-child(2) > a"
586+
return ".pf-v6-c-breadcrumb__item:nth-last-child(2) > a"
587587

588588
def card_header(self, title):
589-
return self.card(title) + " .pf-v5-c-card__header"
589+
return self.card(title) + " .pf-v6-c-card__header"
590590

591591
def card_row(self, title, index=None, name=None, location=None):
592592
if index is not None:
@@ -614,17 +614,17 @@ def card_button(self, card_title, button_title):
614614
return self.card(card_title) + f" button:contains('{button_title}')"
615615

616616
def dropdown_toggle(self, parent):
617-
return parent + " .pf-v5-c-menu-toggle"
617+
return parent + " .pf-v6-c-menu-toggle"
618618

619619
def dropdown_action(self, parent, title):
620-
return parent + f" .pf-v5-c-menu button:contains('{title}')"
620+
return parent + f" .pf-v6-c-menu button:contains('{title}')"
621621

622622
def dropdown_description(self, parent, title):
623-
return parent + f" .pf-v5-c-menu button:contains('{title}') .pf-v5-c-menu__item-description"
623+
return parent + f" .pf-v6-c-menu button:contains('{title}') .pf-v6-c-menu__item-description"
624624

625625
def click_dropdown(self, parent, title):
626626
self.browser.click(self.dropdown_toggle(parent))
627-
self.browser.click(self.dropdown_action(parent, title))
627+
self.browser.click(self.dropdown_action("", title))
628628

629629
def click_card_dropdown(self, card_title, button_title):
630630
self.click_dropdown(self.card_header(card_title), button_title)

test/common/testlib.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ def select_from_dropdown(self, selector: str, value: object) -> None:
722722
self.set_val(selector, value)
723723
self.wait_val(selector, value)
724724

725-
def select_PF(self, selector: str, value: str, menu_class: str = ".pf-v5-c-menu") -> None:
725+
def select_PF(self, selector: str, value: str, menu_class: str = ".pf-v6-c-menu") -> None:
726726
"""For a PatternFly Select-like component
727727
728728
For things like <Select> or <TimePicker>. Unfortunately none of them render as an actual <select>, but a
@@ -752,12 +752,12 @@ def set_input_text(
752752
self.wait_val(selector, val)
753753

754754
def set_file_autocomplete_val(self, group_identifier: str, location: str) -> None:
755-
self.set_input_text(f"{group_identifier} .pf-v5-c-menu-toggle input", location)
755+
self.set_input_text(f"{group_identifier} .pf-v6-c-menu-toggle input", location)
756756
# select the file
757757
self.wait_text(f"{group_identifier} ul li:nth-child(1) button", location)
758758
self.click(f"{group_identifier} ul li:nth-child(1) button")
759-
self.wait_not_present(f"{group_identifier} .pf-v5-c-menu")
760-
self.wait_val(f"{group_identifier} .pf-v5-c-menu-toggle input", location)
759+
self.wait_not_present(f"{group_identifier} .pf-v6-c-menu")
760+
self.wait_val(f"{group_identifier} .pf-v6-c-menu-toggle input", location)
761761

762762
@contextlib.contextmanager
763763
def wait_timeout(self, timeout: int) -> Iterator[None]:
@@ -1112,9 +1112,9 @@ def become_superuser(
11121112

11131113
if passwordless:
11141114
self.wait_in_text("div[role=dialog]", "Administrative access")
1115-
self.wait_in_text("div[role=dialog] .pf-v5-c-modal-box__body", "You now have administrative access.")
1115+
self.wait_in_text("div[role=dialog] .pf-v6-c-modal-box__body", "You now have administrative access.")
11161116
# there should be only one ("Close") button
1117-
self.click("div[role=dialog] .pf-v5-c-modal-box__footer button")
1117+
self.click("div[role=dialog] .pf-v6-c-modal-box__footer button")
11181118
else:
11191119
self.wait_in_text("div[role=dialog]", "Switch to administrative access")
11201120
self.wait_in_text("div[role=dialog]", f"Password for {user}:")
@@ -1148,7 +1148,7 @@ def click_system_menu(self, path: str, enter: bool = True) -> None:
11481148

11491149
def get_pf_progress_value(self, progress_bar_sel: str) -> int:
11501150
"""Get numeric value of a PatternFly <ProgressBar> component"""
1151-
sel = progress_bar_sel + " .pf-v5-c-progress__indicator"
1151+
sel = progress_bar_sel + " .pf-v6-c-progress__indicator"
11521152
self.wait_visible(sel)
11531153
self.wait_attr_contains(sel, "style", "width:")
11541154
style = self.attr(sel, "style")
@@ -1517,7 +1517,7 @@ def assert_pixels(
15171517
if not self.is_present("#shell-page") and not self.is_present("#login-details") and not self.is_present("#system-terminal-page"):
15181518
classes = self.attr("main", "class")
15191519
if "pf-v5-c-page__main" in classes:
1520-
self.set_attr("main.pf-v5-c-page__main", "class", f"{classes} pixel-test")
1520+
self.set_attr("main.pf-v6-c-page__main", "class", f"{classes} pixel-test")
15211521

15221522
# move the mouse to a harmless place where it doesn't accidentally focus anything (as that changes UI)
15231523
self.bidi("input.performActions", context=self.driver.context, actions=[{

test/verify/check-apps

+22-22
Original file line numberDiff line numberDiff line change
@@ -103,28 +103,28 @@ class TestApps(packagelib.PackageCase):
103103
m.write("/etc/cockpit/cockpit.conf", f"[WebService]\nUrlRoot={urlroot}")
104104

105105
self.login_and_go("/apps", urlroot=urlroot)
106-
b.wait_in_text(".pf-v5-c-empty-state", "No applications installed or available")
107-
b.wait_in_text(".pf-v5-c-empty-state", "Application information is missing")
106+
b.wait_in_text(".pf-v6-c-empty-state", "No applications installed or available")
107+
b.wait_in_text(".pf-v6-c-empty-state", "Application information is missing")
108108

109109
# still no metadata, but already installed application
110110
self.createAppStreamPackage("already", "1.0", "1", install=True)
111-
b.wait_not_present(".pf-v5-c-empty-state")
111+
b.wait_not_present(".pf-v6-c-empty-state")
112112
b.wait_visible(".app-list .pf-v5-c-data-list__item-row:contains('already') button:contains('Remove')")
113-
b.wait_in_text(".pf-v5-c-alert", "Application information is missing")
113+
b.wait_in_text(".pf-v6-c-alert", "Application information is missing")
114114

115115
self.createAppStreamPackage("app-1", "1.0", "1")
116116
self.createAppStreamRepoPackage()
117117

118118
# Install package metadata
119-
b.click(".pf-v5-c-alert button")
119+
b.click(".pf-v6-c-alert button")
120120

121121
with b.wait_timeout(30):
122-
b.wait_not_present(".pf-v5-c-alert")
122+
b.wait_not_present(".pf-v6-c-alert")
123123
b.click(".app-list #app-1")
124124

125125
b.wait_visible('a[href="https://app-1.com"]')
126126
b.wait_visible(f'#app-page img[src^="{urlroot}/cockpit/channel/"]')
127-
b.click(".pf-v5-c-breadcrumb a:contains('Applications')")
127+
b.click(".pf-v6-c-breadcrumb a:contains('Applications')")
128128

129129
b.wait_visible("#list-page")
130130
b.wait_not_present("#app-page")
@@ -169,7 +169,7 @@ class TestApps(packagelib.PackageCase):
169169
self.createAppStreamRepoPackage(subdir="app-info/xmls")
170170

171171
self.login_and_go("/apps")
172-
b.wait_visible(".pf-v5-c-empty-state")
172+
b.wait_visible(".pf-v6-c-empty-state")
173173

174174
# os-release is a symlink target, don't clobber that
175175
self.restore_file("/etc/os-release")
@@ -180,21 +180,21 @@ class TestApps(packagelib.PackageCase):
180180
# the progress bar is too fast to reliably catch it
181181
time.sleep(1)
182182
b.wait_not_present("#refresh-progress")
183-
b.wait_visible(".pf-v5-c-empty-state")
183+
b.wait_visible(".pf-v6-c-empty-state")
184184
# wait until check for installed metadata package finished
185185
b.wait_attr("#list-page", "data-packages-checked", "true")
186186
# no appstream metadata available, don't advertise it
187-
b.wait_in_text(".pf-v5-c-empty-state", "No applications installed or available")
188-
self.assertNotIn("Install application information", b.text(".pf-v5-c-empty-state"))
189-
b.wait_not_present(".pf-v5-c-empty-state button")
187+
b.wait_in_text(".pf-v6-c-empty-state", "No applications installed or available")
188+
self.assertNotIn("Install application information", b.text(".pf-v6-c-empty-state"))
189+
b.wait_not_present(".pf-v6-c-empty-state button")
190190

191191
# unknown OS: nothing gets installed
192192
m.write("/etc/os-release", 'ID="unmapped"\nID_LIKE="mysterious"\nVERSION_ID="1"\n')
193193
b.click("#refresh")
194194
# the progress bar is too fast to reliably catch it
195195
time.sleep(1)
196196
b.wait_not_present("#refresh-progress")
197-
b.wait_visible(".pf-v5-c-empty-state")
197+
b.wait_visible(".pf-v6-c-empty-state")
198198

199199
# known OS: appstream-data-test gets installed from the map
200200
m.write("/etc/os-release", 'ID="derivative"\nID_LIKE="spicy testy"\nVERSION_ID="1"\n')
@@ -215,7 +215,7 @@ class TestApps(packagelib.PackageCase):
215215
self.addCleanup(m.execute, "for d in /usr/share/metainfo /usr/share/app-info /var/cache/app-info; do umount $d; done")
216216

217217
self.login_and_go("/apps")
218-
b.wait_visible(".pf-v5-c-empty-state")
218+
b.wait_visible(".pf-v6-c-empty-state")
219219

220220
m.write("/usr/share/app-info/xmls/test.xml", """
221221
<components origin="test">
@@ -273,7 +273,7 @@ class TestApps(packagelib.PackageCase):
273273
appstream_folder = "/usr/share/app-info/xmls"
274274

275275
self.login_and_go("/apps")
276-
b.wait_visible(".pf-v5-c-empty-state")
276+
b.wait_visible(".pf-v6-c-empty-state")
277277

278278
self.allow_journal_messages(".*/usr/share/app-info/xmls/test.xml.*",
279279
".*xml.etree.ElementTree.ParseError.*")
@@ -293,7 +293,7 @@ class TestApps(packagelib.PackageCase):
293293
<pkgname>foo</pkgname>
294294
</component>
295295
</components>""")
296-
b.wait_not_present(".pf-v5-c-empty-state")
296+
b.wait_not_present(".pf-v6-c-empty-state")
297297
b.wait_visible(".app-list .pf-v5-c-data-list__item-row:contains('Summary')")
298298

299299
# First lay down some good XML so that we can later detect the reaction to broken XML.
@@ -303,14 +303,14 @@ class TestApps(packagelib.PackageCase):
303303
m.write(f"{appstream_folder}/test.xml", """
304304
This <is <not XML.
305305
""")
306-
b.wait_visible(".pf-v5-c-empty-state")
306+
b.wait_visible(".pf-v6-c-empty-state")
307307
reset()
308308

309309
# Not really AppStream
310310
m.write(f"{appstream_folder}/test.xml", """
311311
<foo></foo>
312312
""")
313-
b.wait_visible(".pf-v5-c-empty-state")
313+
b.wait_visible(".pf-v6-c-empty-state")
314314
reset()
315315

316316
# No origin
@@ -328,7 +328,7 @@ This <is <not XML.
328328
<pkgname>foo</pkgname>
329329
</component>
330330
</components>""")
331-
b.wait_visible(".pf-v5-c-empty-state")
331+
b.wait_visible(".pf-v6-c-empty-state")
332332
reset()
333333

334334
# No package
@@ -345,7 +345,7 @@ This <is <not XML.
345345
<launchable type="cockpit-manifest">foo</launchable>
346346
</component>
347347
</components>""")
348-
b.wait_visible(".pf-v5-c-empty-state")
348+
b.wait_visible(".pf-v6-c-empty-state")
349349
reset()
350350

351351
# No id
@@ -359,7 +359,7 @@ This <is <not XML.
359359
<pkgname>foo</pkgname>
360360
</component>
361361
</components>""")
362-
b.wait_visible(".pf-v5-c-empty-state")
362+
b.wait_visible(".pf-v6-c-empty-state")
363363
reset()
364364

365365
# Error (launchable without type) in earlier entry, shouldn't affect the later entry
@@ -388,7 +388,7 @@ This <is <not XML.
388388
<pkgname>foo</pkgname>
389389
</component>
390390
</components>""")
391-
b.wait_not_present(".pf-v5-c-empty-state")
391+
b.wait_not_present(".pf-v6-c-empty-state")
392392
b.wait_visible(".app-list .pf-v5-c-data-list__item-row:contains('Summary 2')")
393393

394394
def testNoPackageKit(self):

test/verify/check-client

+9-9
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ exec "$@"
142142
# python3-pcp is installed on client, but not on target; recognize that
143143
b.go("/metrics")
144144
b.enter_page("/metrics")
145-
b.wait_in_text(".pf-v5-c-empty-state", "PCP is missing")
145+
b.wait_in_text(".pf-v6-c-empty-state", "PCP is missing")
146146
# on-demand install is allowed
147-
b.wait_in_text(".pf-v5-c-empty-state button.pf-m-primary", "Install PCP support")
148-
b.click(".pf-v5-c-empty-state button.pf-m-primary")
149-
b.wait_in_text(".pf-v5-c-modal-box", "pcp will be installed")
150-
b.click(".pf-v5-c-modal-box button.cancel")
147+
b.wait_in_text(".pf-v6-c-empty-state button.pf-m-primary", "Install PCP support")
148+
b.click(".pf-v6-c-empty-state button.pf-m-primary")
149+
b.wait_in_text(".pf-v6-c-modal-box", "pcp will be installed")
150+
b.click(".pf-v6-c-modal-box button.cancel")
151151

152152
b.drop_superuser()
153153
self.logout()
@@ -181,10 +181,10 @@ exec "$@"
181181

182182
# not a sudoer
183183
b.open_superuser_dialog()
184-
b.set_input_text(".pf-v5-c-modal-box:contains('Switch to administrative access') input", "barfoo")
185-
b.click(".pf-v5-c-modal-box button:contains('Authenticate')")
186-
b.click(".pf-v5-c-modal-box:contains('Problem becoming administrator') button:contains('Close')")
187-
b.wait_not_present(".pf-v5-c-modal-box")
184+
b.set_input_text(".pf-v6-c-modal-box:contains('Switch to administrative access') input", "barfoo")
185+
b.click(".pf-v6-c-modal-box button:contains('Authenticate')")
186+
b.click(".pf-v6-c-modal-box:contains('Problem becoming administrator') button:contains('Close')")
187+
b.wait_not_present(".pf-v6-c-modal-box")
188188
b.check_superuser_indicator("Limited access")
189189

190190
self.logout()

test/verify/check-connection

+3-3
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ class TestConnection(testlib.MachineCase):
144144
b.wait_visible(".curtains-ct")
145145

146146
b.wait_in_text(".curtains-ct h1", "Disconnected")
147-
b.wait_in_text('.curtains-ct .pf-v5-c-empty-state__body', "Connection has timed out.")
147+
b.wait_in_text('.curtains-ct .pf-v6-c-empty-state__body', "Connection has timed out.")
148148
finally:
149149
m.execute("nft delete table ip cockpittest")
150150

@@ -1056,7 +1056,7 @@ until pgrep -f '^(/usr/[^ ]+/[^ /]*python[^ /]* )?/usr/bin/cockpit-bridge'; do s
10561056
b.set_val("#login-password-input", "foobar")
10571057
b.click('#login-button')
10581058

1059-
b.wait_text(".early-failure .pf-v5-c-empty-state__title", "Connection failed")
1059+
b.wait_text(".early-failure .pf-v6-c-empty-state__title", "Connection failed")
10601060
b.wait_in_text(".early-failure ", "unexpected error while connecting to the machine")
10611061

10621062
testlib.wait(lambda: m.execute("grep 'received request from bad Origin' /var/log/ws-notls.log"))
@@ -1451,7 +1451,7 @@ server {
14511451
b.set_val("#login-user-input", "admin")
14521452
b.set_val("#login-password-input", "foobar")
14531453
b.click('#login-button')
1454-
b.wait_visible('.pf-v5-c-card.system-health')
1454+
b.wait_visible('.pf-v6-c-card.system-health')
14551455

14561456
@testlib.skipImage("nginx not installed", "centos-*", "rhel-*", "debian-*", "ubuntu-*", "arch")
14571457
@testlib.skipOstree("nginx not installed")

0 commit comments

Comments
 (0)