Repository navigation
test(ci): Tag all tests to run in CI + add reason when skipping in the code - #21348
Conversation
* DISPLAY variable hasn't been used for a long time, no documentation for it neither. * the removed mobile screenshare tests only checked whether the button to start sharing was rendered or not.
* mobile exclusive tests removed * expect messages improved * remove + ban user test checking correct element * data-test for whiteboardCursorIndicator re-added * issue linked on remaining flaky tests * lock other viewers annotations test rework
* Hide presentation toolbar test fixed and improved * Flaky notes on flakyu flags added
* stop checking for notifications on force listen only test * re-add skipped tests that are passing * fix Custom styles via URL test
* use closeAllToastNotifications * re-enable old flaky tests * link issue on flaky test
* Removed old steps on polling test: behavior's changed
* remove unused file * linking issues on flaky tests * screenshots updated
WalkthroughThe pull request introduces modifications across various components of the BigBlueButton application, focusing on enhancing user experience and functionality. Key changes include updates to the Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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
CodeRabbit Configuration File (
|
* randomly failing when trying to close toast but not capable to click on it (display none applied) * fix its usage on presentation tests (join param instead of create)
|
This pull request has conflicts ☹ |
There was a problem hiding this comment.
Actionable comments posted: 7
🧹 Outside diff range and nitpick comments (54)
bigbluebutton-tests/playwright/options/options.spec.js (1)
Line range hint
1-37: Summary: Improved test organization and potential stability enhancementsThe changes in this file effectively reorganize the "Options" test suite for better CI execution:
- The entire test suite is now tagged for CI, ensuring all tests within it are included in CI runs.
- Individual test tags have been removed, simplifying the code and potentially indicating improved test stability.
These modifications align well with the PR objectives of enabling all tests to run in CI and reducing flaky tests. The changes also improve code maintainability by simplifying test declarations.
Consider documenting the rationale behind removing the '@flaky' tags from the "Dark mode" and "Font size" tests. This information could be valuable for future maintenance and troubleshooting.
bigbluebutton-tests/playwright/core/constants.js (1)
Line range hint
25-27: Approved: New constant for hiding presentation toasts in testsThe addition of
PARAMETER_HIDE_PRESENTATION_TOASTis a good approach for managing element visibility during snapshot comparisons. The comment clearly explains its purpose and limitations.Consider creating a more robust solution that removes the elements from the DOM entirely for tests, rather than just hiding them with CSS. This could prevent potential issues with Playwright assertions and make the tests more reliable.
// Example of a more robust approach (pseudo-code) exports.REMOVE_PRESENTATION_TOAST_SCRIPT = ` document.querySelector('.presentationUploaderToast')?.remove(); document.querySelector('.currentPresentationToast')?.remove(); `;This approach would need to be implemented in the test setup, but it could provide a more consistent testing environment.
bigbluebutton-tests/playwright/whiteboard/deleteDrawing.js (1)
23-26: Great improvement: Verifying deletion outcome strengthens the test.The added checks to confirm the arrow's removal on both moderator and user pages are excellent. They ensure that the test's main objective (arrow deletion) is verified from multiple perspectives, increasing the test's thoroughness and reliability.
For consistency with the previous block, consider adding a blank line before the comment on line 23.
Here's a suggested minor change for improved readability:
await this.modPage.hasElement(e.wbDrawnArrow); await this.userPage.hasElement(e.wbDrawnArrow); + // delete the drawn arrow await this.modPage.waitAndClick(e.wbDelete); await this.modPage.wasRemoved(e.wbDrawnArrow); await this.userPage.wasRemoved(e.wbDrawnArrow);bigbluebutton-tests/playwright/stress/stress.spec.js (2)
4-5: Approved: Clear indication of test execution environmentThe added comment effectively communicates that stress tests are not intended for CI environments, which aligns with the PR objectives. This helps prevent potential misuse of these tests in automated pipelines.
Consider slightly rewording the comment for even more clarity:
- // @ci Note: Stress tests are not intended to be run in CI + // @ci-skip Reason: Stress tests are designed for manual execution and not suitable for CI environmentsThis change would make the reason more explicit and align better with the PR's goal of providing clear reasons for skipped tests.
Line range hint
15-18: Add a comment explaining the reason fortest.fixmeThe use of
test.fixmealigns well with the PR objectives of clearly indicating tests that need updates. However, to further improve clarity and maintainability, it would be beneficial to add a comment explaining why this test is currently not functioning as expected.Consider adding a comment like this:
test.fixme('All users must receive breakout room invitations', async ({ browser, context, page }) => { // FIXME: This test is currently not working due to [specific reason]. // Issue tracker: [link to relevant issue] const stress = new Stress(browser, context, page); await stress.breakoutRoomInvitation(); });This addition would provide valuable context for other developers and align even better with the PR's goal of providing clear reasons for test statuses.
bigbluebutton-tests/playwright/learningdashboard/learningdashboard.spec.js (1)
37-37: LGTM: Removed redundant CI tag, but consider improving parameter syntaxThe removal of the individual
{ tag: '@ci' }from the 'Download Session Learning Dashboard' test case is appropriate and consistent with the centralized tagging approach.However, the empty object pattern
{}can be improved for better readability and to address the static analysis hint.Consider replacing the empty object pattern with an underscore to explicitly indicate an unused parameter:
test('Download Session Learning Dashboard', async (_, testInfo) => { // ... });This change makes it clear that the first parameter is intentionally unused and improves code readability.
🧰 Tools
🪛 Biome
[error] 37-37: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
bigbluebutton-tests/playwright/sharednotes/sharednotes.spec.js (3)
22-22: LGTM: Removed redundant CI tag, but there's a typo in the test name.Removing the
tag: '@ci'from this test case is consistent with the changes made to other tests. However, there's a typo in the test name.Please correct the typo in the test name:
- test('Formate text in shared notes', async () => { + test('Format text in shared notes', async () => {
26-26: LGTM: Removed redundant CI tag, but there's an unnecessary empty object pattern.Removing the
tag: '@ci'from this test case is consistent with the changes made to other tests. However, there's an unnecessary empty object pattern in the test function parameters.Consider removing the empty object pattern for cleaner code:
- test('Export shared notes', async ({}, testInfo) => { + test('Export shared notes', async (testInfo) => {🧰 Tools
🪛 Biome
[error] 26-26: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
42-44: LGTM: Retained flaky tag and added new issue link.The changes to this test case are appropriate:
- Removing the redundant
@citag while retaining the@flakytag helps identify unstable tests.- Adding a new issue link (
21283) provides more context about the test's flakiness.These changes align with the PR objective of providing clear reasons for potentially skipping tests.
Consider adding a brief comment explaining why this test is marked as flaky. This would provide immediate context for developers running the tests. For example:
test('Pin and unpin notes onto whiteboard', { tag: '@flaky' }, async () => { // This test is flaky due to timing issues when pinning/unpinning notes linkIssue('20892'); linkIssue('21283'); await sharedNotes.pinAndUnpinNotesOntoWhiteboard(); });bigbluebutton-tests/playwright/whiteboard/pan.js (1)
24-24: Approved: Good addition of a descriptive message to the assertion.The added message "reset zoom button label should change after clicking to zoom in" improves the clarity of the test. This is a positive change as it makes the test's intention more explicit and will aid in debugging if the assertion fails.
For consistency, consider adding similar descriptive messages to other assertions in this method, such as the screenshot comparisons at the end of the test. This would further enhance the overall clarity of the test.
bigbluebutton-tests/playwright/audio/audio.spec.js (1)
15-15: LGTM: Removal of redundant CI tagsThe removal of individual
{ tag: '@ci' }options from test cases is appropriate given the suite-level tagging. This change improves code maintainability without affecting test coverage.For consistency, consider adding comments to link each test to its corresponding documentation, similar to the existing comments on lines 14, 19, 28, 33, and 39.
Also applies to: 20-20, 29-29, 34-34, 40-40, 45-45
bigbluebutton-tests/playwright/connectionStatus/connectionStatus.spec.js (3)
17-22: Approved: Clear indication of test needing updateThe change from
['@ci', '@flaky']to@need-updateaccurately reflects the current state of this test. The comment provides valuable context about why the test needs updating.To ensure this test gets updated, would you like me to create a GitHub issue to track this task? The issue could reference PR #19289 and outline the necessary changes to adapt the test to the new way of measuring bad connections.
25-30: Approved: Consistent update needed indicationThe change to
@need-updatetag is appropriate and consistent with the previous test. The comment clearly explains the reason for the needed update.When creating the GitHub issue for tracking the updates needed due to PR #19289, I recommend including both this test and the previous one ("Report a User with bad connection in Connection Issues") in the same issue. This will help ensure both tests are updated consistently. Would you like me to prepare a draft of this issue?
33-34: Approved: Improved test categorization and skip conditionThe changes to this test improve clarity:
- The
@only-headedtag clearly indicates the test's environment requirements.- Using
test.skipinstead oftest.fixmeis more explicit about the test's status.These modifications align well with the PR's goal of clarifying test execution conditions.
Consider adding a brief comment explaining why this test only works in headed mode. This would provide valuable context for future maintainers. For example:
// This test requires headed mode to interact with the system clipboard test('Copy stats', { tag: '@only-headed' }, async ({ browser, context, page }, testInfo) => { test.skip(testInfo.project.use.headless, 'Clipboard access is not available in headless mode'); // ... rest of the test });bigbluebutton-tests/playwright/webcam/webcam.spec.js (1)
33-34: LGTM: Added '@flaky' tag and explanatory commentThe addition of the
@flakytag and the explanatory comment is a good practice. It clearly identifies this test as potentially unreliable and provides context for other developers.However, to fully address this issue:
Would you like assistance in creating a GitHub issue to track the improvement of this test's reliability? This could help ensure that the flaky test is addressed in the future.
bigbluebutton-tests/playwright/connectionFailure/connectionFailure.spec.js (2)
13-17: Improved test name and skip conditionThe changes in this segment improve clarity and simplify the test setup:
- The test name change from "Screen sharer" to "Screen share" is more concise and accurate.
- The simplified skip condition for Firefox browsers is clearer and easier to understand.
- The added comment explains the reason for skipping the test in Firefox.
Consider updating the comment to be more specific:
-"Screenshare tests not able in Firefox browser without desktop", +"Screenshare tests not available in Firefox browser without a desktop environment",This change provides a more precise explanation of the limitation.
Line range hint
1-56: Overall improvements in test clarity and consistencyThe changes in this file align well with the PR objectives:
- The added comment at the beginning of the file provides crucial information about the test suite's behavior in CI.
- Test names and skip conditions have been improved for clarity and consistency.
- Comments have been added to explain why certain tests are skipped in specific environments.
These modifications enhance the maintainability and understandability of the test suite. They provide clear reasons for skipping tests and improve the overall organization of the test code.
Consider creating a shared constant or configuration value for the Firefox skip message to ensure consistency across all tests and make future updates easier.
bigbluebutton-tests/playwright/notifications/notifications.js (1)
Line range hint
25-53: Consider refactoring theaudioNotificationmethod for improved maintainability.The
audioNotificationmethod is quite long and complex, containing multiple assertions and checks. To improve maintainability and readability, consider refactoring this method into smaller, more focused helper methods.Here's a suggested refactoring approach:
- Extract the microphone joining logic into a separate method:
async joinMicrophone() { await this.modPage.waitAndClick(e.joinAudio); await this.modPage.joinMicrophone(); await util.checkNotificationText(this.modPage, e.joinAudioToast); await util.checkNotificationIcon(this.modPage, e.unmuteIcon); // ... (other checks) }
- Extract the listen-only joining logic into a separate method:
async joinListenOnly() { await this.modPage.waitAndClick(e.joinAudio); await this.modPage.waitAndClick(e.listenOnlyButton); await this.modPage.wasRemoved(e.establishingAudioLabel); await util.checkNotificationText(this.modPage, e.joinAudioToast); await util.checkNotificationIcon(this.modPage, e.listenOnlyIcon); }
- Refactor the
audioNotificationmethod to use these helper methods:async audioNotification() { await this.joinMicrophone(); await util.waitAndClearNotification(this.modPage); await this.leaveMicrophone(); await this.joinListenOnly(); }This refactoring will make the code more modular, easier to read, and simpler to maintain. It will also make it easier to reuse these audio-related actions in other test scenarios if needed.
bigbluebutton-tests/playwright/chat/chat.spec.js (2)
54-54: Good improvement: Consistent test structureThis change aligns well with the earlier modification to the 'Copy chat' test:
- Replacing
test.skipwith a regular test declaration improves flexibility.- The
@only-headedtag clearly categorizes this test as having limitations in headless environments.These modifications are consistent with the PR objectives of improving test categorization.
Consider adding a conditional skip similar to the 'Copy chat' test for consistency:
test('Copy chat with emoji', { tag: '@only-headed' }, async ({}, testInfo) => { test.skip(testInfo.project.use.headless, 'Only works in headed mode'); await chat.emojiCopyChat(); });This would provide a clear reason for skipping in headless mode, enhancing the test's clarity further.
87-88: Good update: Improved test clarity and CI inclusionThese changes enhance the test suite:
- The comment provides valuable context about the recent removal of the flaky flag, which aids in understanding the test's current status.
- Retaining the '@ci' tag ensures this test continues to run in the CI environment, which is crucial for monitoring its behavior.
These modifications align with the PR objectives of clarifying test statuses and ensuring comprehensive CI coverage.
Consider updating the comment to include a timestamp or PR reference where the flaky flag was removed. This would provide even more context for future maintainers. For example:
// flaky flag removed in PR #XXXX (date) to monitor current behaviorbigbluebutton-tests/playwright/presentation/util.js (1)
39-39: Approved: Typo correction improves clarity.The correction from "confiming" to "confirming" in the error message enhances the clarity of the test output. This change is beneficial for maintaining accurate and professional error messages.
Consider adding a period at the end of the error message for consistency with other messages in the file:
- await test.hasElement(e.presentationUploadProgressToast, 'should display the toast presentation upload progress after confirming the presentation to be uploaded', ELEMENT_WAIT_EXTRA_LONG_TIME); + await test.hasElement(e.presentationUploadProgressToast, 'should display the toast presentation upload progress after confirming the presentation to be uploaded.', ELEMENT_WAIT_EXTRA_LONG_TIME);bigbluebutton-tests/playwright/breakout/breakout.spec.js (1)
124-127: LGTM: Improved test organization and documentationThe changes to the "Export breakout room shared notes" test case are well-implemented:
- Moving the '@flaky' tag to a parameter improves readability and follows best practices.
- The added comment provides valuable context about the known issue.
- Using
linkIssue(21321)creates a clear connection to the related GitHub issue.These improvements align well with the PR objectives of enhancing test clarity and organization.
Consider adding a brief description of the issue #21321 in the comment for better context without needing to look up the issue. For example:
// Issue #21321: Presentation uploader toast not consistently displayed // This can cause the test to fail intermittently linkIssue(21321)bigbluebutton-tests/playwright/presentation/presentation.spec.js (3)
7-7: LGTM: Good use of the new constant.The
hidePresentationToastvariable effectively utilizes the new constant, improving code maintainability. Consider adding a brief comment explaining the purpose of this encoded parameter for better clarity.// Encoded parameter to hide the presentation upload toast in tests const hidePresentationToast = encodeCustomParams(PARAMETER_HIDE_PRESENTATION_TOAST);
64-67: LGTM: Good documentation of flaky test.The addition of the comment and
linkIssuecall provides valuable context about the test's recent failures in CI. The '@flaky' tag is appropriately used. Consider adding a TODO comment to remind the team to investigate and resolve the flakiness.test('Zoom In, Zoom Out, Reset Zoom', { tag: '@flaky' }, async ({ browser, context, page }) => { // Oct, 24 => Recent failures in CI runs. doesn't seem to be reproducible locally // see issue below // TODO: Investigate and resolve the flakiness in this test linkIssue(21266); // ... rest of the test });
87-89: LGTM: Good documentation of test issue.The addition of the comment and
linkIssuecall provides valuable context about the file conversion issue affecting this test. The '@flaky' tag is appropriately used. Consider adding a TODO comment to remind the team to address the file conversion problem.test('Upload Other Presentations Format', { tag: '@flaky' }, async ({ browser, context, page }) => { // file with wrong (not expected) ideogram conversion pushed, which is used for assertions // see issue below // TODO: Update the test file with correct ideogram conversion linkIssue(18971); // ... rest of the test });bigbluebutton-tests/playwright/webcam/webcam.js (2)
87-87: Approved: Good addition to improve test reliability.The added sleep timeout is a good way to ensure the video is in fullscreen mode before proceeding with dimension checks. This aligns well with the PR objectives of improving test reliability.
Consider extracting the sleep duration (1000ms) to a named constant at the top of the file, such as
FULLSCREEN_TRANSITION_TIMEOUT. This would improve maintainability and make it easier to adjust if needed.const FULLSCREEN_TRANSITION_TIMEOUT = 1000; // Later in the method await sleep(FULLSCREEN_TRANSITION_TIMEOUT);
Line range hint
1-190: Suggestions for future improvementsWhile the current change is good, here are some suggestions for future improvements to enhance the overall quality and maintainability of the test suite:
Consistency in timeout usage: Consider using constants for all timeout values throughout the file. For example, replace hard-coded values like
1000or5000with named constants.Error handling: Add try-catch blocks around critical operations to provide more informative error messages when tests fail. This can help with debugging and maintenance.
Reduce code duplication: Consider extracting common operations (like joining a video call) into helper methods to reduce repetition across test methods.
Documentation: Add JSDoc comments to methods explaining their purpose and any important assumptions or prerequisites.
These suggestions aim to improve the overall structure and maintainability of the test suite, aligning with the PR's goal of enhancing test clarity and organization.
bigbluebutton-tests/playwright/whiteboard/whiteboard.spec.js (3)
72-74: LGTM: Improved test metadata for 'Create sticky note'.The addition of the
@flakytag and thelinkIssuecall provides valuable context about the test's reliability and the associated issue. This is a good practice for managing potentially unstable tests.Consider adding a brief description of the issue's impact on the test results to the comment for even more clarity.
- // wrong/unexpected slide zoom for some users causing screenshot comparison to fail + // Issue #21302: Wrong/unexpected slide zoom for some users causes screenshot comparison to fail, potentially leading to false negatives
81-83: LGTM: Enhanced test metadata for 'Pan'.The addition of the
@flakytag and thelinkIssuecall effectively communicates the test's potential instability and links it to a known issue. This is consistent with the approach used in the 'Create sticky note' test.For consistency with the previous test case, consider slightly expanding the comment:
- // different zoom position when clicking toolbar's zoom button + // Issue #21266: Different zoom position when clicking toolbar's zoom button may cause inconsistent test results
162-164: LGTM: Improved test metadata for 'Shape Options' describe block.The addition of the
@flakytag to the entire 'Shape Options' describe block effectively marks all tests within it as potentially unstable. The comment provides valuable context about the known issue affecting these tests.For consistency with earlier changes and to provide more immediate context, consider modifying the comment slightly:
- // wrong/unexpected slide zoom for some users causing screenshot comparison to fail - // see https://github.com/bigbluebutton/bigbluebutton/issues/21302 + // Issue #21302: Wrong/unexpected slide zoom for some users causes screenshot comparison to fail, potentially leading to false negatives in Shape Options testsThis change aligns the comment style with the earlier modifications and provides immediate context without needing to follow the link.
bigbluebutton-tests/playwright/user/user.spec.js (1)
Line range hint
1-268: Summary of review findingsOverall, the changes in this file align well with the PR objectives of removing
@citags and addressing flaky tests. However, there are a few points that need attention:
- The main
Usertest suite still has the@citag (line 15).- Two tests still have the
@flakytag:
- "Lock see other viewers cursor" (line 223)
- "Mute all users except presenter" (line 245)
- There are ongoing issues affecting some tests, which may require skipping or fixing before removing their
@flakytags.Please address these points to fully align with the PR objectives and improve the overall test suite stability.
To maintain consistency and improve the management of flaky tests, consider implementing a centralized approach for handling known issues:
- Create a separate configuration file (e.g.,
knownIssues.js) to track tests with known issues.- Implement a custom test wrapper that checks this configuration and automatically skips or marks tests as flaky based on the current status of known issues.
- Update the CI pipeline to report on skipped tests separately, allowing for easy tracking of tests that need attention.
This approach will make it easier to manage and track issues across the test suite, and provide a clear path for re-enabling tests once issues are resolved.
bigbluebutton-tests/playwright/parameters/customparameters.js (2)
115-118: LGTM! Consider adding a descriptive comment.The changes to the
forceListenOnlymethod improve the test's accuracy by verifying:
- The audio modal is removed after joining.
- The leave listen-only button is present.
- Mute and unmute buttons are not displayed.
These checks effectively confirm that the user is forced into listen-only mode.
Consider adding a brief comment explaining the purpose of these checks for better maintainability:
async forceListenOnly() { // Verify that the user is forced into listen-only mode await this.userPage.wasRemoved(e.audioModal, 'should not display the audio modal after joining meeting'); await this.userPage.hasElement(e.leaveListenOnly, 'should join listen only mode and display button to leave it'); await this.userPage.wasRemoved(e.muteMicButton, 'should not display the mute mic button'); await this.userPage.wasRemoved(e.unmuteMicButton, 'should not display the mute mic button'); }
159-159: Fix typo in commentThere's a minor typo in the comment:
- expect(notificationBarColor, 'should display the banner bar with the chosen color').toBe(colorToRGB); + expect(notificationBarColor, 'should display the banner bar with the chosen color').toBe(colorToRGB);bigbluebutton-tests/playwright/user/multiusers.js (2)
265-265: Improved assertion message specificityThe assertion message has been updated to provide more precise information about the expected behavior. This change clarifies that the talking element should be displayed only for the moderator and that there should be exactly one such element.
Consider further improving the assertion message for consistency and clarity:
- 'should display the is talking element only for the moderator - 1 item' + 'should display exactly one is-talking element, and only for the moderator'This suggestion maintains the improved specificity while enhancing readability.
304-306: Improved flexibility in error message checkingThe changes to use more generic selectors and regular expressions for checking error messages improve the test's robustness. This allows for slight variations in how the application displays these messages.
While the current changes improve flexibility, consider the following suggestions to maintain precision:
- Use more specific selectors if possible, such as a container for error messages:
await this.modPage2.hasText('[data-test-id="error-container"]', /banned/, 'should display the banned message for the second moderator');
- If using the
bodyselector is necessary, consider using more specific regular expressions to reduce the chance of false positives:await this.modPage2.hasText('body', /You have been banned from this meeting/, 'should display the banned message for the second moderator'); await this.modPage2.hasText('body', /You have been removed from this meeting/, 'should display the removed message for the second moderator');These suggestions aim to balance flexibility with precision in error message checking.
bigbluebutton-tests/playwright/parameters/parameters.spec.js (6)
7-7: LGTM! Consider cleaning up unused imports.The addition of
linkIssueimport is appropriate for the new issue linking functionality.It appears that
PARAMETER_HIDE_PRESENTATION_TOASTis no longer used in this file. Consider removing any other unused imports to keep the file clean.
32-34: LGTM! Consider adding the issue number in the test description.The added comments provide valuable context about the test's behavior and link to a related issue. This improves maintainability and understanding of the test.
Consider adding the issue number to the test description for easier reference, e.g.,
test('Max Participants (Issue #19426)', { tag: '@flaky' }, async ...)
430-433: LGTM! Consider adding a TODO for issue resolution.The added comments and issue link provide valuable context about the test's limitations. The '@flaky' tag appropriately indicates the test's potential inconsistency.
Consider adding a TODO comment with the issue number to remind developers to update the test once the issue is resolved, e.g.,
// TODO: Remove @flaky tag and update test once issue #19427 is resolved
445-450: LGTM! Consider refactoring the test for clarity.The added comments, issue link, and '@flaky' tag provide valuable context about the test's limitations and expected behavior.
Consider the following improvements:
- Add a TODO comment to update the test once issue #21326 is resolved.
- Refactor the test to clearly separate the moderator and attendee scenarios, possibly into two separate test cases.
- Update the test description to reflect the current behavior and limitations.
Example refactoring:
test.describe('Force Listen Only', () => { test('should not apply to moderators (Issue #21326)', { tag: '@flaky' }, async ({ browser, context, page }) => { // TODO: Update test once issue #21326 is resolved const customParam = new CustomParameters(browser, context); await customParam.initModPage(page, false, { joinParameter: c.forceListenOnly }); // Add assertions for moderator behavior }); test('should apply to attendees', async ({ browser, context, page }) => { const customParam = new CustomParameters(browser, context); await customParam.initUserPage(false, context, { useModMeetingId: false, joinParameter: c.forceListenOnly }); await customParam.forceListenOnly(page); }); });
Line range hint
482-486: LGTM! Consider adding comments for consistency.The test case for "Force restore presentation on new events" has been appropriately added or modified.
For consistency with other tests in this file, consider adding:
- A brief comment explaining the expected behavior of this feature.
- Any known limitations or potential issues, if applicable.
- A link to relevant documentation or issues, if available.
This would improve the test's maintainability and help other developers understand its purpose and any potential caveats.
Line range hint
1-486: Overall LGTM! Consider standardizing documentation across all tests.The changes in this file significantly improve the test suite's maintainability and clarity. The addition of comments, issue links, and appropriate tags (e.g., '@flaky') provides valuable context for developers working with these tests.
To further enhance the file:
- Standardize the documentation style across all tests. Some tests have detailed comments and issue links, while others don't. Applying a consistent approach would improve readability.
- Consider adding a brief comment at the top of the file explaining the purpose of these tests and any common setup or considerations.
- Review all tests for potential flakiness or known issues, and ensure they are appropriately tagged and documented.
These improvements will make the test suite even more robust and developer-friendly.
bigbluebutton-tests/playwright/core/elements.js (2)
476-476: More flexible selector for whiteboard delete buttonThe updated selector for
wbDeletenow matches any button with a title starting with "Delete". This change makes the tests more robust against minor variations in the button's title.However, to ensure specificity, consider adding an additional attribute to the selector if possible, such as a unique
data-testattribute. This would maintain flexibility while reducing the risk of selecting an unintended button.If possible, consider updating the selector to include a specific
data-testattribute:-exports.wbDelete = 'button[title^="Delete"]'; +exports.wbDelete = 'button[data-test="wbDeleteButton"][title^="Delete"]';This change would require updating the corresponding element in the application code as well.
492-492: New selector added for whiteboard drawn arrowThe addition of the
wbDrawnArrowselector is good. It allows tests to interact with or verify the presence of drawn arrows on the whiteboard, which seems to be a new feature.For consistency with other selectors in this file, consider adding a
data-testattribute to the element in addition to thedata-shape-type.Consider updating the selector to include a
data-testattribute for consistency:-exports.wbDrawnArrow = 'div[data-shape-type="arrow"]'; +exports.wbDrawnArrow = 'div[data-test="wbDrawnArrow"][data-shape-type="arrow"]';This change would require updating the corresponding element in the application code as well.
bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx (7)
Line range hint
1-143: LGTM! Consider grouping imports for better organization.The imports and initial setup look good. The utility functions are well-defined and serve clear purposes. The use of React.memo for the Whiteboard component is a good practice for performance optimization.
Consider grouping the imports into categories (e.g., React-related, third-party libraries, custom hooks, utilities) for better organization and readability.
Line range hint
145-250: Consider refactoring for improved state management and component structure.The component's state management is quite complex, with numerous props and state variables. While the use of refs is appropriate for persisting values across renders, the overall complexity suggests that the component might benefit from some refactoring.
Consider the following improvements:
- Split the component into smaller, more focused sub-components to reduce complexity.
- Use the React Context API or a state management library like Redux for managing global state.
- Create custom hooks for related state and logic to improve reusability and readability.
Example of a custom hook for cursor-related state and logic:
function useCursorState(publishCursorUpdate, whiteboardId) { const [cursorPosition, setCursorPosition] = useState({ x: 0, y: 0 }); const updateCursorPosition = useCallback((x, y) => { setCursorPosition({ x, y }); publishCursorUpdate(x, y, whiteboardId); }, [publishCursorUpdate, whiteboardId]); return [cursorPosition, updateCursorPosition]; }This would simplify the main component and improve code organization.
Line range hint
252-345: LGTM! Consider enhancing error handling in clipboard operations.The clipboard handling functions (handleCopy, handleCut, and handlePaste) are well-implemented. They correctly interact with the browser's clipboard API and include fallback mechanisms for different browser capabilities. The use of compression for clipboard data is a good optimization.
Consider adding more robust error handling, especially in the handlePaste function. For example:
const handlePaste = useCallback(() => { if (isPasting) return; isPasting = true; clearTimeout(pasteTimeout); pasteTimeout = setTimeout(() => { if (clipboardContent) { pasteTldrawContent(tlEditorRef.current, clipboardContent); isPasting = false; } else { navigator.clipboard.readText() .then((text) => { const match = text.match(/<tldraw>(.*)<\/tldraw>/); if (match && match[1]) { const content = JSON.parse(decompressFromBase64(match[1])); pasteTldrawContent(tlEditorRef.current, content); } else { console.warn('Clipboard content is not in the expected format'); } }) .catch((error) => { console.error('Failed to read clipboard contents:', error); }) .finally(() => { isPasting = false; }); } }, 100); }, [tlEditorRef]);This enhancement provides more informative error messages and ensures
isPastingis always reset.
Line range hint
347-463: Refactor handleKeyDown for improved maintainability.The handleKeyDown function effectively manages various keyboard shortcuts for the whiteboard, covering a wide range of operations. However, its length and complexity may pose challenges for future maintenance.
Consider refactoring this function to improve readability and maintainability:
- Extract the key mappings into separate objects:
const simpleKeyMap = { v: 'select', d: 'draw', e: 'eraser', // ... other mappings }; const ctrlKeyMap = { a: handleSelectAll, d: handleDuplicate, x: handleCut, // ... other mappings }; const arrowKeyMap = { ArrowUp: { x: 0, y: -moveDistance }, ArrowDown: { x: 0, y: moveDistance }, // ... other mappings };
- Create separate functions for different types of actions:
const handleToolSelection = (key) => { if (simpleKeyMap[key]) { tlEditorRef.current?.setCurrentTool(simpleKeyMap[key]); } }; const handleCtrlKeyAction = (key) => { if (ctrlKeyMap[key]) { ctrlKeyMap[key](); } }; const handleArrowKeyAction = (key) => { if (arrowKeyMap[key]) { tlEditorRef.current?.nudgeShapes(selectedShapes, arrowKeyMap[key], { squashing: true }); } };
- Simplify the main handleKeyDown function:
const handleKeyDown = useCallback((event) => { if (event.key === 'Escape') { tlEditorRef.current?.deselect(...tlEditorRef.current?.getSelectedShapes()); return; } if (event.ctrlKey || event.metaKey) { handleCtrlKeyAction(event.key); } else { handleToolSelection(event.key); handleArrowKeyAction(event.key); } // ... handle other special cases }, [tlEditorRef, isPresenterRef, hasWBAccessRef, previousTool, handleCut, handleCopy, handlePaste]);This refactoring would make the function more modular and easier to maintain.
Line range hint
465-1228: Optimize useEffect hooks to reduce unnecessary re-renders.The useEffect hooks in this component handle various aspects of the whiteboard's functionality, including zoom, camera position, and slide changes. While they seem to cover different scenarios well, some optimizations could improve performance and maintainability.
Consider the following optimizations:
- Use the useCallback hook for functions defined inside useEffect to prevent unnecessary recreations:
const handleResize = useCallback(() => { // ... existing resize logic }, [presentationAreaHeight, presentationAreaWidth, currentPresentationPage, tlEditor]); useEffect(() => { const timeoutId = setTimeout(handleResize, CAMERA_UPDATE_DELAY); return () => clearTimeout(timeoutId); }, [handleResize]);
- Extract complex logic into custom hooks to improve readability and reusability:
function useZoomEffect(zoomValue, tlEditor, curPageId, isWheelZoom) { useEffect(() => { // ... existing zoom logic }, [zoomValue, tlEditor, curPageId, isWheelZoom]); } // In the component: useZoomEffect(zoomValue, tlEditor, curPageId, isWheelZoomRef.current);
- Use the useMemo hook for complex calculations that don't need to be recomputed on every render:
const effectiveZoom = useMemo(() => calculateEffectiveZoom( initialViewBoxWidthRef.current, currentPresentationPage.scaledViewBoxWidth, initialViewBoxHeightRef.current, currentPresentationPage.scaledViewBoxHeight ), [currentPresentationPage]);
- Consider using a custom hook for localStorage interactions to centralize this logic:
function useLocalStorageState(key, initialValue) { const [state, setState] = useState(() => { const storedValue = localStorage.getItem(key); return storedValue ? JSON.parse(storedValue) : initialValue; }); useEffect(() => { localStorage.setItem(key, JSON.stringify(state)); }, [key, state]); return [state, setState]; } // In the component: const [initialViewBoxWidth, setInitialViewBoxWidth] = useLocalStorageState('initialViewBoxWidth', null);These optimizations should help reduce unnecessary re-renders and improve the overall performance of the component.
Line range hint
1230-1373: LGTM! Consider scoping the global styles.The rendering logic for the Whiteboard component is clear and appropriate. The use of prop types at the end of the file is good practice for type checking and documentation.
Consider scoping the global styles to avoid potential conflicts with other components:
import styled from 'styled-components'; const WhiteboardWrapper = styled.div` /* Move global styles here */ .tl-container { /* ... */ } /* ... other styles */ `; return ( <WhiteboardWrapper ref={whiteboardRef} id="whiteboard-element" key={`animations=-${animations}-${whiteboardToolbarAutoHide}-${language}-${presentationId}`} > <Tldraw /* ... existing props */ /> </WhiteboardWrapper> );This approach ensures that the styles only affect elements within the Whiteboard component, reducing the risk of unintended side effects on other parts of the application.
Line range hint
1-1373: Overall assessment: Well-implemented but with room for improvementThe Whiteboard component is a comprehensive implementation of a complex feature. It effectively handles various aspects of whiteboard functionality, including drawing, clipboard operations, keyboard shortcuts, and synchronization with a presentation.
Key strengths:
- Comprehensive feature set covering various whiteboard operations.
- Good use of React hooks for state management and side effects.
- Well-defined prop types for better type checking and documentation.
Main areas for improvement:
- Component complexity: Consider breaking down the component into smaller, more focused sub-components to improve maintainability and readability.
- State management: Implement a more robust state management solution, such as using the Context API or a state management library like Redux, to handle the complex state interactions more efficiently.
- Performance optimizations: Optimize useEffect hooks and callback functions to reduce unnecessary re-renders and improve overall performance.
- Code organization: Group related functionality into custom hooks for better code organization and reusability.
- Type safety: Consider adopting TypeScript or Flow for improved static typing and code robustness.
To address these points, consider the following architectural changes:
- Create a WhiteboardContext to manage shared state and provide it to child components.
- Split the component into logical sub-components (e.g., ToolbarComponent, CanvasComponent, ClipboardHandlerComponent).
- Implement custom hooks for specific functionality (e.g., useZoom, useClipboard, useKeyboardShortcuts).
- Use a state management library like Redux or Recoil for more complex state interactions.
- Gradually migrate to TypeScript for improved type safety and developer experience.
These changes would significantly improve the maintainability, performance, and scalability of the Whiteboard component.
bigbluebutton-tests/playwright/user/lockViewers.js (3)
207-208: Improve assertion messages for clarityThe assertion messages can be rephrased for better readability and grammatical correctness.
Apply this diff:
- await this.userPage2.hasElement(e.wbDrawnArrow, 'should display the arrow drawn before user join'); + await this.userPage2.hasElement(e.wbDrawnArrow, 'should display the arrow drawn before the user joined'); - await this.userPage2.hasElement(e.wbDrawnShape, 'should display the rectangle drawn before unlocking user'); + await this.userPage2.hasElement(e.wbDrawnShape, 'should display the rectangle drawn before the user was unlocked');
232-232: Clarify assertion message for cursor indicator checkThe assertion message can be improved for clarity and grammatical accuracy.
Apply this diff:
- await this.userPage2.checkElementCount(e.whiteboardCursorIndicator, 0, 'should contain no whiteboard cursor indicator for the second attendee when locking viewers cursor'); + await this.userPage2.checkElementCount(e.whiteboardCursorIndicator, 0, 'should not display any whiteboard cursor indicators for the second attendee when viewer cursors are locked');
240-240: Enhance readability of assertion messageThe assertion message could be rephrased for better understanding.
Apply this diff:
- await this.userPage2.checkElementCount(e.whiteboardCursorIndicator, 1, 'should be displayed the other viewer whiteboard cursor indicator when unlocking user is unlocked'); + await this.userPage2.checkElementCount(e.whiteboardCursorIndicator, 1, 'should display the other viewer\'s whiteboard cursor indicator after the user is unlocked');bigbluebutton-tests/playwright/presentation/presentation.js (1)
419-421: Review themaxDiffPixelsvalue in screenshot optionsThe
maxDiffPixelsthreshold is set to 250 for screenshot comparisons. Consider whether this value is appropriate or if it should be adjusted to balance between tolerating minor rendering differences and detecting significant changes.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (16)
bigbluebutton-tests/playwright/options/options.spec.js-snapshots/moderator-page-dark-mode-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/options/options.spec.js-snapshots/moderator-page-font-size-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/mod-hide-toolbars-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/moderator-new-presentation-screenshot-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/user-toolbars-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/viewer-new-presentation-screenshot-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/user/user.spec.js-snapshots/viewer2-arrow-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/user/user.spec.js-snapshots/viewer2-just-joined-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/user/user.spec.js-snapshots/viewer2-new-arrow-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/user/user.spec.js-snapshots/viewer2-no-arrow-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/user/user.spec.js-snapshots/viewer2-no-rectangle-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/user/user.spec.js-snapshots/viewer2-previous-shapes-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/whiteboard/whiteboard.spec.js-snapshots/moderator-rotate-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/whiteboard/whiteboard.spec.js-snapshots/moderator-sticky-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/whiteboard/whiteboard.spec.js-snapshots/viewer-rotate-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/whiteboard/whiteboard.spec.js-snapshots/viewer-sticky-Chromium-linux.pngis excluded by!**/*.png
📒 Files selected for processing (43)
- bigbluebutton-html5/imports/ui/components/whiteboard/component.jsx (1 hunks)
- bigbluebutton-tests/playwright/audio/audio.spec.js (3 hunks)
- bigbluebutton-tests/playwright/breakout/breakout.spec.js (2 hunks)
- bigbluebutton-tests/playwright/chat/chat.js (4 hunks)
- bigbluebutton-tests/playwright/chat/chat.spec.js (2 hunks)
- bigbluebutton-tests/playwright/connectionFailure/connectionFailure.spec.js (2 hunks)
- bigbluebutton-tests/playwright/connectionStatus/connectionStatus.spec.js (1 hunks)
- bigbluebutton-tests/playwright/core/constants.js (1 hunks)
- bigbluebutton-tests/playwright/core/elements.js (3 hunks)
- bigbluebutton-tests/playwright/layouts/layouts.spec.js (1 hunks)
- bigbluebutton-tests/playwright/learningdashboard/learningdashboard.spec.js (2 hunks)
- bigbluebutton-tests/playwright/notifications/notifications.js (1 hunks)
- bigbluebutton-tests/playwright/notifications/notifications.spec.js (2 hunks)
- bigbluebutton-tests/playwright/notifications/presenterNotifications.js (0 hunks)
- bigbluebutton-tests/playwright/options/options.js (1 hunks)
- bigbluebutton-tests/playwright/options/options.spec.js (2 hunks)
- bigbluebutton-tests/playwright/package.json (2 hunks)
- bigbluebutton-tests/playwright/parameters/constants.js (1 hunks)
- bigbluebutton-tests/playwright/parameters/customparameters.js (2 hunks)
- bigbluebutton-tests/playwright/parameters/parameters.spec.js (7 hunks)
- bigbluebutton-tests/playwright/parameters/util.js (0 hunks)
- bigbluebutton-tests/playwright/polling/poll.js (1 hunks)
- bigbluebutton-tests/playwright/polling/polling.spec.js (1 hunks)
- bigbluebutton-tests/playwright/presentation/presentation.js (2 hunks)
- bigbluebutton-tests/playwright/presentation/presentation.spec.js (3 hunks)
- bigbluebutton-tests/playwright/presentation/util.js (1 hunks)
- bigbluebutton-tests/playwright/reconnection/reconnection.spec.js (1 hunks)
- bigbluebutton-tests/playwright/screenshare/screenshare.spec.js (1 hunks)
- bigbluebutton-tests/playwright/sharednotes/sharednotes.spec.js (2 hunks)
- bigbluebutton-tests/playwright/stress/stress.spec.js (1 hunks)
- bigbluebutton-tests/playwright/user/lockViewers.js (3 hunks)
- bigbluebutton-tests/playwright/user/mobileDevices.js (0 hunks)
- bigbluebutton-tests/playwright/user/multiusers.js (3 hunks)
- bigbluebutton-tests/playwright/user/user.spec.js (9 hunks)
- bigbluebutton-tests/playwright/virtualizedlist/virtualize.js (0 hunks)
- bigbluebutton-tests/playwright/virtualizedlist/virtualizedlist.spec.js (0 hunks)
- bigbluebutton-tests/playwright/webcam/webcam.js (1 hunks)
- bigbluebutton-tests/playwright/webcam/webcam.spec.js (3 hunks)
- bigbluebutton-tests/playwright/whiteboard/deleteDrawing.js (1 hunks)
- bigbluebutton-tests/playwright/whiteboard/draw.js (0 hunks)
- bigbluebutton-tests/playwright/whiteboard/pan.js (1 hunks)
- bigbluebutton-tests/playwright/whiteboard/shapeOptions.js (0 hunks)
- bigbluebutton-tests/playwright/whiteboard/whiteboard.spec.js (4 hunks)
💤 Files with no reviewable changes (7)
- bigbluebutton-tests/playwright/notifications/presenterNotifications.js
- bigbluebutton-tests/playwright/parameters/util.js
- bigbluebutton-tests/playwright/user/mobileDevices.js
- bigbluebutton-tests/playwright/virtualizedlist/virtualize.js
- bigbluebutton-tests/playwright/virtualizedlist/virtualizedlist.spec.js
- bigbluebutton-tests/playwright/whiteboard/draw.js
- bigbluebutton-tests/playwright/whiteboard/shapeOptions.js
🧰 Additional context used
🪛 Biome
bigbluebutton-tests/playwright/chat/chat.spec.js
[error] 28-28: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
[error] 33-33: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
[error] 62-62: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
[error] 78-78: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
bigbluebutton-tests/playwright/learningdashboard/learningdashboard.spec.js
[error] 37-37: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
bigbluebutton-tests/playwright/sharednotes/sharednotes.spec.js
[error] 26-26: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
🔇 Additional comments (97)
bigbluebutton-tests/playwright/screenshare/screenshare.spec.js (4)
5-5: LGTM: Addition of '@ci' tag aligns with PR objectives.The addition of the '@ci' tag to the 'Screenshare' test suite declaration is a positive change. This modification ensures that the entire suite will be included in CI runs, which aligns perfectly with the PR's objective of enabling all tests to run in the Continuous Integration environment.
Line range hint
1-21: Summary of changes and action itemsThe changes to this file generally align well with the PR objectives. The addition of the '@ci' tag to the entire 'Screenshare' test suite and the removal of individual '@ci' tags from test cases are positive improvements. However, there are two points that require your attention:
The simplification of the Firefox skip condition: Please verify that removing the
process.env.DISPLAYcheck doesn't have unintended consequences for different test execution environments.The removal of the '@flaky' tag: Please clarify if the 'Start screenshare stops external video' test is no longer considered flaky, and if it is, consider reintroducing the '@flaky' tag.
These clarifications will ensure that the changes fully meet the PR objectives while maintaining the integrity of the test suite.
16-16: Clarify the removal of the '@flaky' tag.The removal of the '@ci' tag is appropriate as the entire suite is now tagged for CI. However, the '@flaky' tag has also been removed.
Could you please clarify if this test is no longer considered flaky? If it's still flaky, consider reintroducing the '@flaky' tag. To help with this decision, let's check the test's recent performance:
#!/bin/bash # Description: Check recent test results for 'Start screenshare stops external video' # Note: This assumes you're using a CI system that stores test results and has a CLI tool to query them. # Replace 'ci-tool' with your actual CI tool's command, and adjust the query as needed. ci-tool query-test-results --test-name "Start screenshare stops external video" --last-runs 10Please review the results of this query to determine if the test has been stable in recent runs, justifying the removal of the '@flaky' tag.
7-9: Verify the impact of simplifying the Firefox skip condition.The removal of the individual '@ci' tag is appropriate given that the entire suite is now tagged. However, the simplification of the Firefox skip condition warrants further investigation.
Please run the following script to check for any other occurrences of
process.env.DISPLAYin the test files:This will help us ensure that the removal of the
process.env.DISPLAYcheck is consistent across the test suite and doesn't introduce any unintended consequences.bigbluebutton-tests/playwright/reconnection/reconnection.spec.js (1)
5-5: Approve the addition of the '@flaky' tag.The addition of the '@flaky' tag to the test suite is a good practice. It aligns with the PR objectives to tag all tests for CI and helps identify potentially unreliable tests.
To ensure consistency, let's verify if this tag is applied to other flaky tests:
✅ Verification successful
Verified that the '@flaky' tag is consistently applied across all relevant test files.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for '@flaky' tag usage across test files # Test: Search for '@flaky' tag in test files rg --type js -g '*.spec.js' -g '*.test.js' -n '@flaky'Length of output: 2336
bigbluebutton-tests/playwright/options/options.spec.js (3)
10-10: LGTM: Test suite tagged for CI executionThe addition of
{ tag: '@ci' }to the test suite declaration aligns well with the PR objective of enabling all tests to run in the CI environment. This change will ensure that the entire "Options" test suite is included in CI runs.
34-34: Approved: Simplified test declaration for "Font size"The removal of the
{ tag: ['@ci', '@flaky'] }configuration object simplifies the test declaration, improving maintainability. This change is in line with the PR objective of reducing flaky tests.To ensure the test's stability, please verify that the "Font size" test consistently passes in the CI environment. You can run the following command to check the test's recent performance:
This script will fetch the last 10 CI runs and display the results of the "Font size" test, helping you confirm its stability.
30-30: Approved: Simplified test declaration for "Dark mode"The removal of the
{ tag: ['@ci', '@flaky'] }configuration object simplifies the test declaration, which is good for maintainability. This change aligns with the PR objective of reducing flaky tests.To ensure the test's stability, please verify that the "Dark mode" test consistently passes in the CI environment. You may want to run the following command to check the test's recent performance:
This script will fetch the last 10 CI runs and display the results of the "Dark mode" test, helping you confirm its stability.
bigbluebutton-tests/playwright/core/constants.js (2)
Line range hint
1-27: Summary: Changes align with PR objectivesThe modifications to this file, including the addition of
PARAMETER_HIDE_PRESENTATION_TOASTand the removal ofUSER_LIST_VLIST_BOTS_LISTENING, align well with the PR objectives of improving test configurations and clarity. These changes contribute to better management of test environments and potentially more reliable snapshot comparisons.To further improve the testing framework, consider:
- Implementing a more robust solution for removing elements during tests, as suggested earlier.
- Documenting the purpose and usage of each constant in this file to enhance maintainability.
- Reviewing the entire test suite to ensure all constants are being used effectively and consistently.
Line range hint
1-27: Verify the impact of removed constantThe AI summary mentions the removal of
USER_LIST_VLIST_BOTS_LISTENINGconstant. While this removal doesn't affect the code in this file, it's important to ensure it doesn't break any tests or functionality elsewhere in the codebase.Please run the following script to check for any remaining references to the removed constant:
If the script returns any results, those occurrences should be updated or removed to maintain consistency with this change.
bigbluebutton-tests/playwright/whiteboard/deleteDrawing.js (3)
14-14: LGTM: Improved code readability with descriptive comment.The added comment "draw an arrow" clearly explains the purpose of the following code block, enhancing the test's readability and maintainability.
20-22: Excellent addition: Verifying preconditions improves test reliability.The new checks for the existence of the drawn arrow on both moderator and user pages are crucial. They ensure that the test's precondition (arrow exists) is met before proceeding to test the deletion functionality. This addition significantly enhances the test's reliability and helps prevent false negatives that could occur if the arrow wasn't drawn successfully.
Line range hint
1-30: Overall excellent improvements to test reliability and clarity.The changes made to this file significantly enhance the
DeleteDrawingtest by:
- Adding clear comments that explain each step of the test.
- Introducing checks to verify the precondition (arrow exists) before testing deletion.
- Confirming the test's outcome (arrow deleted) from both moderator and user perspectives.
These improvements align well with the PR objectives of enhancing test clarity and reliability in CI environments. The test is now more robust and less likely to produce false results, which will contribute to more stable CI runs.
bigbluebutton-tests/playwright/package.json (1)
8-9: LGTM! Changes align well with PR objectives.The modifications to the
test-chromium-ciandtest-firefox-ciscripts are well-implemented and consistent with the PR's goals. The additional grep-invert filters (@need-update,@only-headed,@setting-required) effectively categorize tests that require special handling or updates. This change supports the objective of running more tests in CI while providing clear reasons for skipping certain tests.These modifications contribute to the reported increase in the percentage of tests tagged for CI execution (from 83.6% to 94.6%) mentioned in the PR objectives.
bigbluebutton-tests/playwright/stress/stress.spec.js (3)
Line range hint
1-36: Summary: Good progress on test organization and clarityOverall, the changes to this file align well with the PR objectives of tagging tests and providing clear reasons for test execution or skipping. The addition of the CI-related comment at the beginning of the file is particularly helpful.
Key points:
- The CI-skip comment clearly indicates that stress tests are not for CI environments.
- The use of
test.fixmefor the breakout room invitation test aligns with the goal of identifying tests needing updates.- The overall structure of the test suite is logical and well-organized.
Suggestions for further improvement:
- Consider setting a specific timeout for stress tests instead of disabling it entirely.
- Add a comment explaining the reason for the
test.fixmeon the breakout room invitation test.- Verify and add appropriate CI execution tags to all tests in this file.
These changes will further enhance the clarity and maintainability of the test suite, fully aligning with the PR's objectives.
Line range hint
20-36: Verify CI execution tags for stress testsThe "Joining users at the same time" test group appears well-structured and covers important stress scenarios. However, given the PR's objective of tagging tests for CI execution, it's important to ensure these tests are appropriately tagged.
To confirm if these tests are correctly tagged for CI execution (or exclusion), you could run the following command:
#!/bin/bash # Description: Check for CI execution tags in stress tests # Test: Search for CI-related tags or comments in the stress test file rg -i '@ci|@need-update|@only-headed|@setting-required' bigbluebutton-tests/playwright/stress/stress.spec.jsThis will help verify if the stress tests are properly tagged according to the new system introduced in this PR. If no tags are found, consider adding appropriate tags to these tests to clearly indicate their intended execution environment.
7-8: Consider setting a specific timeout for stress testsThe current
beforeEachhook sets the timeout to 0, which effectively disables the timeout for all tests in this suite. While stress tests may require longer execution times, it's generally a good practice to set a reasonable upper limit to prevent indefinitely hanging tests.Consider setting a specific, generous timeout instead of disabling it entirely. For example:
- test.beforeEach(async () => test.setTimeout(0)); + test.beforeEach(async () => test.setTimeout(300000)); // 5 minutesThis change would still allow for long-running stress tests while providing a safety net against indefinitely hanging tests.
To verify the typical duration of these stress tests, you could run the following command:
This script will help determine appropriate timeout values based on historical test execution times.
bigbluebutton-tests/playwright/learningdashboard/learningdashboard.spec.js (4)
7-7: LGTM: Centralized CI tagging for the test suiteThe addition of
{ tag: '@ci' }to thetest.describefunction is a good practice. It centralizes the CI tagging for the entire Learning Dashboard test suite, which aligns with the PR objective of enabling all tests to run in CI. This approach is more maintainable than tagging individual tests.
24-24: LGTM: Removed redundant CI tagThe removal of the individual
{ tag: '@ci' }from the 'Polls' test case is appropriate. This change reduces redundancy and improves maintainability, as the entire suite is now tagged for CI at thetest.describelevel.
29-29: LGTM: Removed redundant CI tagThe removal of the individual
{ tag: '@ci' }from the 'Basic Infos' test case is appropriate. This change is consistent with the centralized tagging approach and improves the overall maintainability of the test suite.
33-33: LGTM: Removed redundant CI tagThe removal of the individual
{ tag: '@ci' }from the 'Overview' test case is appropriate. This change aligns with the centralized tagging strategy and contributes to a more maintainable test suite.bigbluebutton-tests/playwright/sharednotes/sharednotes.spec.js (5)
6-6: LGTM: Tagging the entire test suite for CI.Adding the
tag: '@ci'to the entire test suite is a good practice. It aligns with the PR objective of tagging all tests to run in CI, improving organization and execution control.
14-14: LGTM: Removed redundant CI tag from individual test.Removing the
tag: '@ci'from this test case is appropriate since the entire suite is now tagged for CI. This change reduces redundancy and simplifies the test declaration.
18-18: LGTM: Removed redundant CI tag from individual test.Removing the
tag: '@ci'from this test case is consistent with the changes made to other tests. It maintains the simplified structure across the test suite.
30-30: LGTM: Removed redundant CI tag from individual test.Removing the
tag: '@ci'from this test case is consistent with the changes made to other tests. It maintains the simplified structure across the test suite.
Line range hint
1-47: Overall assessment: Changes align well with PR objectives.The modifications in this file effectively contribute to the PR's goals by:
- Tagging the entire test suite for CI execution, which improves organization and control.
- Removing redundant
@citags from individual tests, simplifying the code.- Maintaining important tags like
@flakyto identify unstable tests.- Adding issue links for better context on test flakiness.
These changes enhance the clarity and maintainability of the test suite. The minor suggestions provided (fixing a typo, removing an empty object pattern, and adding a comment for the flaky test) will further improve the code quality.
🧰 Tools
🪛 Biome
[error] 26-26: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
bigbluebutton-tests/playwright/audio/audio.spec.js (2)
6-6: LGTM: Appropriate tagging for CI executionThe addition of
{ tag: '@ci' }to the entiretest.describeblock is a good approach. It ensures all tests in this suite are tagged for CI execution, aligning with the PR's objective of increasing test coverage in CI.
Line range hint
1-48: Overall assessment: Positive changes that align with PR objectivesThe modifications in this file effectively contribute to the PR's goal of tagging all tests for CI execution. By moving the CI tag to the suite level and removing redundant tags from individual tests, the code becomes more maintainable without sacrificing coverage. These changes should help streamline the CI process and improve overall test organization.
bigbluebutton-tests/playwright/connectionStatus/connectionStatus.spec.js (1)
4-4: LGTM: Improved test suite configurationMoving the tag parameter inside the
test.describe.parallelcall enhances code readability and aligns with the PR objective of tagging all tests for CI execution.bigbluebutton-tests/playwright/polling/polling.spec.js (1)
64-66: Removal of '@flaky' tag from 'Poll results on whiteboard' testThe '@flaky' tag has been removed from this test case, which aligns with the PR objective of improving test tagging and reducing the number of flaky tests. This change contributes to the reported increase in the percentage of tests tagged for CI execution.
However, to ensure clarity and maintain a comprehensive testing strategy:
- Could you provide context on why this test is no longer considered flaky?
- Have there been any changes to the underlying functionality or test environment that have improved the test's stability?
- Is there a related issue or documentation that explains the rationale behind this change?
To verify if there are any recent changes related to this test or the whiteboard functionality, we can run the following script:
✅ Verification successful
Verified removal of '@flaky' tag from 'Poll results on whiteboard' test
The recent updates to the polling tests, including the removal of old steps and behavioral changes, indicate that the flakiness issue has been addressed. This justifies the removal of the '@flaky' tag and aligns with the PR objective of enhancing test stability and increasing the percentage of tests tagged for CI execution.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check for recent changes related to whiteboard polling # Search for recent commits mentioning 'whiteboard' and 'poll' in the commit message or changed files git log -n 10 --pretty=format:"%h - %s" --name-only | grep -iE 'whiteboard|poll' # Check for any recent changes in the whiteboard component git log -n 5 --oneline -- bigbluebutton-html5/imports/ui/components/whiteboard/ # Look for any open issues related to whiteboard polling gh issue list --label "component: whiteboard" --search "in:title poll"Length of output: 2381
bigbluebutton-tests/playwright/webcam/webcam.spec.js (4)
5-5: LGTM: CI tag added to test suiteAdding the
@citag to the entiretest.describe.parallelblock is a good practice. It ensures that all tests within this suite are included in the CI pipeline, aligning with the PR's objective of enabling all tests to run in CI.
7-7: LGTM: Removed redundant CI tagsThe removal of individual
{ tag: '@ci' }parameters from these test cases is appropriate. Since the entiretest.describe.parallelblock is now tagged with@ci, these individual tags became redundant. This change improves code maintainability and clarity.Also applies to: 19-19, 25-25
46-46: LGTM: Removed redundant CI tagThe removal of the
{ tag: '@ci' }parameter from the 'Disable Self-view' test case is appropriate. This change is consistent with the earlier modifications and helps maintain a clean and efficient test structure.
Line range hint
1-74: Overall assessment: Improved test organization and CI integrationThe changes made to this file significantly improve the organization and clarity of the webcam test suite. By adding the
@citag to the entiretest.describe.parallelblock and removing redundant tags from individual tests, the code becomes more maintainable. The addition of the@flakytag for the video quality test, along with the explanatory comment, enhances transparency regarding test reliability.These modifications align well with the PR objectives of enabling all tests to run in CI and providing clear reasons for any skipped or problematic tests. The changes contribute to better test management and will likely improve the efficiency of the CI pipeline.
bigbluebutton-tests/playwright/connectionFailure/connectionFailure.spec.js (2)
8-10: Informative comment addedThe added comment provides valuable context about why the entire test suite is skipped in CI. This information is crucial for understanding the test suite's behavior and potential issues in different environments.
34-36: Consistent improvement in skip conditionThe changes in this segment are consistent with the modifications made in the "Screen share" test:
- The simplified skip condition for Firefox browsers improves clarity.
- The added comment explains the reason for skipping the test in Firefox.
As suggested in the previous comment, consider updating the comment text for consistency and precision.
bigbluebutton-tests/playwright/notifications/notifications.js (2)
Line range hint
15-17: Review impact of removed notification clearing calls.Several methods (
saveSettingsNotification,audioNotification,getUserJoinPopupResponse) have had calls toutil.waitAndClearDefaultPresentationNotification(this.modPage)removed. While this change is not directly visible in the provided diff, it's important to verify that removing these calls doesn't introduce any timing issues or unexpected behavior in the tests.Please review the following aspects:
- Check if any race conditions have been introduced.
- Ensure that notifications are properly handled and don't interfere with subsequent test steps.
- Verify that the tests still accurately represent the expected user experience.
Run the following script to analyze the usage of
waitAndClearDefaultPresentationNotification:#!/bin/bash # Description: Analyze usage of waitAndClearDefaultPresentationNotification # Search for any remaining usage of the function echo "Searching for remaining usage of waitAndClearDefaultPresentationNotification:" rg --type js "waitAndClearDefaultPresentationNotification" -A 5 # Search for potential new methods handling default presentation notifications echo "Searching for potential new methods handling default presentation notifications:" rg --type js "defaultPresentationNotification" -A 5Review the output to ensure that default presentation notifications are still properly handled throughout the test suite.
Also applies to: 25-27, 33-35
55-55: Improved method functionality, verify impact on test suite.The change to return the result of
this.modPage.wasRemoved(e.reactionsButton)enhances the method's functionality by providing a boolean value indicating whether the reactions button was removed. This is a good improvement as it allows for more precise assertions in tests.To ensure this change doesn't introduce any unintended side effects, please verify the usage of
raiseAndLowerHandNotification()method in other parts of the test suite. Run the following script to check for any potential issues:Review the output to ensure that all calls to
raiseAndLowerHandNotification()are still valid and that any assertions on its return value are updated if necessary.bigbluebutton-tests/playwright/chat/chat.spec.js (12)
3-6: LGTM: Removal of unused importThe removal of the
linkIssueimport is appropriate if it's no longer used in this file. This change helps in keeping the imports clean and relevant.
15-15: LGTM: Removal of redundant CI tagThe removal of the
tag: '@ci'from this test declaration is appropriate. The entiretest.describeblock on line 6 is already tagged with '@ci', which applies to all tests within it. This change reduces redundancy while maintaining the CI execution intent.
20-20: LGTM: Consistent tag removalThe removal of the
tag: '@ci'from this test declaration is consistent with the previous change and the describe block tagging on line 6.
24-25: LGTM: Consistent tag removalThe removal of the
tag: '@ci'from this test declaration maintains consistency with the previous changes and the describe block tagging on line 6.
28-29: Great improvement: Enhanced test flexibility and clarityThis change significantly improves the test structure:
- The new
@only-headedtag clearly categorizes tests with headless environment limitations.- The conditional skip using
test.skip(testInfo.project.use.headless, ...)provides a clear reason for skipping in headless mode.- This approach allows the test to run in headed mode while being properly handled in CI environments.
These modifications align well with the PR objectives of improving test categorization and providing clear reasons for skipped tests.
🧰 Tools
🪛 Biome
[error] 28-28: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
33-33: LGTM: Consistent tag removalThe removal of the
tag: '@ci'from this test declaration maintains consistency with the previous changes and the describe block tagging on line 6.🧰 Tools
🪛 Biome
[error] 33-33: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
37-37: LGTM: Consistent tag removalThe removal of the
tag: '@ci'from this test declaration maintains consistency with the previous changes and the describe block tagging on line 6.
42-42: LGTM: Consistent tag removalThe removal of the
tag: '@ci'from this test declaration maintains consistency with the previous changes and the describe block tagging on line 6.
50-50: Excellent update: Improved test description and categorizationThis change enhances the test in two ways:
- The updated description "Send emoji on public chat using emoji picker" provides more specificity about the test's purpose.
- The new tag
@setting-required:chat.emojiPickerclearly indicates that this test requires the emoji picker feature to be enabled.These modifications align well with the PR objectives of improving test categorization and clarity.
58-58: LGTM: Consistent tag removalThe removal of the
tag: '@ci'from this test declaration maintains consistency with the previous changes and the describe block tagging on line 6.
62-82: Excellent improvements: Enhanced test categorizationThese changes significantly improve the test suite organization:
- The new tags
@setting-required:chat.emojiPickerand@setting-required:chat.autoConvertEmojiclearly indicate which settings are required for each test.- This categorization allows for better test filtering and execution based on available features.
- The consistency in applying these tags across multiple tests enhances the overall structure of the test suite.
These modifications align perfectly with the PR objectives of improving test categorization and clarity, making it easier to manage and execute tests based on specific feature availability.
🧰 Tools
🪛 Biome
[error] 62-62: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
[error] 78-78: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
Line range hint
1-90: Overall assessment: Significant improvements to test suite organization and clarityThe changes made to this file collectively represent a substantial improvement to the test suite:
- Consistent removal of redundant '@ci' tags, relying on the describe block tag.
- Introduction of new tags like '@only-headed', '@setting-required:chat.emojiPicker', and '@setting-required:chat.autoConvertEmoji' for better test categorization.
- Improved handling of tests with headless environment limitations.
- Enhanced test descriptions and comments providing context for changes.
These modifications align excellently with the PR objectives, resulting in a more organized, clear, and maintainable test suite. The changes will facilitate easier test filtering, execution, and maintenance based on specific feature availability and environmental constraints.
🧰 Tools
🪛 Biome
[error] 28-28: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
[error] 33-33: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
[error] 62-62: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
[error] 78-78: Unexpected empty object pattern.
(lint/correctness/noEmptyPattern)
bigbluebutton-tests/playwright/options/options.js (1)
88-88: Approve: Improved test consistency, but verify screenshot comparison.The relocation of
setHeightWidthViewPortSize()to an earlier point in the method is a good change. It ensures that the viewport size is standardized before proceeding with the font size test, which should lead to more consistent test results.However, please verify that:
- The screenshot comparison in the subsequent steps still works as expected with this change.
- The test documentation is updated if necessary to reflect this change in the test flow.
To ensure that this change doesn't unexpectedly affect other parts of the codebase, please run the following verification:
bigbluebutton-tests/playwright/breakout/breakout.spec.js (2)
1-1: LGTM: Improved test traceabilityThe addition of the
linkIssueimport from the helpers module is a good practice. It allows for better documentation of known issues associated with specific tests, enhancing traceability and making it easier for developers to understand the context of flaky or problematic tests.
Line range hint
1-150: Overall assessment: Positive improvements to test suiteThe changes made to this file contribute positively to the test suite's organization and documentation. The addition of the
linkIssueimport and its usage in the "Export breakout room shared notes" test case improves traceability and provides better context for flaky tests. The modifications align well with the PR objectives of enhancing test clarity and streamlining CI execution.No major issues were identified during this review. The changes are approved with a minor suggestion for additional context in the comment for issue #21321.
bigbluebutton-tests/playwright/notifications/notifications.spec.js (8)
6-7: Improved imports for better code organizationThe changes to the imports are beneficial:
- Destructuring
recordMeetingfrom constants makes it clear which specific constant is being used in this file.- Adding the
linkIssueimport suggests improved issue tracking capabilities in the tests.These changes contribute to better code organization and maintainability.
43-47: Consistent improvements in test setupThe changes in this test case are consistent with the improvements made in the previous 'Public Chat notification' test:
- Removal of the
@flakytag indicates improved stability.- Closing toast notifications ensures a clean state before the test runs.
- The
initPagesmethod call has been updated consistently.These changes should contribute to more reliable and maintainable tests.
55-55: Consistent use of imported constant and improved readabilityThe changes in the 'Recording' test suite are positive:
- Consistent use of the
recordMeetingconstant across all test cases, aligning with the import change at the file's beginning.- Addition of empty lines between test cases enhances readability and follows good coding practices.
These changes contribute to more maintainable and easier-to-read test code.
Also applies to: 58-58, 61-61, 64-64, 67-67, 70-70
71-73: New test case for recording modalThe addition of the 'Modal appearing when user wants to start recording' test case is a positive change:
- It expands test coverage for recording-related functionality.
- The test setup is consistent with other test cases in the 'Recording' block, maintaining code consistency.
This new test should help ensure the reliability of the recording start modal feature.
78-83: Consistent improvements in Presenter test setupThe changes in the 'Presenter' test suite align with improvements seen in other parts of the file:
- Removal of the
@flakytag suggests increased test stability.- Updating the
initPagesmethod call and adding toast notification cleanup are consistent with earlier changes.- These modifications should lead to more reliable test execution and easier maintenance.
The consistency in applying these improvements across different test suites is commendable.
92-94: Consistent test setup improvementsThe changes in the 'Presentation upload notification' test setup are in line with improvements seen throughout the file:
- Updating the
initPagesmethod call is consistent with earlier changes.- Adding toast notification cleanup for both
modPageanduserPageshould improve test stability.These consistent improvements across different test cases contribute to a more reliable and maintainable test suite.
88-90: Improved documentation for flaky testThe additions to the 'Presentation upload notification' test are beneficial:
- The comment provides valuable context about why the test is marked as flaky.
- Using
linkIssue(21321)creates a clear reference to the related GitHub issue.These changes enhance the test's documentation and traceability. However, consider the following:
- Investigate the root cause of the flakiness described in issue #21321.
- Create a plan to address the underlying issue to potentially remove the
@flakytag in the future.Run the following script to check for any recent updates or comments on the linked issue:
✅ Verification successful
Flaky test behavior confirmed
The issue #21321 related to the 'Presentation upload notification' flakiness has been confirmed. Ongoing investigations are addressing the root cause.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Fetch the latest comments on the issue gh issue view 21321 --json comments --jq '.comments[-5:][].body'Length of output: 330
34-39: Improved test stability and setupThese changes enhance the test suite:
- Removal of the
@flakytag indicates improved test stability.- Closing toast notifications before each test ensures a clean state, potentially reducing test flakiness.
However, the change in the
initPagesmethod call warrants verification:Please confirm that the
initPagesmethod signature has been updated to no longer require thetrueparameter. Run the following script to check the method definition:bigbluebutton-tests/playwright/presentation/presentation.spec.js (7)
5-5: LGTM: Good practice to import constants.The addition of
PARAMETER_HIDE_PRESENTATION_TOASTfrom a centralized constants file is a good practice. It promotes consistency and makes it easier to manage configuration parameters across the project.
40-40: LGTM: Consistent use ofhidePresentationToast.The update to use
hidePresentationToastin theinitModPagecall ensures consistency with the new parameter implementation. This change aligns well with the overall modifications in the file.
59-60: LGTM: Consistent application ofhidePresentationToast.The updates to both
initModPageandinitUserPagecalls ensure that thehidePresentationToastparameter is consistently applied for both moderator and user pages. This change maintains consistency across different user roles in the test.
104-104: LGTM: Improved test description.The updated test description "Enable and disable original presentation download" is more specific and clearly communicates the test's purpose. This change enhances the readability and understanding of the test suite.
110-114: LGTM: Valuable new test case added.The addition of this test case for sending annotated presentations to chat for downloading is a great improvement. It covers an important feature and helps ensure that annotations are correctly included when sharing presentations.
116-116: LGTM: Corrected test description.The update from "Remove all presentation" to "Remove all presentations" corrects a minor grammatical error. This change improves the clarity and accuracy of the test description.
130-130: LGTM: Consistent use ofhidePresentationToast.The update to use
hidePresentationToastin theinitModPagecall ensures consistency with the new parameter implementation. This change aligns well with the overall modifications in the file and maintains consistency across different tests.bigbluebutton-tests/playwright/parameters/constants.js (1)
43-43: Verify the new custom style URL and document the change.The update to the
customStyleUrlconstant looks good. However, please ensure the following:
- Verify that the new URL 'https://dev30.bigbluebutton.org/css-test-file.css' is correct and accessible.
- Check if any tests relying on this constant need to be updated or if their behavior will change with this new CSS file.
- Consider adding a comment explaining the reason for this change (e.g., if it's related to a specific environment or version update).
To verify the accessibility of the new URL and its content, you can run the following script:
This script will help ensure that the new URL is accessible, compare its content with the old URL, and find any tests that might be affected by this change.
bigbluebutton-tests/playwright/whiteboard/whiteboard.spec.js (4)
20-20: LGTM: New helper function import for issue linking.The addition of the
linkIssueimport is a good practice. It allows for better traceability between test cases and known issues, which can help in managing and resolving bugs more effectively.
104-104: Clarify the removal of '@ci' tag from 'Change Shapes Styles' describe block.The
@citag has been removed from this test describe block. This change might affect how these tests are executed in the CI pipeline.Could you please clarify the reasoning behind this change? Are these tests intended to be excluded from CI runs, or is there a different strategy for tagging tests at a more granular level?
134-134: Explain the removal of '@flaky' tag from 'Delete drawing' test.The
@flakytag has been removed from this test case. This suggests that the test may have become more stable.Could you provide more information about this change?
- Has the underlying issue causing flakiness been resolved?
- Were there any modifications to the test or the system under test that improved its stability?
This context would be helpful for understanding the evolution of the test suite.
141-141: Clarify the removal of '@ci' tags from 'Undo drawing' and 'Redo drawing' tests.The
@citags have been removed from both the 'Undo drawing' and 'Redo drawing' test cases. This change is consistent with the earlier removal of the@citag from the 'Change Shapes Styles' describe block.Could you please explain the strategy behind removing these tags? Is this part of a broader change in how tests are tagged and executed in CI?
This information would help in understanding the overall approach to test organization and execution in the CI pipeline.
Also applies to: 148-148
bigbluebutton-tests/playwright/user/user.spec.js (4)
106-106: Removal of@citag approved.The removal of the
@citag from the "Guest policy" test suite declaration aligns with the PR objective. This change is approved as it doesn't affect the test functionality and contributes to the streamlining of the test suite.
165-165: Removal of@citag approved.The removal of the
@citag from the "Lock viewers" test suite declaration is in line with the PR objective. This change is approved as it maintains consistency with other changes and doesn't impact the test functionality.
215-220: Removal of@flakytag approved, verify test stability.The removal of the
@flakytag from the "Lock see other viewers annotations" test aligns with the PR objective of reducing the number of flaky tests. This change is approved.To ensure the test's stability, consider running the following verification script:
#!/bin/bash # Description: Verify the stability of the "Lock see other viewers annotations" test # Test: Run the specific test multiple times for i in {1..10}; do npx playwright test -g "Lock see other viewers annotations" --project=chromium if [ $? -ne 0 ]; then echo "Test failed on iteration $i" exit 1 fi done echo "All test runs passed successfully"This script will run the test 10 times and report any failures, helping to confirm that the test is no longer flaky.
Line range hint
97-101: Removal of@flakytag approved, verify test stability.The removal of the
@flakytag from this test aligns with the PR objective of reducing the number of flaky tests. This change is approved.To ensure the test's stability, consider running the following verification script:
This script will run the test 10 times and report any failures, helping to confirm that the test is no longer flaky.
bigbluebutton-tests/playwright/user/multiusers.js (1)
102-102: Typo correction in assertion messageThe assertion message has been corrected from "should the attende be presenter" to "should the attendee be presenter". This improves the clarity of the test output.
bigbluebutton-tests/playwright/polling/poll.js (3)
Line range hint
1-377: Overall assessment of changes to the Polling classThe modifications to the
Pollingclass, particularly in thepollResultsOnWhiteboardmethod, align with the PR objective of tagging tests for CI execution. The simplification of the test case by removing editing functionality focuses the test on core polling behavior.Key points:
- The changes improve test efficiency and potentially reduce flakiness in CI environments.
- Ensure that the removal of editing functionality doesn't create gaps in test coverage.
- Consider updating related documentation and other test files if necessary.
These changes contribute to the overall goal of increasing the percentage of tests tagged for CI execution, as mentioned in the PR objectives.
The changes are approved, pending the results of the verification steps suggested in previous comments.
Line range hint
1-377: Consider updating class documentation and related testsWhile the main change is in the
pollResultsOnWhiteboardmethod, it's important to ensure that this modification doesn't affect other parts of thePollingclass or related tests. Consider the following:
- Update the class documentation (if any) to reflect the removal of editing functionality for poll results on the whiteboard.
- Review other methods in the class that might have depended on or referenced the removed editing functionality.
- Ensure that the test coverage for the
Pollingclass is still comprehensive after this change.Let's check for any references to poll editing in the rest of the file:
#!/bin/bash # Search for references to poll editing in the Polling class rg --type js 'edit.*poll|poll.*edit' bigbluebutton-tests/playwright/polling/poll.jsAdditionally, let's check for any related tests that might need updating:
#!/bin/bash # Search for related test files that might need updating fd -e js -e ts poll bigbluebutton-tests/playwright/ | xargs rg 'pollResultsOnWhiteboard|edit.*poll|poll.*edit'
Line range hint
270-277: Simplified poll result verification on whiteboardThe
pollResultsOnWhiteboardmethod has been streamlined to focus solely on verifying the presence of the poll result shape on the whiteboard. The editing functionality and related assertions have been removed, which aligns with the PR objective of tagging tests for CI execution.However, consider the following:
- The removal of editing functionality might impact test coverage. Ensure this change is intentional and doesn't leave any critical functionality untested.
- The comment on line 276 could be more descriptive. Consider updating it to reflect the exact expectation, e.g., "should display one additional rectangle shape with the poll result on the whiteboard".
Consider updating the comment on line 276 for clarity:
- await expect(wbDrawnRectangleLocator,'should display a rectangle shape with the poll result on the whiteboard').toHaveCount(initialWbDrawnRectangleCount + 1); + await expect(wbDrawnRectangleLocator,'should display one additional rectangle shape with the poll result on the whiteboard').toHaveCount(initialWbDrawnRectangleCount + 1);To ensure no critical functionality is left untested, let's check for any related tests or TODO comments:
✅ Verification successful
Verification Successful: No Critical Functionality Left Untested
The removal of editing functionality in the
pollResultsOnWhiteboardmethod has been confirmed. No related tests or TODO comments regarding poll result editing were found, ensuring that the changes align with the PR objectives without impacting test coverage.🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Search for related tests or TODO comments regarding poll result editing rg --type js 'pollResultsOnWhiteboard|poll.*edit|TODO.*poll.*edit' bigbluebutton-tests/Length of output: 196
Script:
#!/bin/bash # Search for related tests or TODO comments regarding poll result editing rg --type js 'pollResultsOnWhiteboard|poll.*edit|TODO.*poll.*edit' bigbluebutton-tests/Length of output: 581
bigbluebutton-tests/playwright/chat/chat.js (5)
38-38: Approved: Text correction improves clarityThe change from "attende" to "attendee" in the assertion message improves the readability and accuracy of the test description.
264-264: Approved: Comment text correctionThe change from "attende" to "attendee" in the comment improves the clarity of the test description.
367-367: Approved: Consistent text correctionThe change from "attende" to "attendee" in the comment maintains consistency with previous corrections and improves overall clarity.
385-387: Approved: Multiple text corrections for consistencyThe changes from "attende" to "attendee" in comments and assertion messages improve the overall consistency and clarity of the test descriptions.
Line range hint
1-387: Overall: Consistent improvements in text clarityThe changes in this file are solely focused on correcting the spelling of "attendee" throughout the test descriptions and comments. These corrections enhance the readability and professionalism of the code without altering any functionality. The consistency of these changes across the file is commendable.
bigbluebutton-tests/playwright/core/elements.js (2)
402-402: Improved selector for whiteboard cursor indicatorThe updated selector for
whiteboardCursorIndicatoris more specific and targets an SVG 'use' element. This change likely improves the reliability of selecting the whiteboard cursor indicator in tests.
Line range hint
1-594: Overall assessment of changesThe modifications to this file enhance the robustness and coverage of the test selectors. The changes to existing selectors (
whiteboardCursorIndicatorandwbDelete) improve specificity and flexibility, while the addition of thewbDrawnArrowselector supports testing of a new feature.These updates will likely lead to more reliable and comprehensive tests. The suggestions provided for adding
data-testattributes could further improve the maintainability and reliability of the test suite.bigbluebutton-tests/playwright/user/lockViewers.js (7)
5-5: [Approved] Importing new constant for presentation toastThe addition of
PARAMETER_HIDE_PRESENTATION_TOASTto the import statement is appropriate and aligns with its usage in the code.
8-8: [Approved] ImportingencodeCustomParamsutility functionThe import of
encodeCustomParamsfrom../parameters/utilis necessary for encoding custom parameters used later in the script.
11-11: [Approved] DefininghidePresentationToastparameterThe definition of
hidePresentationToastusingencodeCustomParamsis correct and properly prepares the parameter for usage.
175-177: Verify the reducedmaxDiffPixelsvalue in screenshot optionsReducing
maxDiffPixelsto250inscreenshotOptionsmay lead to flaky tests if minor rendering differences exceed this threshold. Ensure that this value accommodates acceptable visual differences without causing false negatives.
191-191: [Approved] Hiding cursor during screenshotHovering over
e.chatButtonto hide the cursor from the screenshot is a valid approach to ensure consistent screenshots.
198-198: [Approved] Ensuring cursor is not visible in screenshotHovering over
e.chatButtonto prevent the cursor from appearing in the screenshot is appropriate.
211-211: [Approved] Verifying display of new annotations after unlockingThe steps to check if new annotations are displayed after unlocking the user are correctly implemented.
bigbluebutton-tests/playwright/presentation/presentation.js (2)
124-130: Approved: Correct implementation of image URL retrievalThe code correctly retrieves the image URL of the second presentation for later comparison. This ensures that the presentation has been updated successfully.
416-437: Approved: Correctly verifying toolbar visibility for moderator and userThe code accurately checks that the whiteboard toolbar is hidden for the moderator and remains visible for the user after toggling the tool visibility option. The assertions and screenshot comparisons are correctly implemented.
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (6)
bigbluebutton-tests/playwright/playwright.config.js (2)
Line range hint
7-19: Consider improving configuration readability and flexibility.The configuration could be enhanced for better maintainability:
const config = { - workers: CI ? 1 : 2, + // Limit workers in CI to prevent resource contention + workers: CI ? process.env.CI_WORKERS || 1 : 2, timeout: 3 * 60 * 1000, - reporter: CI - ? [['blob'], ['./custom-reporter.js']] - : [['list'], ['html', { open: 'never' }], + // Configure reporters based on environment + reporter: [ + ...(CI ? [['blob'], ['./custom-reporter.js']] : [['list']]), + ['html', { open: 'never' }], ], reportSlowTests: null, forbidOnly: CI, fullyParallel: CI || isParallel, use: { headless: true, trace: 'on', screenshot: 'on', + // Retain videos only on failure in CI to save storage video: CI ? 'retain-on-failure' : 'on', },
Line range hint
42-42: Consider making retry count configurable.The retry count is hardcoded to 1 for CI environments. Consider making this configurable through an environment variable.
-if (CI) config.retries = 1; +if (CI) config.retries = parseInt(process.env.CI_TEST_RETRIES || '1', 10);bigbluebutton-tests/playwright/screenshare/screenshare.spec.js (1)
7-10: Improve skip message clarityThe skip message could be more precise and grammatically correct.
Consider this improvement:
- test.skip(browserName === 'firefox', - 'Screenshare tests not able in Firefox browser without desktop', + test.skip(browserName === 'firefox', + 'Screenshare tests require desktop environment in Firefox',bigbluebutton-tests/playwright/core/constants.js (1)
26-27: Enhance comment readability with structured format.While the comment provides valuable information, its readability could be improved.
Consider this structure:
-// it only works for snapshot comparisons. playwright assertions will complain about the element (still in the DOM) +// NOTE: This parameter only affects visual snapshot comparisons. +// WARNING: Playwright assertions may still detect the hidden elements as they remain in the DOM. exports.PARAMETER_HIDE_PRESENTATION_TOAST = 'userdata-bbb_custom_style=.presentationUploaderToast{display: none;}.currentPresentationToast{display:none;}';bigbluebutton-tests/playwright/presentation/presentation.js (2)
121-127: Consider extracting the image URL logic into a helper function.The image URL extraction logic is duplicated multiple times throughout the file. Consider refactoring it into a helper function to improve maintainability and reduce code duplication.
+const getWhiteboardImageURL = async (page) => { + return page.evaluate(() => { + const element = document.querySelector('div[id="whiteboard-element"] div[class="tl-image"]'); + const style = element.getAttribute('style') + const urlMatch = style.match(/background-image: url\("([^"]+)"\)/); + return urlMatch ? urlMatch[1] : null; + }); +}; + const imageURLSecondPresentation = await this.modPage.page.evaluate(() => { const element = document.querySelector('div[id="whiteboard-element"] div[class="tl-image"]'); const style = element.getAttribute('style') const urlMatch = style.match(/background-image: url\("([^"]+)"\)/); return urlMatch ? urlMatch[1] : null; });
417-420: Fix indentation for consistency.The indentation of the
screenshotOptionsobject is inconsistent with the surrounding code.- const screenshotOptions = { - maxDiffPixels: 1000, - }; + const screenshotOptions = { + maxDiffPixels: 1000, + };
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (4)
bigbluebutton-tests/playwright/options/options.spec.js-snapshots/moderator-page-dark-mode-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/options/options.spec.js-snapshots/moderator-page-font-size-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/mod-hide-toolbars-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/user-toolbars-Chromium-linux.pngis excluded by!**/*.png
📒 Files selected for processing (10)
bigbluebutton-tests/playwright/core/constants.js(2 hunks)bigbluebutton-tests/playwright/core/elements.js(4 hunks)bigbluebutton-tests/playwright/playwright.config.js(1 hunks)bigbluebutton-tests/playwright/presentation/presentation.js(4 hunks)bigbluebutton-tests/playwright/presentation/presentation.spec.js(2 hunks)bigbluebutton-tests/playwright/screenshare/screenshare.spec.js(1 hunks)bigbluebutton-tests/playwright/whiteboard/drawEllipse.js(2 hunks)bigbluebutton-tests/playwright/whiteboard/drawLine.js(0 hunks)bigbluebutton-tests/playwright/whiteboard/drawRectangle.js(0 hunks)bigbluebutton-tests/playwright/whiteboard/drawTriangle.js(0 hunks)
💤 Files with no reviewable changes (3)
- bigbluebutton-tests/playwright/whiteboard/drawLine.js
- bigbluebutton-tests/playwright/whiteboard/drawRectangle.js
- bigbluebutton-tests/playwright/whiteboard/drawTriangle.js
🚧 Files skipped from review as they are similar to previous changes (3)
- bigbluebutton-tests/playwright/core/elements.js
- bigbluebutton-tests/playwright/presentation/presentation.spec.js
- bigbluebutton-tests/playwright/whiteboard/drawEllipse.js
🔇 Additional comments (6)
bigbluebutton-tests/playwright/playwright.config.js (2)
3-3: LGTM! Good practice to centralize the CI constant.
The centralization of the CI constant improves maintainability and ensures consistent CI environment detection across all test files.
Line range hint 7-19: LGTM! CI-specific configurations are well thought out.
The configuration adjustments for CI environments are appropriate:
- Single worker prevents resource contention
- Blob reporter is suitable for CI
- Restricted video retention helps with storage
bigbluebutton-tests/playwright/screenshare/screenshare.spec.js (1)
5-5: LGTM! Good addition of CI tag
The addition of the @ci tag aligns with the PR's objective to properly tag tests for CI execution. The documentation reference in the comment is helpful.
bigbluebutton-tests/playwright/core/constants.js (1)
Line range hint 1-5: LGTM! Well-structured timeout configuration.
The implementation provides good flexibility for different environments while maintaining consistent timeout scaling.
Let's verify the usage of the new CI constant across the test suite:
✅ Verification successful
CI constant is properly integrated and used effectively
The CI constant is well utilized in the Playwright configuration (playwright.config.js) to control critical test behaviors:
- Configures worker count (1 for CI, 2 for local)
- Sets appropriate reporters for different environments
- Controls parallel execution and retries
- Manages video capture settings
- Prevents
test.only()usage in CI
The implementation provides good environment-specific optimizations while maintaining consistent behavior across the test suite.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check usage of CI constant in test files
# Expected: CI constant should be used for conditional test execution or timeout adjustments
# Search for CI constant usage in test files
rg -l "CI\s*[!=]==?\s*(?:true|false)" --type js
# Search for potential hardcoded timeout multipliers that should use CI constant
rg "TIMEOUT_MULTIPLIER.*=.*[0-9]+" --type js
Length of output: 96
Script:
#!/bin/bash
# Let's try a different approach to find CI constant usage
# First, let's check direct imports or requires of the constants file
rg -l "require.*constants" --type js
# Then check for actual usage of CI variable
rg "const.*CI.*=.*process\.env\.CI" --type js
rg "exports\.CI" --type js
# Also check for TIMEOUT_MULTIPLIER usage
rg "const.*TIMEOUT_MULTIPLIER.*=.*process\.env" --type js
rg "exports\.TIMEOUT_MULTIPLIER" --type js
Length of output: 5424
Script:
#!/bin/bash
# Let's check how the constants file is used in the test files
# First, check the playwright config which might set up these constants globally
cat bigbluebutton-tests/playwright/playwright.config.js
# Then check a few test files that require the constants to see usage patterns
rg -A 5 "require.*constants" bigbluebutton-tests/playwright/core/page.js
rg -A 5 "require.*constants" bigbluebutton-tests/playwright/webcam/webcam.js
rg -A 5 "require.*constants" bigbluebutton-tests/playwright/whiteboard/whiteboard.spec.js
Length of output: 2143
bigbluebutton-tests/playwright/presentation/presentation.js (2)
370-370: LGTM! Good addition of explicit wait.
Adding an explicit wait for the whiteboard element improves test reliability by ensuring the element is present before proceeding with the test.
414-433: LGTM! Well-structured test improvements.
The changes improve the test by:
- Adding explicit element visibility checks
- Standardizing screenshot options
- Clearly separating moderator and user checks
- test occcasionally failing due to bigbluebutton#21624 - add check for presentationItem
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
bigbluebutton-html5/imports/ui/components/presentation/presentation-uploader/component.jsx (1)
874-874: LGTM! Consider adding data-test attributes to child elements.The addition of the
data-testattribute is appropriate and aligns with the PR's objective of improving test coverage.For better test maintainability, consider also adding specific
data-testattributes to key child elements within the presentation item, such as:<Radio + data-test="presentationItemRadio" animations={animations} ... /> <Styled.TableItemName + data-test="presentationItemName" colSpan={!isActualCurrent ? 2 : 0} >
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (4)
bigbluebutton-tests/playwright/options/options.spec.js-snapshots/moderator-page-dark-mode-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/options/options.spec.js-snapshots/moderator-page-font-size-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/mod-hide-toolbars-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/user-toolbars-Chromium-linux.pngis excluded by!**/*.png
📒 Files selected for processing (4)
bigbluebutton-html5/imports/ui/components/presentation/presentation-uploader/component.jsx(1 hunks)bigbluebutton-tests/playwright/core/elements.js(5 hunks)bigbluebutton-tests/playwright/presentation/presentation.js(5 hunks)bigbluebutton-tests/playwright/presentation/presentation.spec.js(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (3)
- bigbluebutton-tests/playwright/core/elements.js
- bigbluebutton-tests/playwright/presentation/presentation.js
- bigbluebutton-tests/playwright/presentation/presentation.spec.js
- both tests relied only on snapshot assertions, which is not performing properly with the font mainly - this commit adds many element assertions and avoids snapshot comparisons in CI environments
…losing all notifications - the try/catch is intended to avoid throwing error when playwright tries to close the toast but in between that it self-disappears
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (7)
bigbluebutton-tests/playwright/user/guestPolicy.js (1)
Line range hint
1-116: Add test tags to align with PR objectives.According to the PR objectives, tests should be tagged to indicate their execution status in CI (e.g.,
@need-update,@only-headed,@setting-required). However, this file lacks these tags. Please add appropriate tags to each test method to clarify their CI execution requirements.Example implementation:
class GuestPolicy extends MultiUsers { // ... + // @only-headed - Requires UI interaction with lobby message async messageToGuestLobby() { // ... } + // @setting-required - Requires guest policy configuration async allowEveryone() { // ... } // Add similar tags to other test methods }bigbluebutton-tests/playwright/core/elements.js (2)
327-327: Consider using a test-specific video URL.The hardcoded YouTube URL might make tests brittle if the video becomes unavailable. Consider using a dedicated test video or mocking the video player.
-exports.youtubeLink = 'https://www.youtube.com/watch?v=Wjx5_IONaNg&t=158s&ab_channel=BigBlueButton'; +exports.youtubeLink = 'https://www.youtube.com/watch?v=test-video-id';
480-480: Consider using a more specific selector for delete button.The current selector using
title^="Delete"might be fragile across different languages. Consider using a data-test attribute instead.-exports.wbDelete = 'button[title^="Delete"]'; +exports.wbDelete = 'button[data-test="deleteButton"]';bigbluebutton-tests/playwright/options/options.js (4)
80-89: Avoid reusing variable names to prevent confusion.In the
.map()function, the parametereshadows the imported modulee. Consider renaming the parameter to avoid confusion.Apply this diff to rename the parameter:
-].map(e => this.modPage.getLocator(e)); +].map(selector => this.modPage.getLocator(selector));
119-127: Consider refactoring repeated code to improve maintainability.The code block for taking screenshots when not in CI is similar in both
darkMode()andfontSizeTest()methods. Consider refactoring this code into a helper function to avoid duplication.
134-134: UseparseFloatfor parsing font sizes to handle units correctly.Instead of slicing the string and converting it to a number, consider using
parseFloat(getComputedStyle(node).fontSize)for better robustness, especially if the units might change.Apply this diff:
-const getFontSizeNumber = (node) => Number(getComputedStyle(node).fontSize.slice(0, -2)); +const getFontSizeNumber = (node) => parseFloat(getComputedStyle(node).fontSize);
157-164: Consider refactoring repeated code to improve maintainability.The code for handling screenshots when not in CI is duplicated from the
darkMode()method. Refactoring this into a shared helper function would enhance maintainability.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (1)
bigbluebutton-tests/playwright/options/options.spec.js-snapshots/moderator-page-dark-mode-Chromium-linux.pngis excluded by!**/*.png
📒 Files selected for processing (8)
bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/component.tsx(1 hunks)bigbluebutton-html5/imports/ui/components/user-list/component.jsx(1 hunks)bigbluebutton-tests/playwright/core/elements.js(8 hunks)bigbluebutton-tests/playwright/core/page.js(1 hunks)bigbluebutton-tests/playwright/notifications/notifications.js(3 hunks)bigbluebutton-tests/playwright/options/options.js(2 hunks)bigbluebutton-tests/playwright/presentation/presentation.js(5 hunks)bigbluebutton-tests/playwright/user/guestPolicy.js(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/component.tsx
🚧 Files skipped from review as they are similar to previous changes (2)
- bigbluebutton-tests/playwright/notifications/notifications.js
- bigbluebutton-tests/playwright/presentation/presentation.js
🔇 Additional comments (11)
bigbluebutton-html5/imports/ui/components/user-list/component.jsx (1)
34-34: LGTM! The data-test attribute addition aligns with testing best practices.
The addition of data-test="userListContainer" improves component testability and aligns with the PR's objective of enhancing test coverage.
Let's verify the consistency of this test attribute naming across the codebase:
✅ Verification successful
The data-test attribute is consistently used and referenced in test files
The verification shows that:
- The
data-test="userListContainer"attribute is properly defined in the component - It's correctly referenced in the test elements file (
bigbluebutton-tests/playwright/core/elements.js) - No inconsistent naming patterns were found for similar user list test attributes
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for consistent usage of the userListContainer test attribute
# and related test selectors across the codebase
# Check for other occurrences of this test attribute
echo "Checking for userListContainer data-test attribute usage:"
rg -g '*.{jsx,js}' 'data-test="userListContainer"'
# Check for related test selectors in test files
echo -e "\nChecking for userListContainer selector usage in tests:"
rg -g '*.{spec,test}.{js,jsx,ts,tsx}' 'userListContainer'
# Check for any potential inconsistent naming patterns
echo -e "\nChecking for similar but potentially inconsistent naming patterns:"
rg -g '*.{jsx,js}' 'data-test=".*user.*list.*"'
Length of output: 795
bigbluebutton-tests/playwright/user/guestPolicy.js (1)
69-69: LGTM! Variable name typo fix.
The correction of inputPrivateLobbyMessage fixes the typo in the variable name, making it consistent with the definition in elements.js.
bigbluebutton-tests/playwright/core/page.js (1)
310-315: Verify the notification handling across test suite
Let's ensure these changes improve test stability and don't introduce any regressions.
✅ Verification successful
Sleep delay after closing toast notification is reasonable
The changes to notification handling in the test suite are appropriate and well-integrated:
- The
closeAllToastNotifications()method is consistently used across multiple test files (presentation, notifications, options, layouts) - The 1-second sleep after closing toast is reasonable considering:
- It matches the expected animation time for toast disappearance
- No existing test failures related to toast notifications were found
- The error handling gracefully continues if the toast is already gone
The implementation uses standard selectors (toastContainer, smallToastMsg, toastDownload) and follows established patterns across the test suite.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check usage of closeAllToastNotifications and potential race conditions
# Find all test files using closeAllToastNotifications
echo "Files using closeAllToastNotifications:"
rg "closeAllToastNotifications" --type js
# Check for potential race conditions with notifications
echo -e "\nPotential race conditions (checking for notification-related waits):"
rg "waitForSelector.*toast|waitFor.*toast" --type js
# Look for any existing notification-related test failures
echo -e "\nExisting notification-related test failures:"
rg "toast.*fail|notification.*fail" --type js
Length of output: 4378
Script:
#!/bin/bash
# Let's examine the implementation and usage of notification handling
# Check the implementation of closeAllToastNotifications
echo "Implementation of closeAllToastNotifications:"
ast-grep --pattern 'async closeAllToastNotifications() {
$$$
}'
# Check for toast-related selectors and constants
echo -e "\nToast-related selectors and constants:"
rg "toast" bigbluebutton-tests/playwright/core/elements.js
# Check for other notification closing patterns
echo -e "\nOther notification closing patterns:"
rg "click.*toast|toast.*close" --type js
Length of output: 874
bigbluebutton-tests/playwright/core/elements.js (6)
102-102: LGTM! Selector uses data-test attribute.
The chatMessageItem selector follows the best practice of using data-test attributes.
135-135: LGTM! Consistent naming with related selectors.
The inputPrivateLobbyMessage selector maintains consistency with other lobby-related selectors.
157-157: LGTM! Clear and specific container selector.
The userListContainer selector follows the container naming pattern used throughout the file.
304-306: LGTM! Well-structured presentation selectors.
The new presentation selectors follow the established pattern and use data-test attributes consistently.
406-406: LGTM! More specific SVG selector.
The whiteboardCursorIndicator selector has been updated to be more specific by targeting the SVG use element.
496-496: LGTM! Consistent naming with other shape selectors.
The wbDrawnArrow selector follows the same pattern as other shape-type selectors.
bigbluebutton-tests/playwright/options/options.js (2)
4-6: New imports are appropriate and necessary.
The added imports CI and sleep are correctly imported and utilized in the code.
64-67: Sending chat message enhances dark mode verification.
Including a chat message ensures that text elements are available to test style changes when switching to dark mode.
|
This pull request has conflicts ☹ |
|
This pull request has conflicts ☹ |
- wb tests update due to toolbar removal (redo, undo, delete, and duplicate buttons) - snapshots update
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Outside diff range and nitpick comments (4)
bigbluebutton-tests/playwright/whiteboard/deleteDrawing.js (2)
14-24: Consider adding error handling and retry mechanism.The test might be flaky in slow network conditions where whiteboard sync between users takes longer than expected. Consider:
- Adding timeout and retry mechanism for the drawing operation
- Adding error handling for cases where drawing fails
Example implementation:
async test() { await this.modPage.waitForSelector(e.whiteboard, ELEMENT_WAIT_LONGER_TIME); const modWbLocator = this.modPage.getLocator(e.whiteboard); const wbBox = await modWbLocator.boundingBox(); + // Retry drawing operation if it fails + const maxAttempts = 3; + let attempt = 0; + while (attempt < maxAttempts) { + try { // draw an arrow await this.modPage.waitAndClick(e.wbArrowShape); await this.modPage.page.mouse.move(wbBox.x + 0.3 * wbBox.width, wbBox.y + 0.3 * wbBox.height); await this.modPage.page.mouse.down(); await this.modPage.page.mouse.move(wbBox.x + 0.7 * wbBox.width, wbBox.y + 0.7 * wbBox.height); await this.modPage.page.mouse.up(); // check existence of the drawn arrow await this.modPage.hasElement(e.wbDrawnArrow); await this.userPage.hasElement(e.wbDrawnArrow); + break; + } catch (error) { + attempt++; + if (attempt === maxAttempts) throw new Error(`Failed to draw arrow after ${maxAttempts} attempts: ${error.message}`); + await this.modPage.wait(1000); // Wait before retry + } + }
Line range hint
5-8: Add test tags as per PR objectives.The PR aims to tag all tests for CI execution. Consider adding appropriate tags to this test class to indicate its CI execution status (e.g.,
@ci,@only-headed, etc.).Example implementation:
+/** + * @ci + */ class DeleteDrawing extends MultiUsers { constructor(browser, page) { super(browser, page); }bigbluebutton-tests/playwright/options/options.js (2)
109-117: Improve error messages for color change assertionsThe current error messages are generic. Consider making them more specific by including the actual and expected colors.
-expect.soft(userListContainerBackgroundColor).not.toEqual(await userListContainerLocator.evaluate(getBackgroundColorComputed), 'should the user list container background color be changed'); +const newUserListContainerColor = await userListContainerLocator.evaluate(getBackgroundColorComputed); +expect.soft(userListContainerBackgroundColor).not.toEqual(newUserListContainerColor, + `User list container background color should change from ${userListContainerBackgroundColor} to a different color, got ${newUserListContainerColor}`);
153-155: Improve error messages for font size assertionsMake the error messages more specific by including the actual and expected font sizes.
-expect.soft(await presentationTitleLocator.evaluate(getFontSizeNumber)).toBeGreaterThan(presentationTitleFontSize, 'should the presentation title font size be increased'); +const newPresentationTitleSize = await presentationTitleLocator.evaluate(getFontSizeNumber); +expect.soft(newPresentationTitleSize).toBeGreaterThan(presentationTitleFontSize, + `Presentation title font size should increase from ${presentationTitleFontSize}px, got ${newPresentationTitleSize}px`);
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
⛔ Files ignored due to path filters (5)
bigbluebutton-tests/playwright/options/options.spec.js-snapshots/moderator-page-dark-mode-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/mod-hide-toolbars-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/presentation/presentation.spec.js-snapshots/user-toolbars-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/user/user.spec.js-snapshots/viewer2-new-arrow-Chromium-linux.pngis excluded by!**/*.pngbigbluebutton-tests/playwright/user/user.spec.js-snapshots/viewer2-previous-shapes-Chromium-linux.pngis excluded by!**/*.png
📒 Files selected for processing (7)
bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/component.tsx(1 hunks)bigbluebutton-tests/playwright/core/elements.js(7 hunks)bigbluebutton-tests/playwright/options/options.js(2 hunks)bigbluebutton-tests/playwright/package.json(2 hunks)bigbluebutton-tests/playwright/presentation/presentation.js(5 hunks)bigbluebutton-tests/playwright/whiteboard/deleteDrawing.js(1 hunks)bigbluebutton-tests/playwright/whiteboard/whiteboard.spec.js(4 hunks)
🚧 Files skipped from review as they are similar to previous changes (4)
- bigbluebutton-html5/imports/ui/components/chat/chat-graphql/chat-message-list/page/chat-message/component.tsx
- bigbluebutton-tests/playwright/whiteboard/whiteboard.spec.js
- bigbluebutton-tests/playwright/presentation/presentation.js
- bigbluebutton-tests/playwright/core/elements.js
🔇 Additional comments (3)
bigbluebutton-tests/playwright/whiteboard/deleteDrawing.js (1)
21-22: LGTM! Good addition of existence checks.
The new verification steps improve test reliability by ensuring the arrow exists for both moderator and user before proceeding with deletion.
bigbluebutton-tests/playwright/options/options.js (2)
108-108: 🛠️ Refactor suggestion
Replace fixed delay with explicit wait for dark mode transition
The fixed delay of 500ms could make tests flaky. Instead, wait for the dark mode transition to complete.
-await sleep(500); // wait for the changes to be applied
+await this.modPage.page.waitForFunction(() => {
+ // Wait for dark mode class to be applied and styles to be computed
+ const body = document.querySelector('body');
+ return getComputedStyle(body).backgroundColor !== 'rgb(255, 255, 255)';
+});152-152: 🛠️ Refactor suggestion
Replace fixed delay with explicit wait for font size changes
The fixed delay of 500ms could make tests flaky. Instead, wait for the font size changes to complete.
-await sleep(500); // wait for the changes to be applied
+await this.modPage.page.waitForFunction(
+ ({ selector, originalSize }) => {
+ const element = document.querySelector(selector);
+ return element && parseFloat(getComputedStyle(element).fontSize) > originalSize;
+ },
+ { selector: e.presentationTitle, originalSize: presentationTitleFontSize }
+);There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
bigbluebutton-tests/playwright/screenshare/screenshare.spec.js (1)
8-10: Consider enhancing the skip messageWhile the skip condition has been appropriately simplified, the skip message could be more specific about why Firefox requires desktop access for screenshare tests (e.g., "Firefox requires X11 display server for screen sharing capabilities").
- 'Screenshare tests not able in Firefox browser without desktop', + 'Firefox requires X11 display server for screen sharing capabilities',
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
bigbluebutton-tests/playwright/presentation/presentation.spec.js(1 hunks)bigbluebutton-tests/playwright/screenshare/screenshare.spec.js(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- bigbluebutton-tests/playwright/presentation/presentation.spec.js
🔇 Additional comments (4)
bigbluebutton-tests/playwright/screenshare/screenshare.spec.js (4)
3-3: LGTM! Import added as requested
The linkIssue import has been correctly added, addressing the previous review comment.
5-5: LGTM! CI tag added appropriately
The @ci tag has been added to the test suite, aligning with the PR's objective to clearly identify tests that should run in CI.
16-18: LGTM! Well-documented test limitations
The changes effectively:
- Tag the test as flaky
- Document the requirement for a logged user in CI
- Link to the relevant issue for context
This aligns perfectly with the PR's objective of providing clear reasons for test limitations.
1-22: Verify documentation of removed mobile tests
The removal of mobile-related tests has contributed to the reduction in total test count (287 to 280). Let's verify if this is tracked appropriately.
bf2a44e to
af8dfd8
Compare
|
Automated tests Summary✅ All the CI tests have passed! |




What does this PR do?
This PR aims to enable all tests in CI. As there are cases where we don't expect the tests to pass in CI, instead of simply adding
@flaky, I've commented close to the test declaration the reason for skipping them + linking the issue.StressandReconnectiontests, for instance, are not intended to run in the CI environment - I've also added a comment explaining that. In order to also make it clearer, I've created a few more tags that will be skipped in CI:@need-update: The feature tested is likely to be working correctly, but the test needs to be updated;@only-headed: Tests with headless limitation action, such as copying content to the clipboard;@setting-required: Followed by its required setting, tests that depend on a config without an override solution provided (to be guaranteed when running it). As we've discussed the possibility of adding parameters for those settings-needed cases like this one, once we introduce a solution it will be easy to find and update them.@ci@flaky@need-update@only-headed@setting-required@flaky+ untagged = 67 (23.3%)More
Detail changes: