-
Notifications
You must be signed in to change notification settings - Fork 397
test(calling): added playwright tests for call settings #5012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: next
Are you sure you want to change the base?
Changes from 5 commits
fea1944
1609b55
e68b9a7
c3e809a
5f5ffbb
5b1228e
b41dfbd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,22 +86,24 @@ export default defineConfig({ | |
| }, | ||
|
|
||
| // Single-user registration sets (generated from USER_SETS, depend on OAuth) | ||
| ...['SET_REGISTRATION_1', 'SET_REGISTRATION_2', 'SET_REGISTRATION_3', 'SET_CONTACTS'].flatMap((key) => [ | ||
| { | ||
| name: `${key} - PROD`, | ||
| dependencies: ['OAuth - PROD'], | ||
| testDir: './playwright/suites', | ||
| testMatch: USER_SETS[key].testSuite, | ||
| use: browserOptions[PW_BROWSER], | ||
| }, | ||
| { | ||
| name: `${key} - INT`, | ||
| dependencies: ['OAuth - INT'], | ||
| testDir: './playwright/suites', | ||
| testMatch: USER_SETS[key].testSuite, | ||
| use: {...browserOptions[PW_BROWSER], testEnv: 'int'} as any, | ||
| }, | ||
| ]), | ||
| ...['SET_REGISTRATION_1', 'SET_REGISTRATION_2', 'SET_REGISTRATION_3', 'SET_CONTACTS'].flatMap( | ||
| (key) => [ | ||
| { | ||
| name: `${key} - PROD`, | ||
| dependencies: ['OAuth - PROD'], | ||
| testDir: './playwright/suites', | ||
| testMatch: USER_SETS[key].testSuite, | ||
| use: browserOptions[PW_BROWSER], | ||
| }, | ||
| { | ||
| name: `${key} - INT`, | ||
| dependencies: ['OAuth - INT'], | ||
| testDir: './playwright/suites', | ||
| testMatch: USER_SETS[key].testSuite, | ||
| use: {...browserOptions[PW_BROWSER], testEnv: 'int'} as any, | ||
| }, | ||
| ] | ||
| ), | ||
|
|
||
| // 2-user call tests (PROD uses USER_4+USER_5, parallel with registration sets) | ||
| { | ||
|
|
@@ -139,5 +141,32 @@ export default defineConfig({ | |
| testMatch: USER_SETS.SET_CALL_TRANSFER_CONSULT.testSuite, | ||
| use: {...browserOptions[PW_BROWSER], testEnv: 'int'} as any, | ||
| }, | ||
| // Single-user Call Settings tests — shares USER_1/2/3 with registration and transfer | ||
| { | ||
| name: 'SET_CALL_SETTINGS - PROD', | ||
| dependencies: [ | ||
| 'OAuth - PROD', | ||
| 'SET_REGISTRATION_1 - PROD', | ||
| 'SET_REGISTRATION_2 - PROD', | ||
| 'SET_REGISTRATION_3 - PROD', | ||
| 'SET_CALL_TRANSFER_CONSULT - PROD', | ||
| ], | ||
| testDir: './playwright/suites', | ||
| testMatch: USER_SETS.SET_CALL_SETTINGS.testSuite, | ||
| use: browserOptions[PW_BROWSER], | ||
| }, | ||
| { | ||
| name: 'SET_CALL_SETTINGS - INT', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Account isolation violation: SET_CALL_SETTINGS shares USER_1/2/3 with registration tests
This needs
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added dependencies on SET_REGISTRATION_1/2/3 and SET_CALL_TRANSFER_CONSULT for both PROD and INT so SET_CALL_SETTINGS won’t run concurrently with other suites using USER_1/2/3. |
||
| dependencies: [ | ||
| 'OAuth - INT', | ||
| 'SET_REGISTRATION_1 - INT', | ||
| 'SET_REGISTRATION_2 - INT', | ||
| 'SET_REGISTRATION_3 - INT', | ||
| 'SET_CALL_TRANSFER_CONSULT - INT', | ||
| ], | ||
| testDir: './playwright/suites', | ||
| testMatch: USER_SETS.SET_CALL_SETTINGS.testSuite, | ||
| use: {...browserOptions[PW_BROWSER], testEnv: 'int'} as any, | ||
| }, | ||
| ], | ||
| }); | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,9 +20,12 @@ export const CALLING_SELECTORS = { | |
| DESTINATION_INPUT: '#destination', | ||
| MAKE_CALL_BTN: '#create-call-action', | ||
| END_CALL_BTN: '#end-call', | ||
| /** Prefer over raw #answer — the sample app has a duplicate hidden #answer; this targets the visible incoming strip only. */ | ||
| INCOMING_ANSWER_BTN: '#incomingsection:not(.hidden) #answer', | ||
| ANSWER_BTN: '#answer', | ||
| /** | ||
| * Answer button in the incoming-call section. Starts disabled; becomes enabled when a | ||
| * line:incoming_call event fires. Use .toBeEnabled() to wait for an incoming call, | ||
| * .toBeDisabled() to assert no incoming call (e.g. call forwarded / DND active). | ||
| */ | ||
| INCOMING_ANSWER_BTN: '#incomingsection #answer', | ||
| MUTE_BTN: '#mute_button', | ||
| HOLD_BTN: '#hold_button', | ||
| DTMF_INPUT: '#dtmf_digit', | ||
|
|
@@ -52,4 +55,39 @@ export const CALLING_SELECTORS = { | |
| CALL_QUALITY_METRICS: '#call-quality-metrics', | ||
|
|
||
| END_BTN: '#end', | ||
|
|
||
| // Call Settings | ||
| FETCH_SETTINGS_BTN: '#fetch-setting', | ||
| DND_BTN: '#DND-button', | ||
| CALL_WAITING_BTN: '#CallWaiting-button', | ||
|
|
||
| // Call Forward — scoped to avoid collision with duplicate IDs in the voicemail form | ||
| CF_SAVE_BTN: '#callForwardForm #cfButton', | ||
| CF_ALWAYS_CB: '#callForwardForm #alwaysCb', | ||
| CF_ALWAYS_DEST: '#alwaysDest', | ||
| CF_BUSY_CB: '#callForwardForm #busyCb', | ||
| CF_BUSY_DEST: '#busyDest', | ||
| CF_NO_ANSWER_CB: '#notAnsweredCb', | ||
| CF_NO_ANSWER_DEST: '#notAnsweredDest', | ||
| CF_NOT_REACHABLE_CB: '#notReachableCb', | ||
| CF_NOT_REACHABLE_DEST: '#notReachableDest', | ||
| CF_DIRECTORY_NUMBER: '#directoryNumber', | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressed by removing duplicate IDs from the sample HTML and standardizing on INCOMING_ANSWER_BTN: '#incomingsection #answer'. No tag-based disambiguation needed anymore. |
||
| CF_ALWAYS_BTN: '#CallForwardAlways-button', | ||
| CF_ALWAYS_DATA: '#callforwardalways-data', | ||
|
|
||
| // CF No Answer — number of rings field | ||
| CF_NO_ANSWER_RINGS: '#notAnsweredRings', | ||
|
|
||
| // Voicemail — scoped to #voicemailForm to avoid collision with CF form IDs | ||
| VM_ENABLED_CB: '#vmCb', | ||
| VM_SAVE_BTN: '#voicemailForm #cfButton', | ||
| VM_SEND_ALL_CB: '#voicemailForm #alwaysCb', | ||
| VM_SEND_BUSY_CB: '#voicemailForm #busyCb', | ||
| VM_UNANSWERED_CB: '#voicemailForm #vmNotAnsweredCb', | ||
| VM_UNANSWERED_RINGS: '#vmNotAnsweredRings', | ||
| VM_MWI_CB: '#voicemailForm #notifCb', | ||
| VM_NOTIF_EMAIL_CB: '#voicemailForm #notifEmailCb', | ||
| VM_NOTIF_EMAIL_ID: '#notifEmailId', | ||
| VM_EMAIL_COPY_CB: '#voicemailForm #vmEmailCb', | ||
| VM_EMAIL_COPY_ID: '#vmEmailId', | ||
| }; | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| import {callSettingsTests, callSettingsCallTests} from '../test-groups/call-settings'; | ||
|
|
||
| // Account roles resolved from testInfo.project.name → USER_SETS. | ||
| // SET_CALL_SETTINGS: accounts[0] = USER_3 (settings owner), accounts[1] = USER_2 (caller). | ||
| callSettingsTests(); | ||
| callSettingsCallTests(); |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,6 +127,16 @@ export const USER_SETS: Record<string, UserSet> = { | |
| accounts: ['USER_6'], | ||
| testSuite: 'contacts.spec.ts', | ||
| }, | ||
|
|
||
| // Call Settings E2E tests: | ||
| // accounts[0] = USER_3 — settings owner / callee | ||
| // accounts[1] = USER_2 — primary caller (also used for busy-state first call) | ||
| // accounts[2] = USER_1 — second caller (places call while USER_3 is already busy) | ||
| SET_CALL_SETTINGS: { | ||
| name: 'SET_CALL_SETTINGS', | ||
| accounts: ['USER_3', 'USER_2', 'USER_1'], | ||
| testSuite: 'set-call-settings.spec.ts', | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. CRITICAL: Missing closing The SET_CALL_SETTINGS: {
name: 'SET_CALL_SETTINGS',
accounts: ['USER_3', 'USER_2', 'USER_1'],
testSuite: 'set-call-settings.spec.ts',
+ },
// Single-user Contacts supplementary service E2E tests
SET_CONTACTS: {
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done chnages applied ,rebase the branch and appiled the changes |
||
| }, | ||
| }; | ||
|
|
||
| /** | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SET_CALL_SETTINGS currently reuses USER_1/USER_2/USER_3, which are also used by SET_REGISTRATION_1/2/3. Since these projects only depend on OAuth and run in parallel, this violates the single-active-session rule in test-data and creates account-collision flakiness. Could we assign a dedicated user set to SET_CALL_SETTINGS (or add explicit project dependencies) so those sessions never overlap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SET_CALL_SETTINGS currently shares USER_1/2/3 with SET_REGISTRATION_* and SET_CALL_TRANSFER_CONSULT while only depending on OAuth, which breaks the single-active-session rule in test-data.ts. I’ll fix this in a follow-up by [adding project dependencies | assigning a dedicated user set] so those sessions never overlap.