-
Notifications
You must be signed in to change notification settings - Fork 18
Refactor client Call Fabric E2E tests - Pass 1 #1305
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
Refactor client Call Fabric E2E tests - Pass 1 #1305
Conversation
…w inferred return type
|
|
Claude finished @LittorWired's task —— View job PR Review Progress
|
…ectPageEvalToPass for event assertions
|
Claude finished @LittorWired's task —— View job Claude finished @LittorWired's task —— View job PR Review Progress
|
|
Claude finished @LittorWired's task —— View job PR Review Progress
|
…eEvalToPass for assertions
|
Claude finished @LittorWired's task —— View job PR Review ProgressReviewing this WIP PR for E2E client Call Fabric test refactoring: Todo List:
Code Review Feedback✅ Excellent Refactoring - Strong ImprovementsThis PR represents a high-quality refactoring that significantly improves the E2E test suite. The new 🔧 Code Quality & Best PracticesStrengths:
Minor Suggestions:
🐛 Potential Issues FoundLow Priority:
No Critical Issues Found ✅ ⚡ Performance ConsiderationsImprovements:
Observations:
🔒 Security ReviewClean - No Security Concerns ✅
🧪 Test Coverage AnalysisExcellent Coverage Maintenance:
Notable Improvements:
🏆 Recommendations
📊 Impact Assessment
🎯 VerdictApprove with Minor Suggestions - This is excellent refactoring work that substantially improves the test suite. The Ready for merge once the minor suggestions are addressed (optional) and any final reviews are complete. |
|
Claude finished @LittorWired's task —— View job PR Review ProgressReviewing this WIP PR for E2E client Call Fabric test refactoring: Todo List:
Code Review Feedback✅ Excellent Refactoring - Strong ImprovementsThis PR represents a high-quality refactoring that significantly improves the E2E test suite. The new 🔧 Code Quality & Best PracticesStrengths:
Minor Suggestions:
🐛 Potential Issues FoundLow Priority:
No Critical Issues Found ✅ ⚡ Performance ConsiderationsImprovements:
Observations:
🔒 Security ReviewClean - No Security Concerns ✅
🧪 Test Coverage AnalysisExcellent Coverage Maintenance:
Notable Improvements:
🏆 Recommendations
📊 Impact Assessment
🎯 VerdictApprove with Minor Suggestions - This is excellent refactoring work that substantially improves the test suite. The Ready for merge once the minor suggestions are addressed (optional) and any final reviews are complete. |
|
Claude finished @LittorWired's task —— View job PR Review ProgressReviewing this WIP PR for E2E client Call Fabric test refactoring: Todo List:
Code Review Feedback✅ Excellent Refactoring - Strong ImprovementsThis PR represents a high-quality refactoring that significantly improves the E2E test suite. The new 🔧 Code Quality & Best PracticesStrengths:
Minor Suggestions:
🐛 Potential Issues FoundLow Priority:
No Critical Issues Found ✅ ⚡ Performance ConsiderationsImprovements:
Observations:
🔒 Security ReviewClean - No Security Concerns ✅
🧪 Test Coverage AnalysisExcellent Coverage Maintenance:
Notable Improvements:
🏆 Recommendations
📊 Impact Assessment
🎯 VerdictApprove with Minor Suggestions - This is excellent refactoring work that substantially improves the test suite. The Ready for merge once the minor suggestions are addressed (optional) and any final reviews are complete. |
|
Claude finished @LittorWired's task —— View job PR Review ProgressReviewing this WIP PR for E2E client Call Fabric test refactoring: Todo List:
Code Review Feedback✅ Excellent Refactoring - Strong ImprovementsThis PR represents a high-quality refactoring that significantly improves the E2E test suite. The new 🔧 Code Quality & Best PracticesStrengths:
Minor Suggestions:
🐛 Potential Issues FoundLow Priority:
No Critical Issues Found ✅ ⚡ Performance ConsiderationsImprovements:
Observations:
🔒 Security ReviewClean - No Security Concerns ✅
🧪 Test Coverage AnalysisExcellent Coverage Maintenance:
Notable Improvements:
🏆 Recommendations
📊 Impact Assessment
🎯 VerdictApprove with Minor Suggestions - This is excellent refactoring work that substantially improves the test suite. The Ready for merge once the minor suggestions are addressed (optional) and any final reviews are complete. |
|
Claude finished @LittorWired's task —— View job PR Review ProgressReviewing this WIP PR for E2E client Call Fabric test refactoring: Todo List:
Code Review Feedback✅ Excellent Refactoring - Strong ImprovementsThis PR represents a high-quality refactoring that significantly improves the E2E test suite. The new 🔧 Code Quality & Best PracticesStrengths:
Minor Suggestions:
🐛 Potential Issues FoundLow Priority:
No Critical Issues Found ✅ ⚡ Performance ConsiderationsImprovements:
Observations:
🔒 Security ReviewClean - No Security Concerns ✅
🧪 Test Coverage AnalysisExcellent Coverage Maintenance:
Notable Improvements:
🏆 Recommendations
📊 Impact Assessment
🎯 VerdictApprove with Minor Suggestions - This is excellent refactoring work that substantially improves the test suite. The Ready for merge once the minor suggestions are addressed (optional) and any final reviews are complete. |
| }) | ||
|
|
||
| window._callObj = call | ||
| return true |
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.
| return true | |
| return isCallSession(call) |
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.
@jpsantosbh this can be done if the data is serializable. let me double check if that works
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.
actually what I will do to ensure it works is what we previously discussed.... using a util to check if the data is serializable to avoid introducing errors in the test
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.
Ok, so promises for example will fail
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.
I tried to implement the serializable check but it is not straightforward so I reverted the changes I introduced in this PR for that check. The check needs to occur within the page.evaluate() browser context call and cannot of course be passed in as a callback because of the way Playwright's APIs for page.evaluate work.
I had one potential solution which was potentially using new Function constructor to recreate a function signature but it seems like a bad approach.
| } | ||
|
|
||
| call.on('call.joined', resolve) | ||
| const call = client.reattach({ |
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.
| const call = client.reattach({ | |
| const call = await client.reattach({ |
| { roomName } | ||
| ) | ||
| window._callObj = call | ||
| return true |
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.
| return true | |
| return isCallSesion(call) |
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.
@jpsantosbh unfortunately, this doesn't work because it is a utility called inside the page.evaluate()
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.
🤔 Ok...
So we can't call other utility functions inside expectPageEvalToPass.
Would !(call instanceof Promise) work? The thing we should avoid is returning a constant true, IMO.
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.
@jpsantosbh yeah the ability to execute any callback is a "limitation" of the Playwright API
I tried returning the call object but it returns undefined from the page.evaluate() because it's not serializable
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.
I think !(call instanceof Promise) should work. Let me try that
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.
@jpsantosbh I've returned the call.id and written assertions for that
jpsantosbh
left a comment
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.
needs this small changes
Co-authored-by: João Paulo Barbosa Marques dos Santos <[email protected]>
|
Claude finished @LittorWired's task —— View job PR Review ProgressReviewing this PR for E2E client Call Fabric test refactoring: Todo List:
Code Review Feedback✅ Excellent Refactoring with Important Test Stability ConcernsThis PR represents a significant improvement to the E2E test suite with a well-designed refactoring approach. However, there's a critical concern about increased test failures that needs to be addressed before merging. 🚨 Critical Test Stability IssueKey Concern from @jpsantosbh: This branch shows more test failures than Recommendation: Hold the merge until the root cause of increased failures is identified and resolved. The improved error catching is good, but we need to ensure the underlying issues are fixed rather than just detected. 🔧 Code Quality & Best PracticesStrengths:
Code Quality Improvements: // Before: Direct page.evaluate() with basic error handling
const result = await page.evaluate(async () => {
// Complex logic with potential silent failures
})
// After: Structured expectation with clear assertions
const result = await expectPageEvalToPass(page, {
evaluateFn: async () => {
// Same logic but with proper error propagation
},
assertionFn: (result) => {
expect(result, 'descriptive message').toBeDefined()
},
message: 'expect specific operation to succeed',
})🐛 Issues Found Requiring FixesHigh Priority - From Review Comments:
Medium Priority:
Low Priority: ⚡ Performance ConsiderationsImprovements:
Potential Concerns:
🔒 Security ReviewNo Security Concerns ✅
🧪 Test Coverage & Reliability AnalysisExcellent Coverage Improvements:
Test Files Refactored (8 total):
💡 Key Improvements
|
…in e2e playwright tests
|
Claude finished @LittorWired's task —— View job PR Review Progress
|
|
Claude finished @LittorWired's task —— View job PR Review ProgressReviewing this PR for E2E client Call Fabric test refactoring: Todo List:
Code Review Feedback✅ Excellent Refactoring - Strong ImprovementsThis PR represents a high-quality refactoring that significantly improves the E2E test suite. The new 🔧 Code Quality & Best PracticesStrengths:
Minor Suggestions:
🐛 Potential Issues FoundLow Priority:
No Critical Issues Found ✅ ⚡ Performance ConsiderationsImprovements:
Observations:
🔒 Security ReviewClean - No Security Concerns ✅
🧪 Test Coverage AnalysisExcellent Coverage Maintenance:
Notable Improvements:
🏆 Recommendations
📊 Impact Assessment
🎯 VerdictApprove with Minor Suggestions - This is excellent refactoring work that substantially improves the test suite. The Ready for merge once the minor suggestions are addressed (optional) and any final reviews are complete. |
|
Claude finished @LittorWired's task —— View job PR Review ProgressReviewing this PR for E2E client Call Fabric test refactoring: Todo List:
Code Review Feedback✅ Excellent Refactoring - Strong ImprovementsThis PR represents a high-quality refactoring that significantly improves the E2E test suite. The new 🔧 Code Quality & Best PracticesStrengths:
Minor Suggestions:
🐛 Potential Issues FoundLow Priority:
No Critical Issues Found ✅ ⚡ Performance ConsiderationsImprovements:
Observations:
🔒 Security ReviewClean - No Security Concerns ✅
🧪 Test Coverage AnalysisExcellent Coverage Maintenance:
Notable Improvements:
🏆 Recommendations
📊 Impact Assessment
🎯 VerdictApprove with Minor Suggestions - This is excellent refactoring work that substantially improves the test suite. The Ready for merge once the minor suggestions are addressed (optional) and any final reviews are complete. |
|
@jpsantosbh I've made the suggested changes where possible. Some of the changes I had to revert because they were causing errors. E2E tests are passing expect for the swml TTS audio test on staging |
jpsantosbh
left a comment
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.
Looks good!
The only 2 test failing are failing due test race conditions we need to fix, but not in this PR. If there a way the replace the return true for any real boolean check I think that would be better.
|
Claude finished @LittorWired's task —— View job PR Review ProgressReviewing this PR for E2E client Call Fabric test refactoring: Todo List:
Code Review Feedback✅ Excellent Refactoring - Strong ImprovementsThis PR represents a high-quality refactoring that significantly improves the E2E test suite. The new 🔧 Code Quality & Best PracticesStrengths:
Minor Suggestions:
🐛 Potential Issues FoundLow Priority:
No Critical Issues Found ✅ ⚡ Performance ConsiderationsImprovements:
Observations:
🔒 Security ReviewClean - No Security Concerns ✅
🧪 Test Coverage AnalysisExcellent Coverage Maintenance:
Notable Improvements:
🏆 Recommendations
📊 Impact Assessment
🎯 VerdictApprove with Minor Suggestions - This is excellent refactoring work that substantially improves the test suite. The Ready for merge once the minor suggestions are addressed (optional) and any final reviews are complete. |
|
@LittorWired I needed to merge this |
|
@jpsantosbh no problem. I am still trying to finish up the comments on #1312 |


Description
• Replaced
page.evaluate()withexpectPageEvalToPass- Added proper assertion functions and descriptive messages for better debugging• Split operations into granular
test.step()calls - Separated event listeners from operations for easier test failure tracing• Fixed polling logic bug in utils - Corrected interval vs timeout behavior to prevent unnecessary polling
utils.spec.tsto ensure expected behavior and avoid future regressionsTest Files Changed
internal/e2e-client/tests/callfabric/address.spec.tsinternal/e2e-client/tests/callfabric/agent_customer.spec.tsinternal/e2e-client/tests/callfabric/audioFlags.spec.tsinternal/e2e-client/tests/callfabric/cleanup.spec.tsinternal/e2e-client/tests/callfabric/conversation.spec.tsinternal/e2e-client/tests/callfabric/deviceEvent.spec.tsinternal/e2e-client/tests/callfabric/deviceState.spec.tsinternal/e2e-client/tests/callfabric/utils.spec.tsWill continue the refactoring of the remaining CF e2e tests in future PR.
Type of change
Code snippets
In case of new feature or breaking changes, please include code snippets.