diff --git a/apps/meteor/client/views/admin/ABAC/ABACSettingTab/__snapshots__/SettingToggle.spec.tsx.snap b/apps/meteor/client/views/admin/ABAC/ABACSettingTab/__snapshots__/SettingToggle.spec.tsx.snap
index 7c48a94fb6800..78b091fbbf32f 100644
--- a/apps/meteor/client/views/admin/ABAC/ABACSettingTab/__snapshots__/SettingToggle.spec.tsx.snap
+++ b/apps/meteor/client/views/admin/ABAC/ABACSettingTab/__snapshots__/SettingToggle.spec.tsx.snap
@@ -31,7 +31,6 @@ exports[`AbacEnabledToggle should be disabled when abac license is not installed
@@ -99,7 +97,6 @@ exports[`AbacEnabledToggle should render the setting toggle when setting exists
diff --git a/apps/meteor/client/views/admin/settings/Setting/inputs/ActionSettingInput.tsx b/apps/meteor/client/views/admin/settings/Setting/inputs/ActionSettingInput.tsx
index 53a0ac53df419..2ecfb77084a27 100644
--- a/apps/meteor/client/views/admin/settings/Setting/inputs/ActionSettingInput.tsx
+++ b/apps/meteor/client/views/admin/settings/Setting/inputs/ActionSettingInput.tsx
@@ -13,7 +13,7 @@ type ActionSettingInputProps = SettingInputProps & {
sectionChanged: boolean;
};
-function ActionSettingInput({ _id, actionText, value, hint, disabled, sectionChanged }: ActionSettingInputProps): ReactElement {
+function ActionSettingInput({ actionText, value, hint, disabled, sectionChanged }: ActionSettingInputProps): ReactElement {
const { t } = useTranslation();
const dispatchToastMessage = useToastMessageDispatch();
@@ -33,7 +33,7 @@ function ActionSettingInput({ _id, actionText, value, hint, disabled, sectionCha
return (
<>
-
+
{t(actionText)}
diff --git a/apps/meteor/client/views/admin/settings/Setting/inputs/BooleanSettingInput.tsx b/apps/meteor/client/views/admin/settings/Setting/inputs/BooleanSettingInput.tsx
index 624150b1709b6..367a8efe5aff7 100644
--- a/apps/meteor/client/views/admin/settings/Setting/inputs/BooleanSettingInput.tsx
+++ b/apps/meteor/client/views/admin/settings/Setting/inputs/BooleanSettingInput.tsx
@@ -30,14 +30,8 @@ function BooleanSettingInput({
{label}
- {hasResetButton && }
-
+ {hasResetButton && }
+
{hint && {hint} }
diff --git a/apps/meteor/client/views/admin/settings/Setting/inputs/CodeSettingInput.tsx b/apps/meteor/client/views/admin/settings/Setting/inputs/CodeSettingInput.tsx
index 4302ad165000e..bed4565cf80aa 100644
--- a/apps/meteor/client/views/admin/settings/Setting/inputs/CodeSettingInput.tsx
+++ b/apps/meteor/client/views/admin/settings/Setting/inputs/CodeSettingInput.tsx
@@ -38,12 +38,11 @@ function CodeSettingInput({
{label}
- {hasResetButton && }
+ {hasResetButton && }
{hint && {hint} }
{label}
- {hasResetButton && }
+ {hasResetButton && }
@@ -61,7 +61,6 @@ function ColorSettingInput({
{editor === 'color' && (
{label}
- {hasResetButton && }
+ {hasResetButton && }
{label}
- {hasResetButton && }
+ {hasResetButton && }
{label}
- {hasResetButton && }
+ {hasResetButton && }
{label}
- {hasResetButton && }
+ {hasResetButton && }
{label}
- {hasResetButton && }
+ {hasResetButton && }
{label}
- {hasResetButton && }
+ {hasResetButton && }
[key, t(i18nLabel)])}
+ aria-label={_id} // FIXME: Multiselect (fuselage) should be associating the FieldLabel automatically. This is a workaround for accessibility and test locators.
/>
{hint && {hint} }
diff --git a/apps/meteor/client/views/admin/settings/Setting/inputs/PasswordSettingInput.tsx b/apps/meteor/client/views/admin/settings/Setting/inputs/PasswordSettingInput.tsx
index 70e9d69cefed1..41be622361672 100644
--- a/apps/meteor/client/views/admin/settings/Setting/inputs/PasswordSettingInput.tsx
+++ b/apps/meteor/client/views/admin/settings/Setting/inputs/PasswordSettingInput.tsx
@@ -30,11 +30,10 @@ function PasswordSettingInput({
{label}
- {hasResetButton && }
+ {hasResetButton && }
{label}
- {hasResetButton && }
+ {hasResetButton && }
{hint && (
@@ -39,7 +39,6 @@ function RangeSettingInput({
)}
{label}
- {hasResetButton && }
+ {hasResetButton && }
{label}
- {hasResetButton && }
+ {hasResetButton && }
{label}
- {hasResetButton && }
+ {hasResetButton && }
{label}
- {hasResetButton && }
+ {hasResetButton && }
{label}
- {hasResetButton && }
+ {hasResetButton && }
{multiline ? (
) : (
{label}
- {hasResetButton && }
+ {hasResetButton && }
diff --git a/apps/meteor/tests/e2e/page-objects/admin-settings.ts b/apps/meteor/tests/e2e/page-objects/admin-settings.ts
index 2c6e3e6d2f765..7750666129d39 100644
--- a/apps/meteor/tests/e2e/page-objects/admin-settings.ts
+++ b/apps/meteor/tests/e2e/page-objects/admin-settings.ts
@@ -12,7 +12,7 @@ export class AdminSettings extends Admin {
}
get inputSiteURL(): Locator {
- return this.page.locator('[data-qa-setting-id="Site_Url"]');
+ return this.page.getByRole('textbox', { name: 'Site URL' });
}
get btnResetSiteURL(): Locator {
diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-settings.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-settings.ts
index c853fb43a1018..952959fda2cac 100644
--- a/apps/meteor/tests/e2e/page-objects/omnichannel-settings.ts
+++ b/apps/meteor/tests/e2e/page-objects/omnichannel-settings.ts
@@ -28,7 +28,7 @@ export class OmnichannelSettings {
}
get labelHideWatermark(): Locator {
- return this.page.locator('label', { has: this.page.locator('[data-qa-setting-id="Livechat_hide_watermark"]') });
+ return this.page.locator('label').getByText('Hide "powered by Rocket.Chat"');
}
get btnSave(): Locator {
diff --git a/apps/meteor/tests/e2e/settings-persistence-on-ui-navigation.spec.ts b/apps/meteor/tests/e2e/settings-persistence-on-ui-navigation.spec.ts
index a3b1daebcd49c..741a9159bd83a 100644
--- a/apps/meteor/tests/e2e/settings-persistence-on-ui-navigation.spec.ts
+++ b/apps/meteor/tests/e2e/settings-persistence-on-ui-navigation.spec.ts
@@ -26,7 +26,8 @@ test.describe.serial('settings-persistence-on-ui-navigation', () => {
test.afterAll(({ api }) => setSettingValueById(api, 'Hide_System_Messages', []));
test.skip('expect settings to persist in ui when navigating back and forth', async ({ page }) => {
- const settingInput = page.locator('[data-qa-setting-id="Hide_System_Messages"] input');
+ const settingInput = page.getByLabel('Hide_System_Messages').getByRole('textbox');
+
await settingInput.pressSequentially('User joined');
await settingInput.press('Enter');
@@ -34,13 +35,13 @@ test.describe.serial('settings-persistence-on-ui-navigation', () => {
(response) => response.url().includes('/api/v1/method.call/saveSettings') && response.status() === 200,
);
- await page.locator('button:has-text("Save changes")').click();
- await page.locator('button[title="Back"]').click();
+ await page.getByRole('button', { name: 'Save changes' }).click();
+ await page.getByRole('button', { name: 'Back' }).click();
await responsePromise;
await page.locator('a[href="/admin/settings/Message"] >> text=Open').click();
- await expect(page.locator('label[for="Hide_System_Messages"][title="Hide_System_Messages"]')).toBeVisible();
+ await expect(page.getByLabel('Hide_System_Messages').getByRole('option', { name: 'User joined' })).toBeVisible();
});
});