diff --git a/change-beta/@azure-communication-react-15e77979-730e-4c78-ab5b-71b7b5b00d23.json b/change-beta/@azure-communication-react-15e77979-730e-4c78-ab5b-71b7b5b00d23.json new file mode 100644 index 00000000000..c825c8c40a7 --- /dev/null +++ b/change-beta/@azure-communication-react-15e77979-730e-4c78-ab5b-71b7b5b00d23.json @@ -0,0 +1,9 @@ +{ + "type": "patch", + "area": "fix", + "workstream": "Hard mute", + "comment": "test", + "packageName": "@azure/communication-react", + "email": "fuyan@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change-beta/@azure-communication-react-d5042a86-7ec1-4354-8217-1a3e556a8092.json b/change-beta/@azure-communication-react-d5042a86-7ec1-4354-8217-1a3e556a8092.json new file mode 100644 index 00000000000..0c13a4add3c --- /dev/null +++ b/change-beta/@azure-communication-react-d5042a86-7ec1-4354-8217-1a3e556a8092.json @@ -0,0 +1,9 @@ +{ + "type": "patch", + "area": "fix", + "workstream": "Hard mute", + "comment": "Fix media access hermetic test", + "packageName": "@azure/communication-react", + "email": "fuyan@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@azure-communication-react-15e77979-730e-4c78-ab5b-71b7b5b00d23.json b/change/@azure-communication-react-15e77979-730e-4c78-ab5b-71b7b5b00d23.json new file mode 100644 index 00000000000..c825c8c40a7 --- /dev/null +++ b/change/@azure-communication-react-15e77979-730e-4c78-ab5b-71b7b5b00d23.json @@ -0,0 +1,9 @@ +{ + "type": "patch", + "area": "fix", + "workstream": "Hard mute", + "comment": "test", + "packageName": "@azure/communication-react", + "email": "fuyan@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/change/@azure-communication-react-d5042a86-7ec1-4354-8217-1a3e556a8092.json b/change/@azure-communication-react-d5042a86-7ec1-4354-8217-1a3e556a8092.json new file mode 100644 index 00000000000..0c13a4add3c --- /dev/null +++ b/change/@azure-communication-react-d5042a86-7ec1-4354-8217-1a3e556a8092.json @@ -0,0 +1,9 @@ +{ + "type": "patch", + "area": "fix", + "workstream": "Hard mute", + "comment": "Fix media access hermetic test", + "packageName": "@azure/communication-react", + "email": "fuyan@microsoft.com", + "dependentChangeType": "patch" +} diff --git a/packages/react-composites/tests/browser/call/hermetic/MediaAccess.test.ts b/packages/react-composites/tests/browser/call/hermetic/MediaAccess.test.ts index 609bc3c0199..751cc09f323 100644 --- a/packages/react-composites/tests/browser/call/hermetic/MediaAccess.test.ts +++ b/packages/react-composites/tests/browser/call/hermetic/MediaAccess.test.ts @@ -17,7 +17,6 @@ test.describe('Media access mic/camera forbid/permit tests', async () => { const initialState = defaultMockCallAdapterState(participants, 'Presenter', false, undefined, true); await page.goto(buildUrlWithMockAdapter(serverUrl, initialState, { newControlBarExperience: 'true' })); - await page.pause(); if (isTestProfileMobile(testInfo)) { await waitForSelector(page, dataUiId(IDS.microphoneButton)); await waitForSelector(page, dataUiId(IDS.cameraButton)); @@ -40,18 +39,12 @@ test.describe('Media access mic/camera forbid/permit tests', async () => { }, testInfo) => { const Paul = defaultMockRemoteParticipant('Paul Blurt'); const participants = [Paul]; - const initialState = defaultMockCallAdapterState(participants, 'Attendee'); - if (initialState.call?.capabilitiesFeature?.capabilities) { - initialState.call.capabilitiesFeature.capabilities.unmuteMic.isPresent = false; - initialState.call.capabilitiesFeature.capabilities.unmuteMic.reason = 'MeetingRestricted'; - initialState.call.capabilitiesFeature.capabilities.turnVideoOn.isPresent = false; - initialState.call.capabilitiesFeature.capabilities.turnVideoOn.reason = 'MeetingRestricted'; - initialState.call.state = 'Connected'; + const initialState = defaultMockCallAdapterState(participants, 'Attendee', false, undefined, undefined, true); + if (initialState.call) { initialState.call.isMuted = true; } await page.goto(buildUrlWithMockAdapter(serverUrl, initialState, { newControlBarExperience: 'true' })); - await page.pause(); if (isTestProfileMobile(testInfo)) { await waitForSelector(page, dataUiId(IDS.microphoneButton)); await waitForSelector(page, dataUiId(IDS.cameraButton)); diff --git a/packages/react-composites/tests/browser/call/hermetic/fixture.ts b/packages/react-composites/tests/browser/call/hermetic/fixture.ts index 51c9d12ab29..ed8cb21c6b8 100644 --- a/packages/react-composites/tests/browser/call/hermetic/fixture.ts +++ b/packages/react-composites/tests/browser/call/hermetic/fixture.ts @@ -15,6 +15,7 @@ import type { import type { CallKind, DominantSpeakersInfo, ParticipantRole } from '@azure/communication-calling'; import type { ParticipantCapabilities } from '@azure/communication-calling'; import { CallState, CapabilitiesFeatureState } from '@internal/calling-stateful-client'; +import { v4 as uuidv4 } from 'uuid'; const SERVER_URL = 'http://localhost'; const APP_DIR = path.join(__dirname, '../../../app/call'); @@ -56,7 +57,8 @@ export function defaultMockCallAdapterState( role?: ParticipantRole, isRoomsCall?: boolean, callEndReasonSubCode?: number, - isReactionCapability?: boolean + isReactionCapability?: boolean, + isAttendeeHardmuted?: boolean ): MockCallAdapterState { const remoteParticipants: Record = {}; participants?.forEach((p) => { @@ -72,7 +74,7 @@ export function defaultMockCallAdapterState( isLocalPreviewMicrophoneEnabled: true, page: callEndReasonSubCode ? 'leftCall' : 'call', call: { - id: 'call1', + id: `callId-${uuidv4()}`, kind: 'Call' as CallKind, callerInfo: { displayName: 'caller', identifier: { kind: 'communicationUser', communicationUserId: '1' } }, @@ -116,7 +118,7 @@ export function defaultMockCallAdapterState( maxRemoteVideoStreams: 4 }, - capabilitiesFeature: getCapabilitiesFromRole(role, isReactionCapability) + capabilitiesFeature: getCapabilitiesFromRole(role, isReactionCapability, isAttendeeHardmuted) }, endedCall: callEndReasonSubCode ? { @@ -318,7 +320,8 @@ export const stubLocalCameraName = async (page: Page): Promise => { const getCapabilitiesFromRole = ( role?: ParticipantRole, - isReactionCapability?: boolean + isReactionCapability?: boolean, + isAttendeeHardmuted?: boolean ): CapabilitiesFeatureState | undefined => { if (isReactionCapability) { return { @@ -327,6 +330,13 @@ const getCapabilitiesFromRole = ( }; } + if (isAttendeeHardmuted) { + return { + capabilities: attendeeCapabilitiesInTeamsCallHardmuted, + latestCapabilitiesChangeInfo: { oldValue: {}, newValue: {}, reason: 'RoleChanged' } + }; + } + switch (role) { case 'Attendee': return { @@ -556,6 +566,58 @@ const presenterCapabilitiesInTeamsCall: ParticipantCapabilities = { } }; +const attendeeCapabilitiesInTeamsCallHardmuted: ParticipantCapabilities = { + unmuteMic: { isPresent: false, reason: 'MeetingRestricted' }, + turnVideoOn: { isPresent: false, reason: 'MeetingRestricted' }, + addCommunicationUser: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + addPhoneNumber: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + addTeamsUser: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + blurBackground: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + hangUpForEveryOne: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + manageLobby: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + pstnDialOut: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + raiseHand: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + removeParticipant: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + removeParticipantsSpotlight: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + shareScreen: { isPresent: false, reason: 'RoleRestricted' }, + spotlightParticipant: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + startLiveCallingCaptions: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + startLiveMeetingCaptions: { + isPresent: false, + reason: 'CapabilityNotApplicableForTheCallType' + }, + muteOthers: { + isPresent: false, + reason: 'CapabilityNotApplicableForTheCallType' + }, + useReactions: { + isPresent: true, + reason: 'Capable' + }, + viewAttendeeNames: { + isPresent: true, + reason: 'Capable' + }, + setCaptionLanguage: { + isPresent: false, + reason: 'CapabilityNotApplicableForTheCallType' + }, + /* @conditional-compile-remove(calling-beta-sdk) */ + startTogetherMode: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + /* @conditional-compile-remove(breakout-rooms) */ + joinBreakoutRooms: { isPresent: false, reason: 'CapabilityNotApplicableForTheCallType' }, + /* @conditional-compile-remove(media-access) */ + forbidOthersAudio: { + isPresent: false, + reason: 'CapabilityNotApplicableForTheCallType' + }, + /* @conditional-compile-remove(media-access) */ + forbidOthersVideo: { + isPresent: false, + reason: 'CapabilityNotApplicableForTheCallType' + } +}; + const defaultEndedCallState: CallState = { id: 'call0', diff --git a/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Desktop-Chrome-linux.png b/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Desktop-Chrome-linux.png index c159107b813..c8450b03fae 100644 Binary files a/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Desktop-Chrome-linux.png and b/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Desktop-Chrome-linux.png differ diff --git a/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Desktop-Chrome-linux.png b/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Desktop-Chrome-linux.png index 5cd3a239859..148e4d9e72c 100644 Binary files a/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Desktop-Chrome-linux.png and b/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Desktop-Chrome-linux.png differ diff --git a/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Mobile-Android-Landscape-linux.png b/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Mobile-Android-Landscape-linux.png index 10ea2015cb1..65865a7d04d 100644 Binary files a/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Mobile-Android-Landscape-linux.png and b/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Mobile-Android-Landscape-linux.png differ diff --git a/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Mobile-Android-Portrait-linux.png b/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Mobile-Android-Portrait-linux.png index d5a7e450af8..ffae60cca77 100644 Binary files a/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Mobile-Android-Portrait-linux.png and b/packages/react-composites/tests/browser/snapshots/beta/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Mobile-Android-Portrait-linux.png differ diff --git a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Desktop-Chrome-linux.png b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Desktop-Chrome-linux.png index c159107b813..c8450b03fae 100644 Binary files a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Desktop-Chrome-linux.png and b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Desktop-Chrome-linux.png differ diff --git a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Mobile-Android-Landscape-linux.png b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Mobile-Android-Landscape-linux.png index 373bada089e..7e4887e660c 100644 Binary files a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Mobile-Android-Landscape-linux.png and b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Mobile-Android-Landscape-linux.png differ diff --git a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Mobile-Android-Portrait-linux.png b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Mobile-Android-Portrait-linux.png index 590b00387e4..2057fa9a606 100644 Binary files a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Mobile-Android-Portrait-linux.png and b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-Mobile-Android-Portrait-linux.png differ diff --git a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-click-more-button-Mobile-Android-Landscape-linux.png b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-click-more-button-Mobile-Android-Landscape-linux.png index 9de5b2955c3..d8644c8e915 100644 Binary files a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-click-more-button-Mobile-Android-Landscape-linux.png and b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-click-more-button-Mobile-Android-Landscape-linux.png differ diff --git a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-click-more-button-Mobile-Android-Portrait-linux.png b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-click-more-button-Mobile-Android-Portrait-linux.png index 9ad0dab915b..9fca4d2feb9 100644 Binary files a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-click-more-button-Mobile-Android-Portrait-linux.png and b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-attendee-click-more-button-Mobile-Android-Portrait-linux.png differ diff --git a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Desktop-Chrome-linux.png b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Desktop-Chrome-linux.png index 5cd3a239859..148e4d9e72c 100644 Binary files a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Desktop-Chrome-linux.png and b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Desktop-Chrome-linux.png differ diff --git a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Mobile-Android-Landscape-linux.png b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Mobile-Android-Landscape-linux.png index 10ea2015cb1..65865a7d04d 100644 Binary files a/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Mobile-Android-Landscape-linux.png and b/packages/react-composites/tests/browser/snapshots/stable/tests/browser/call/hermetic/RoomsCallScreen.test.ts-snapshots/rooms-call-screen-devices-Attendee-Mobile-Android-Landscape-linux.png differ