Skip to content

Commit

Permalink
Merge pull request bigbluebutton#21348 from antonbsa/ci-tests-tagging
Browse files Browse the repository at this point in the history
test(ci): Tag all tests to run in CI + add reason when skipping in the code
  • Loading branch information
antonbsa authored Dec 9, 2024
2 parents 1586bf0 + af8dfd8 commit 9290573
Show file tree
Hide file tree
Showing 84 changed files with 426 additions and 459 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -530,6 +530,7 @@ const ChatMessage = React.forwardRef<ChatMessageRef, ChatMessageProps>(({
$focused={focused}
$keyboardFocused={keyboardFocused}
$reactionPopoverIsOpen={isToolbarReactionPopoverOpen}
data-test="chatMessageItem"
>
<ChatMessageToolbar
keyboardFocused={keyboardFocused}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,7 @@ class PresentationUploader extends Component {
error={hasError}
animated={isProcessing}
animations={animations}
data-test="presentationItem"
>
<Styled.SetCurrentAction>
<Radio
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class UserList extends PureComponent {
const logoUrl = DarkModeIsEnabled ? CustomDarkLogoUrl : CustomLogoUrl;

return (
<Styled.UserList>
<Styled.UserList data-test="userListContainer">
{
showBranding
&& !compact
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1336,6 +1336,7 @@ const Whiteboard = React.memo((props) => {
useElement.setAttribute('href', '#redPointer');
} else if (useElement) {
useElement.setAttribute('href', '#cursor');
useElement.setAttribute('data-test', 'whiteboardCursorIndicator');
}

const idsToRemove = [];
Expand Down
14 changes: 7 additions & 7 deletions bigbluebutton-tests/playwright/audio/audio.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const { fullyParallel } = require('../playwright.config');
const { Audio } = require('./audio');
const { initializePages } = require('../core/helpers');

test.describe('Audio', () => {
test.describe('Audio', { tag: '@ci' }, () => {
const audio = new Audio();

test.describe.configure({ mode: fullyParallel ? 'parallel' : 'serial' });
Expand All @@ -12,12 +12,12 @@ test.describe('Audio', () => {
});

// https://docs.bigbluebutton.org/2.6/release-tests.html#listen-only-mode-automated
test('Join audio with Listen Only', { tag: '@ci' }, async () => {
test('Join audio with Listen Only', async () => {
await audio.joinAudio();
});

// https://docs.bigbluebutton.org/2.6/release-tests.html#join-audio-automated
test('Join audio with Microphone', { tag: '@ci' }, async () => {
test('Join audio with Microphone', async () => {
await audio.joinMicrophone();
});

Expand All @@ -26,23 +26,23 @@ test.describe('Audio', () => {
});

// https://docs.bigbluebutton.org/2.6/release-tests.html#muteunmute
test('Mute yourself by clicking the mute button', { tag: '@ci' }, async () => {
test('Mute yourself by clicking the mute button', async () => {
await audio.muteYourselfByButton();
});

// https://docs.bigbluebutton.org/2.6/release-tests.html#choosing-different-sources
test('Keep the last mute state after rejoining audio', { tag: '@ci' }, async () => {
test('Keep the last mute state after rejoining audio', async () => {
await audio.keepMuteStateOnRejoin();
});

// Talking Indicator
// https://docs.bigbluebutton.org/2.6/release-tests.html#talking-indicator
test('Mute yourself by clicking the talking indicator', { tag: '@ci' }, async () => {
test('Mute yourself by clicking the talking indicator', async () => {
await audio.muteYourselfByTalkingIndicator();
});

// https://docs.bigbluebutton.org/2.6/release-tests.html#talking-indicator
test('Mute another user by clicking the talking indicator', { tag: '@ci' }, async () => {
test('Mute another user by clicking the talking indicator', async () => {
await audio.muteAnotherUser();
});
});
12 changes: 6 additions & 6 deletions bigbluebutton-tests/playwright/chat/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class Chat extends MultiUsers {
await this.userPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element when opening a private chat');
// check sent messages
await this.modPage.hasText(e.chatUserMessageText, e.message1, 'should display the message sent by the moderator');
await this.userPage.hasText(e.chatUserMessageText, e.message1, 'should display the message sent by the moderator for the attende');
await this.userPage.hasText(e.chatUserMessageText, e.message1, 'should display the message sent by the moderator for the attendee');
// userPage send message
await this.userPage.type(e.chatBox, e.message2);
await this.modPage.hasElement(e.typingIndicator, 'should display the typing indicator for the moderator');
Expand Down Expand Up @@ -261,7 +261,7 @@ class Chat extends MultiUsers {
await this.modPage.waitAndClick(e.sendButton);
await this.userPage.waitUntilHaveCountSelector(e.chatButton, 2);
await this.userPage.waitAndClickElement(e.chatButton, 1);
await this.userPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element when the attende opens the private chat');
await this.userPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element when the attendee opens the private chat');
// check sent messages
await this.modPage.hasText(e.chatUserMessageText, e.frequentlyUsedEmoji, 'should display the emoji sent by the moderator on the private chat');
await this.userPage.hasText(e.chatUserMessageText, e.frequentlyUsedEmoji, 'should display for the user the emoji sent by the moderator on the private chat');
Expand Down Expand Up @@ -364,7 +364,7 @@ class Chat extends MultiUsers {
}
await this.userPage.waitUntilHaveCountSelector(e.chatButton, 2);
await this.userPage.waitAndClickElement(e.chatButton, 1);
await this.userPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element for the attende when the private chat is opened');
await this.userPage.hasElement(e.hidePrivateChat, 'should display the hide private chat element for the attendee when the private chat is opened');
// check sent messages
await checkLastMessageSent(this.modPage, e.convertedEmojiMessage);
await checkLastMessageSent(this.userPage, e.convertedEmojiMessage);
Expand All @@ -382,9 +382,9 @@ class Chat extends MultiUsers {
await openPrivateChat(this.modPage);
await this.modPage.hasElement(e.sendButton, 'should display the send button on the private chat');
await this.userPage.logoutFromMeeting();
await this.modPage.hasElement(e.partnerDisconnectedMessage, 'should the attende be disconnected', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.wasRemoved(e.sendButton, 'should the send button be removed because the attende left the meeting');
}
await this.modPage.hasElement(e.partnerDisconnectedMessage, 'should the attendee be disconnected', ELEMENT_WAIT_LONGER_TIME);
await this.modPage.wasRemoved(e.sendButton, 'should the send button be removed because the attendee left the meeting');
}
}

exports.Chat = Chat;
42 changes: 21 additions & 21 deletions bigbluebutton-tests/playwright/chat/chat.spec.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
const { test } = require('../fixtures');
const { fullyParallel } = require('../playwright.config');
const { linkIssue, initializePages } = require('../core/helpers');
const { initializePages } = require('../core/helpers');
const { Chat } = require('./chat');

test.describe('Chat', () => {
test.describe('Chat', { tag: '@ci' }, () => {
const chat = new Chat();

test.describe.configure({ mode: fullyParallel ? 'parallel' : 'serial' });
Expand All @@ -12,80 +12,80 @@ test.describe('Chat', () => {
});

// https://docs.bigbluebutton.org/2.6/release-tests.html#public-message-automated
test('Send public message', { tag: '@ci' }, async () => {
test('Send public message', async () => {
await chat.sendPublicMessage();
});

// https://docs.bigbluebutton.org/2.6/release-tests.html#private-message-automated
test('Send private message', { tag: '@ci' }, async () => {
test('Send private message', async () => {
await chat.sendPrivateMessage();
});

test('Clear chat', { tag: '@ci' }, async () => {
test('Clear chat', async () => {
await chat.clearChat();
});

test.skip('Copy chat', async () => {
test('Copy chat', { tag: '@only-headed' }, async ({}, testInfo) => {
test.skip(testInfo.project.use.headless, 'Only works in headed mode');
await chat.copyChat();
});

test('Save chat', { tag: '@ci' }, async ({}, testInfo) => {
test('Save chat', async ({}, testInfo) => {
await chat.saveChat(testInfo);
});

test('Verify character limit', { tag: '@ci' }, async () => {
test('Verify character limit', async () => {
await chat.characterLimit();
});

// https://docs.bigbluebutton.org/2.6/release-tests.html#sending-empty-chat-message-automated
test('Not able to send an empty message', { tag: '@ci' }, async () => {
test('Not able to send an empty message', async () => {
await chat.emptyMessage();
});

test('Copy and paste public message', async () => {
linkIssue('15948');
await chat.copyPastePublicMessage();
})

test('Send emoji on public chat', { tag: '@ci' }, async () => {
test('Send emoji on public chat using emoji picker', { tag: '@setting-required:chat.emojiPicker' }, async () => {
await chat.sendEmoji();
});

test.skip('Copy chat with emoji', async () => {
// Only works in headed mode
test('Copy chat with emoji', { tag: '@only-headed' }, async () => {
await chat.emojiCopyChat();
});

test('Close private chat', { tag: '@ci' }, async () => {
test('Close private chat', async () => {
await chat.closePrivateChat();
});

test('Save chat with emoji', { tag: '@ci' }, async ({}, testInfo) => {
test('Save chat with emoji', { tag: '@setting-required:chat.emojiPicker' }, async ({}, testInfo) => {
await chat.emojiSaveChat(testInfo);
});

test('Send emoji on private chat', async () => {
test('Send emoji on private chat', { tag: '@setting-required:chat.emojiPicker' }, async () => {
await chat.emojiSendPrivateChat();
});

test('Send auto converted emoji on public chat', async () => {
test('Send auto converted emoji on public chat', { tag: '@setting-required:chat.autoConvertEmoji' }, async () => {
await chat.autoConvertEmojiPublicChat();
});

test.skip('Copy chat with auto converted emoji', async () => {
test('Copy chat with auto converted emoji', { tag: '@setting-required:chat.autoConvertEmoji' }, async () => {
await chat.autoConvertEmojiCopyChat();
});

test('Auto convert emoji save chat', async ({}, testInfo) => {
test('Auto convert emoji save chat', { tag: '@setting-required:chat.autoConvertEmoji' }, async ({}, testInfo) => {
await chat.autoConvertEmojiSaveChat(testInfo);
});

test('Send auto converted emoji on private chat', async () => {
test('Send auto converted emoji on private chat', { tag: '@setting-required:chat.autoConvertEmoji' }, async () => {
await chat.autoConvertEmojiSendPrivateChat();
});

// failure only reproducible in CI (user leaves but keeps shown in the mod user list)
test('Private chat disabled when user leaves meeting', { tag: ['@ci', '@flaky'] }, async () => {
//! flaky flag recently removed in order to see current behavior
test('Private chat disabled when user leaves meeting', { tag: '@ci' }, async () => {
await chat.chatDisabledUserLeaves();
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ const e = require('../core/elements');
const { getCurrentTCPSessions, killTCPSessions } = require('./util');
const deepEqual = require('deep-equal');

// @ci Note: This entire test suite is skipped in CI because killing TCP connection
// might result in loss of connection with github server, causing the test to fail

test.describe.parallel('Connection failure', () => {
// https://docs.bigbluebutton.org/2.6/release-tests.html#sharing-screen-in-full-screen-mode-automated
test('Screen sharer', async ({ browser, browserName, page }) => {
test('Screen share', async ({ browser, browserName, page }) => {
await checkRootPermission(); // check sudo permission before starting test
test.skip(browserName === 'firefox' && process.env.DISPLAY === undefined,
"Screenshare tests not able in Firefox browser without desktop");
test.skip(browserName === 'firefox',
"Screenshare tests not able in Firefox browser without desktop",
);
const screenshare = new ScreenShare(browser, page);
await screenshare.init(true, true);
await screenshare.startSharing();
Expand All @@ -27,8 +31,9 @@ test.describe.parallel('Connection failure', () => {

test('Screen share viewer', async ({ browser, browserName, page, context }) => {
await checkRootPermission(); // check sudo permission before starting test
test.skip(browserName === 'firefox' && process.env.DISPLAY === undefined,
"Screenshare tests not able in Firefox browser without desktop");
test.skip(browserName === 'firefox',
"Screenshare tests not able in Firefox browser without desktop",
);
const screenshare = new MultiUserScreenShare(browser, context);

await screenshare.initModPage(page);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
const { test } = require('../fixtures');
const { ConnectionStatus } = require('./connectionStatus');

test.describe.parallel('Connection Status', () => {
test('Open connection Status Modal', { tag: '@ci' }, async ({ browser, context, page }) => {
test.describe.parallel('Connection Status', { tag: '@ci' } , () => {
test('Open connection Status Modal', async ({ browser, context, page }) => {
const connectionStatus = new ConnectionStatus(browser, context);
await connectionStatus.initModPage(page);
await connectionStatus.connectionStatusModal();
});

test('Show network data in Connection Status', { tag: '@ci' }, async ({ browser, context, page }) => {
test('Show network data in Connection Status', async ({ browser, context, page }) => {
const connectionStatus = new ConnectionStatus(browser, context);
await connectionStatus.initModPage(page);
await connectionStatus.usersConnectionStatus();
});

test('Report a User with bad connection in Connection Issues', { tag: ['@ci', '@flaky'] }, async ({ browser, context, page }) => {
test('Report a User with bad connection in Connection Issues', { tag: '@need-update' }, async ({ browser, context, page }) => {
// The following test emulates a bad connection with a custom event
// PR #19289 changed the way it's measured, not able to do so with a custom event anymore
const connectionStatus = new ConnectionStatus(browser, context);
await connectionStatus.initModPage(page);
await connectionStatus.reportUserInConnectionIssues();
});

test('Redirect to data saving settings when a bad connection is detected', { tag: ['@ci', '@flaky'] }, async ({ browser, context, page }) => {
test('Redirect to data saving settings when a bad connection is detected', { tag: '@need-update' }, async ({ browser, context, page }) => {
// The following test emulates a bad connection with a custom event
// PR #19289 changed the way it's measured, not able to do so with a custom event anymore
const connectionStatus = new ConnectionStatus(browser, context);
await connectionStatus.initModPage(page);
await connectionStatus.linkToSettingsTest();
});

test('Copy stats', async ({ browser, context, page }, testInfo) => {
test.fixme(testInfo.project.use.headless, 'Only works in headed mode');
test('Copy stats', { tag: '@only-headed' }, async ({ browser, context, page }, testInfo) => {
test.skip(testInfo.project.use.headless, 'Only works in headed mode');
const connectionStatus = new ConnectionStatus(browser, context);
await connectionStatus.initModPage(page);
await connectionStatus.copyStatsTest(context);
Expand Down
3 changes: 2 additions & 1 deletion bigbluebutton-tests/playwright/core/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ const CI = process.env.CI === 'true';
const TIMEOUT_MULTIPLIER = Number(process.env.TIMEOUT_MULTIPLIER);
const MULTIPLIER = CI ? TIMEOUT_MULTIPLIER || 2 : TIMEOUT_MULTIPLIER || 1;

exports.CI = CI;
// GLOBAL TESTS VARS
exports.ELEMENT_WAIT_TIME = 5000 * MULTIPLIER;
exports.ELEMENT_WAIT_LONGER_TIME = 10000 * MULTIPLIER;
exports.ELEMENT_WAIT_EXTRA_LONG_TIME = 15000 * MULTIPLIER;
exports.LOOP_INTERVAL = 1200;
exports.USER_LIST_VLIST_BOTS_LISTENING = 50;

// STRESS TESTS VARS
exports.JOIN_AS_MODERATOR_TEST_ROUNDS = 15;
Expand All @@ -23,4 +23,5 @@ exports.VIDEO_LOADING_WAIT_TIME = 15000;
exports.UPLOAD_PDF_WAIT_TIME = 25000 * MULTIPLIER;

exports.CUSTOM_MEETING_ID = 'custom-meeting';
// it only works for snapshot comparisons. playwright assertions will complain about the element (still in the DOM)
exports.PARAMETER_HIDE_PRESENTATION_TOAST = 'userdata-bbb_custom_style=.presentationUploaderToast{display: none;}.currentPresentationToast{display:none;}';
Loading

0 comments on commit 9290573

Please sign in to comment.