diff --git a/apps/meteor/client/components/FilterByText.tsx b/apps/meteor/client/components/FilterByText.tsx index 0f317dea61e4..1aeeb29a0a57 100644 --- a/apps/meteor/client/components/FilterByText.tsx +++ b/apps/meteor/client/components/FilterByText.tsx @@ -54,6 +54,7 @@ const FilterByText = forwardRef(function Fi value={text} flexGrow={2} minWidth='x220' + aria-label={placeholder ?? t('Search')} /> {isFilterByTextPropsWithButton(props) ? ( diff --git a/apps/meteor/client/views/omnichannel/managers/AddManager.tsx b/apps/meteor/client/views/omnichannel/managers/AddManager.tsx index b4f56f78b62b..e21896eef9fa 100644 --- a/apps/meteor/client/views/omnichannel/managers/AddManager.tsx +++ b/apps/meteor/client/views/omnichannel/managers/AddManager.tsx @@ -1,5 +1,5 @@ import { Button, Box, Field, FieldLabel, FieldRow } from '@rocket.chat/fuselage'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { useMutableCallback, useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useState } from 'react'; @@ -12,6 +12,8 @@ const AddManager = ({ reload }: { reload: () => void }): ReactElement => { const [username, setUsername] = useState(''); const dispatchToastMessage = useToastMessageDispatch(); + const usernameFieldId = useUniqueId(); + const saveAction = useEndpointAction('POST', '/v1/livechat/users/manager'); const handleSave = useMutableCallback(async () => { @@ -34,9 +36,9 @@ const AddManager = ({ reload }: { reload: () => void }): ReactElement => { return ( - {t('Username')} + {t('Username')} - + diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-agents.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-agents.ts index 63818a06032a..d588e409423f 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-agents.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-agents.ts @@ -23,7 +23,7 @@ export class OmnichannelAgents { } get inputSearch(): Locator { - return this.page.locator('[placeholder="Search"]'); + return this.page.getByRole('main').getByRole('textbox', { name: 'Search' }); } get btnAdd(): Locator { diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-business-hours.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-business-hours.ts index 19e93cefb307..a77784c4538e 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-business-hours.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-business-hours.ts @@ -20,7 +20,7 @@ export class OmnichannelBusinessHours extends OmnichannelAdministration { } get inputSearch(): Locator { - return this.page.locator('[placeholder="Search"]'); + return this.page.getByRole('main').getByRole('textbox', { name: 'Search' }); } get inputName(): Locator { diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-custom-fields.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-custom-fields.ts index 9768139fe09d..e3fd6e382b9f 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-custom-fields.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-custom-fields.ts @@ -33,7 +33,7 @@ export class OmnichannelCustomFields { } get inputSearch(): Locator { - return this.page.locator('[placeholder="Search"]'); + return this.page.getByRole('main').getByRole('textbox', { name: 'Search' }); } firstRowInTable(filedName: string) { diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-departments.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-departments.ts index c1012442f115..a41332122a36 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-departments.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-departments.ts @@ -13,7 +13,7 @@ export class OmnichannelDepartments { } get inputSearch() { - return this.page.locator('[placeholder="Search"]'); + return this.page.getByRole('main').getByRole('textbox', { name: 'Search' }); } async search(text: string) { diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-manager.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-manager.ts index 0f2e9ac516e7..f52aa66fda62 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-manager.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-manager.ts @@ -13,7 +13,7 @@ export class OmnichannelManager { } private get inputSearch() { - return this.page.locator('[placeholder="Search"]'); + return this.page.getByRole('main').getByRole('textbox', { name: 'Search' }); } async search(text: string) { @@ -27,7 +27,7 @@ export class OmnichannelManager { } get inputUsername(): Locator { - return this.page.locator('input').first(); + return this.page.getByRole('main').getByLabel('Username'); } async selectUsername(username: string) { diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-monitors.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-monitors.ts index b72594024aaf..e31878842ddb 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-monitors.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-monitors.ts @@ -20,7 +20,7 @@ export class OmnichannelMonitors extends OmnichannelAdministration { } get inputSearch(): Locator { - return this.page.locator('input[placeholder="Search"]'); + return this.page.getByRole('main').getByRole('textbox', { name: 'Search' }); } findRowByName(name: string): Locator { diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-sla-policies.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-sla-policies.ts index d44d4d0f37b4..185639569d80 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-sla-policies.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-sla-policies.ts @@ -60,7 +60,7 @@ export class OmnichannelSlaPolicies { } get inputSearch() { - return this.page.locator('[placeholder="Search"]'); + return this.page.getByRole('main').getByRole('textbox', { name: 'Search' }); } headingButtonNew(name: string) { diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-tags.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-tags.ts index afb5775ba1f5..f283473505cf 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-tags.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-tags.ts @@ -24,7 +24,7 @@ export class OmnichannelTags extends OmnichannelAdministration { } get inputSearch(): Locator { - return this.page.locator('[placeholder="Search"]'); + return this.page.getByRole('main').getByRole('textbox', { name: 'Search' }); } get confirmDeleteModal(): Locator { diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-units.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-units.ts index f5d02e2150c7..abcd794f8efa 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-units.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-units.ts @@ -4,7 +4,7 @@ import { OmnichannelAdministration } from './omnichannel-administration'; export class OmnichannelUnits extends OmnichannelAdministration { get inputSearch() { - return this.page.locator('[placeholder="Search"]'); + return this.page.getByRole('main').getByRole('textbox', { name: 'Search' }); } async search(text: string) {