Skip to content

test(calling): add Playwright E2E base setup and SDK initialization tests#4790

Open
eigengravy wants to merge 2 commits intowebex:calling-sdk-e2e-testsfrom
eigengravy:calling-sdk-e2e-tests-sdk-init
Open

test(calling): add Playwright E2E base setup and SDK initialization tests#4790
eigengravy wants to merge 2 commits intowebex:calling-sdk-e2e-testsfrom
eigengravy:calling-sdk-e2e-tests-sdk-init

Conversation

@eigengravy
Copy link

@eigengravy eigengravy commented Mar 18, 2026

COMPLETES https://jira-eng-gpk2.cisco.com/jira/browse/CAI-7736

This pull request addresses

Adding Playwright E2E test infrastructure for the Calling SDK kitchen sink sample app, starting with SDK initialization test cases (INIT-001 through INIT-003).

by making the following changes

  • Add Playwright config (playwright.config.ts) with Chrome WebRTC flags, web server setup, and project configuration
  • Add OAuth global setup (playwright/global.setup.ts) that fetches personal access tokens from developer.webex.com with parallel token fetching for caller, callee, and transfer users
  • Add shared test utilities (playwright/Utils/callingUtils.ts) for navigation, SDK init, and service indicator/domain selection (with commented-out future utils for registration, calls, hold, etc.)
  • Add constants (playwright/constants.ts) for element selectors and timeouts
  • Add SDK initialization test cases (playwright/tests/01-sdk-initialization.spec.ts)
  • Add @playwright/test devDependency and ESLint override for playwright files

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

  • INIT-001: Normal Calling — init with calling service indicator
  • INIT-002: Contact Center — init with contactcenter service indicator and service domain
  • INIT-003: Guest Calling — generate guest token and init with guestcalling service indicator
  • All 4 tests passing locally (OAuth + 3 init tests, ~1.5m)

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Claude Code
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

…ests

Add Playwright infrastructure for Calling SDK E2E tests against the
kitchen sink sample app, including OAuth global setup, shared utilities,
and INIT-001 through INIT-003 test cases for SDK initialization.
@eigengravy eigengravy requested a review from a team as a code owner March 18, 2026 09:36
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 504ec1deae

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +163 to +164
await Promise.all(tokenFetches);
upsertEnvVariables(tokenUpdates);

Choose a reason for hiding this comment

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

P1 Badge Pass fetched PATs to dependent projects explicitly

Writing the freshly fetched tokens into .env here does not make them available to the dependent project in the same playwright test run. playwright.config.ts:7 loads dotenv once before projects start, while playwright/tests/01-sdk-initialization.spec.ts:11-17 reads process.env.CALLER_ACCESS_TOKEN directly, so on a clean machine the OAuth project can succeed and still leave the init project failing with CALLER_ACCESS_TOKEN not set. Persist the tokens through a Playwright-supported handoff (for example a temp file/storage state that the tests read) instead of relying on a late .env rewrite.

Useful? React with 👍 / 👎.

Comment on lines +115 to +118
process.env.SKIP_AUTH === 'true' &&
process.env.CALLER_ACCESS_TOKEN &&
process.env.CALLEE_ACCESS_TOKEN &&
process.env.TRANSFER_ACCESS_TOKEN

Choose a reason for hiding this comment

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

P2 Badge Skip auth when only the caller token is needed

The SKIP_AUTH fast path currently requires CALLEE_ACCESS_TOKEN and TRANSFER_ACCESS_TOKEN, even though this commit's initialization suite only ever consumes CALLER_ACCESS_TOKEN (playwright/tests/01-sdk-initialization.spec.ts:11-37). In the common rerun case where a developer has a cached caller PAT but no callee/transfer accounts configured, setup falls through this guard and then throws at lines 125-129 unless extra credentials are supplied, so SKIP_AUTH=true cannot actually skip login for the tests added here.

Useful? React with 👍 / 👎.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 53f6565ebc

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

);
}

await Promise.all(tokenFetches);

Choose a reason for hiding this comment

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

P2 Badge Serialize token fetches that depend on the shared clipboard

When CALLEE_* or TRANSFER_* credentials are present, Promise.all(tokenFetches) runs multiple fetchAccessTokenFromDevPortal() calls at once even though that helper clears, copies, and reads navigator.clipboard (playwright/global.setup.ts:89-100). Because the clipboard is shared across those browser contexts, one login can read another account's token and write the wrong value into CALLER_ACCESS_TOKEN, CALLEE_ACCESS_TOKEN, or TRANSFER_ACCESS_TOKEN, which makes any multi-user E2E flow fail nondeterministically.

Useful? React with 👍 / 👎.

"@babel/types": "^7.14.9",
"@commitlint/cli": "^17.1.2",
"@commitlint/config-conventional": "^17.1.0",
"@playwright/test": "^1.58.2",

Choose a reason for hiding this comment

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

P2 Badge Hook the new Playwright suite into a CI-visible test entrypoint

Checked package.json and .github/workflows/pull-request.yml: the root package still only exposes the existing test:integration / samples:test commands, and the PR workflow runs workspace test:integration while explicitly excluding the root webex-js-sdk workspace. Adding Playwright as a dependency without updating one of those entrypoints means the new playwright/** initialization tests never run in automation, so regressions here will go unnoticed unless someone remembers to invoke Playwright manually.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant