diff --git a/packages/react-native-sdk/src/components/Call/CallTopView/ParticipantsInfoBadge.tsx b/packages/react-native-sdk/src/components/Call/CallTopView/ParticipantsInfoBadge.tsx index 83e1316ab1..babeefe0cd 100644 --- a/packages/react-native-sdk/src/components/Call/CallTopView/ParticipantsInfoBadge.tsx +++ b/packages/react-native-sdk/src/components/Call/CallTopView/ParticipantsInfoBadge.tsx @@ -80,6 +80,7 @@ export const ParticipantsInfoBadge = ({ }, participantInfoBadge.participantCountContainer, ]} + testID={ButtonTestIds.PARTICIPANTS_COUNT_VIEW} > {count} diff --git a/packages/react-native-sdk/src/constants/TestIds.ts b/packages/react-native-sdk/src/constants/TestIds.ts index c5282a0d8d..4e3fe5ebd9 100644 --- a/packages/react-native-sdk/src/constants/TestIds.ts +++ b/packages/react-native-sdk/src/constants/TestIds.ts @@ -19,6 +19,8 @@ export enum ComponentTestIds { export enum ButtonTestIds { PARTICIPANTS_INFO = 'participants-info-button', + PARTICIPANTS_COUNT_VIEW = 'participants-count-view', + PARTICIPANTS_COUNT_TEXT = 'participants-count-text', HANG_UP_CALL = 'hang-up-call', REACTION = 'call-controls-reaction', } diff --git a/sample-apps/react-native/dogfood/e2e/js/setup.js b/sample-apps/react-native/dogfood/e2e/js/setup.js index 458af8d695..da542f06b2 100644 --- a/sample-apps/react-native/dogfood/e2e/js/setup.js +++ b/sample-apps/react-native/dogfood/e2e/js/setup.js @@ -15,27 +15,17 @@ output.pages = { chooseFlowButton: 'choose-mode', logOutButton: 'log-out', confirmSignOutButton: 'OK', + signOutModalTitle: 'Sign out as.*', }, lobby: { joinButton: 'Join', }, activeCall: { participantsInfoButton: 'participants-info-button', + participantsCount: 'participants-count-.*', hangupButton: 'hang-up-call', }, participantsInfo: { exitButton: 'exit-participants-info', }, }; -output.assertions = { - participantsInfo: { - participantsCountIs1: 'Participants (1)', - participantsCountIs6: 'Participants (6)', - }, - joinMeeting: { - signOutModalTitle: 'Sign out as.*', - }, - login: { - customUserInputField: 'Enter custom user', - }, -}; diff --git a/sample-apps/react-native/dogfood/e2e/js/sleep.js b/sample-apps/react-native/dogfood/e2e/js/sleep.js new file mode 100644 index 0000000000..01906831c3 --- /dev/null +++ b/sample-apps/react-native/dogfood/e2e/js/sleep.js @@ -0,0 +1,11 @@ +(function (sec) { + var duration = sec * 1000; + var now = new Date().getTime(); + while (new Date().getTime() < now + duration) { + /* sleep */ + } +})( + seconds !== undefined && seconds !== null && typeof seconds === 'number' + ? seconds + : 5, +); diff --git a/sample-apps/react-native/dogfood/e2e/test.yaml b/sample-apps/react-native/dogfood/e2e/test.yaml index c6f8dac272..2f535e009e 100644 --- a/sample-apps/react-native/dogfood/e2e/test.yaml +++ b/sample-apps/react-native/dogfood/e2e/test.yaml @@ -2,6 +2,11 @@ appId: io.getstream.rnvideosample --- - runScript: js/setup.js - launchApp +#- waits for ios system alert to pop up, then waits for maestro to handle it +- runScript: + file: js/sleep.js + env: + seconds: 5 #- Log in as a custom user - tapOn: ${output.pages.login.customUserInputField} - inputText: ${output.pages.login.userName} @@ -15,9 +20,11 @@ appId: io.getstream.rnvideosample #- Join the call - tapOn: ${output.pages.lobby.joinButton} #- Assert that user is alone in the call -- tapOn: - id: ${output.pages.activeCall.participantsInfoButton} -- assertVisible: ${output.assertions.participantsInfo.participantsCountIs1} +- extendedWaitUntil: + visible: + text: "1" + id: ${output.pages.activeCall.participantsCount} + timeout: 80000 #- Add 5 participants to the call via Stream Video Buddy CLI - runScript: file: js/videoBuddy.js @@ -28,10 +35,10 @@ appId: io.getstream.rnvideosample camera: true #- Assert that there are 6 participants in the call - extendedWaitUntil: - visible: ${output.assertions.participantsInfo.participantsCountIs6} + visible: + text: "6" + id: ${output.pages.activeCall.participantsCount} timeout: 80000 -- longPressOn: - id: ${output.pages.participantsInfo.exitButton} #- Leave the call - tapOn: id: ${output.pages.activeCall.hangupButton} @@ -40,7 +47,7 @@ appId: io.getstream.rnvideosample id: ${output.pages.joinMeeting.chooseFlowButton} - tapOn: id: ${output.pages.joinMeeting.logOutButton} -- assertVisible: ${output.assertions.joinMeeting.signOutModalTitle} +- assertVisible: ${output.pages.joinMeeting.signOutModalTitle} - tapOn: ${output.pages.joinMeeting.confirmSignOutButton} #- Assert that user is logged out -- assertVisible: ${output.assertions.login.customUserInputField} +- assertVisible: ${output.pages.login.customUserInputField}