feat(cc-widgets): UI Automation for State Change - #476
Conversation
- Comprehensive test for user state widget functionality - Includes authentication, state changes, theme validation - Tests page refresh persistence and multi-session sync - Validates callback sequences and idle state transitions
… updated constants.ts file
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
|
This pull request is automatically being deployed by Amplify Hosting (learn more). |
| "react-dom": ">=18.3.1" | ||
| } | ||
| } No newline at end of file | ||
| } |
There was a problem hiding this comment.
try to remove and avoid these changes
| baseURL: 'http://localhost:3000', | ||
|
|
||
| /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ | ||
| trace: 'retain-on-failure', |
There was a problem hiding this comment.
why did we change this? we only want to check if itas a failure
There was a problem hiding this comment.
Yeah I'll revert the change. I had changed it to obtain the trace even for test success for debugging purposes just to see if things are actually happening the way I wanted them to.
| await page.locator('#select-base-triggerid').getByText('Access Token').click(); | ||
| await page.getByTestId('samples:login_option_oauth').getByText('Login with Webex').click(); | ||
| await page.getByTestId('login with webex button').click(); | ||
| await page.getByRole('textbox', { name: 'name@example.com' }).fill(process.env.PLAYWRIGHT_USERNAME); |
There was a problem hiding this comment.
Is it not possible to get this also by testId?
There was a problem hiding this comment.
I agree using testid will make things easier and more consistent
There was a problem hiding this comment.
These are buttons and textboxes for Oauth login. I don't think I can add data-testids for these as I probably won't have access to its source code.
| await page.getByTestId('samples:login_option_oauth').getByText('Login with Webex').click(); | ||
| await page.getByTestId('login with webex button').click(); | ||
| await page.getByRole('textbox', { name: 'name@example.com' }).fill(process.env.PLAYWRIGHT_USERNAME); | ||
| await page.getByRole('link', { name: 'Sign in' }).click(); |
There was a problem hiding this comment.
same here, can we make everything by testId?
| await page.getByTestId('multi-login-enable-checkbox').click(); | ||
| } | ||
|
|
||
| export const initialisePage = async (page: Page): Promise<void> => { |
There was a problem hiding this comment.
rename it to initiaseWidgets
There was a problem hiding this comment.
initiateWidgets or initialiseWidgets?
There was a problem hiding this comment.
initialiseWidgets, sounds good
| dotenv.config(); | ||
|
|
||
|
|
||
| export const changeState = async (page: Page, userState: string): Promise<void> => { |
| @@ -0,0 +1,136 @@ | |||
| import { Page,expect } from '@playwright/test'; | |||
There was a problem hiding this comment.
rename file name to userStateUtils
| return timerText.trim(); | ||
| }; | ||
|
|
||
| export const checkConsole = async (page: Page, state: string, consoleMessages: string[]): Promise<boolean> => { |
There was a problem hiding this comment.
rename to more meaningful name
| @@ -0,0 +1,58 @@ | |||
| import { Page } from '@playwright/test'; | |||
There was a problem hiding this comment.
rename file to stationLoginUtils.ts
| @@ -0,0 +1,23 @@ | |||
| export const BASE_URL = 'http://localhost:3000'; | |||
|
|
|||
| export const STATES = { | |||
…/widgets into ccwidgets_UserStateTest
…y the files accordingly
|
Could you please update the pull-request.yml with the new variable names, such as PW_AGENT1_USERNAME, instead of PW_USERNAME, etc. |
i have reviewed the comments and resolve them
# [1.28.0-ccwidgets.83](v1.28.0-ccwidgets.82...v1.28.0-ccwidgets.83) (2025-07-01) ### Features * **cc-widgets:** UI Automation for State Change ([#476](#476)) ([999cb53](999cb53))
|
🎉 This PR is included in version 1.28.0-ccwidgets.83 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
COMPLETES #< https://jira-eng-sjc12.cisco.com/jira/browse/CAI-6521 >
This pull request addresses
UI automation for testing the user state
by making the following changes
Vidcast: https://app.vidcast.io/share/1af66521-e31c-401f-9cf4-ad53e8adca43
Change Type
The following scenarios were tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
The GAI Coding Policy And Copyright Annotation Best Practices
Checklist before merging