Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/samples/calling.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/samples/calling.min.js.map

Large diffs are not rendered by default.

13 changes: 3 additions & 10 deletions docs/samples/calling/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ <h2 class="collapsible">Call initialization</h2>
class="btn-code">getMediaStreams()</button>
</div>
<div class="u-mv">
<button id="bnr-button" type="button" onclick="toggleNoiseReductionEffect()"
<button id="bnr-button" type="button" onclick="toggleNoiseReductionEffect()"
class="btn-code">Enable BNR</button>
</div>
</fieldset>
Expand Down Expand Up @@ -293,14 +293,7 @@ <h3 style="color: #1a73e8; margin-bottom: 0.25rem;">Call Transfer</h3>
</div>
</fieldset>

<!-- calling / incoming -->
<fieldset id="incomingsection" class="hidden">
<legend>Incoming Call</legend>
<div class="u-mv">
<button onclick="answer(this)" id="answer" class="btn--green">Answer</button>
<button onclick="reject(this)" id="reject" class="btn--red">Reject</button>
</div>
</fieldset>

<!-- Call history section -->
<fieldset id="callHistorysection">
<legend>Call History</legend>
Expand Down Expand Up @@ -432,7 +425,7 @@ <h4>Forward calls to voicemail</h4>
<div class="u-mv">
<label>When not answered
<input type="checkbox" id="vmNotAnsweredCb" name="vmNotAnsweredCb" checked="" onchange="changeElementVisibility(document.getElementById('vmNotAnsweredCb'),
document.getElementById('notAnsweredRings'))" disabled="true">
document.getElementById('vmNotAnsweredRings'))" disabled="true">
<input type="string" id="vmNotAnsweredRings" name="vmNotAnsweredRings"
placeholder="Number of rings" disabled="true">
</label>
Expand Down
61 changes: 45 additions & 16 deletions packages/calling/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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',

Copy link
Copy Markdown
Contributor

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?

Copy link
Copy Markdown
Contributor Author

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.

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',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The 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

SET_CALL_SETTINGS uses accounts USER_1, USER_2, and USER_3 but only depends on OAuth - PROD. Since SET_REGISTRATION_1/2/3 also depend only on OAuth and use these same accounts, Playwright can schedule them concurrently — violating the constraint at the top of test-data.ts:

the same Webex account must NEVER be active in two browser sessions simultaneously

This needs dependencies: ['SET_REGISTRATION_1 - PROD', 'SET_REGISTRATION_2 - PROD', 'SET_REGISTRATION_3 - PROD'] at minimum, or should wait until after SET_CALL (which already serializes through the registration projects).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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,
},
],
});
44 changes: 41 additions & 3 deletions packages/calling/playwright/constants/selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

div#incomingsection #answer relies on the container tag name to disambiguate duplicate incomingsection IDs. If markup changes (e.g., fieldset -> div), this may become ambiguous and fail in strict mode. Would it be safer to fix duplicate IDs in sample HTML and keep selectors semantically unique?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The 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();
10 changes: 10 additions & 0 deletions packages/calling/playwright/test-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CRITICAL: Missing closing }, — this file won't parse

The SET_CALL_SETTINGS object is missing its closing brace+comma. Playwright test discovery will fail immediately with a syntax error.

  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: {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done chnages applied ,rebase the branch and appiled the changes

},
};

/**
Expand Down
Loading
Loading