Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(tests): eliminate silent pass anti-patterns and fix test inconsistencies (#17902)

Aarav Anand169589fcd9b3
diff --git a/tests/specs/jaas/fileSharing.spec.ts b/tests/specs/jaas/fileSharing.spec.ts
index 37d931c4aa..a59c26555d 100644
--- a/tests/specs/jaas/fileSharing.spec.ts
+++ b/tests/specs/jaas/fileSharing.spec.ts
@@ -33,12 +33,15 @@ describe('File sharing', () => {
);
expect(fileSharingEnabled).toBe(expectations.jaas.fileSharingEnabled);
- });
- it('upload button enabled with file-upload feature', async () => {
if (!fileSharingEnabled) {
+ ctx.skipSuiteTests = 'fileSharing is not enabled in this environment';
+
return;
}
+ });
+
+ it('upload button enabled with file-upload feature', async () => {
const panel = p1.getFileSharingPanel();
await panel.open();
@@ -47,10 +50,6 @@ describe('File sharing', () => {
});
it('upload button disabled without file-upload feature', async () => {
- if (!fileSharingEnabled) {
- return;
- }
-
p2 = await joinJaasMuc({ name: 'p2', token: t({ room: ctx.roomName }) });
const panel = p2.getFileSharingPanel();
@@ -61,10 +60,6 @@ describe('File sharing', () => {
});
it('user with file-upload can delete files uploaded by another participant', async () => {
- if (!fileSharingEnabled) {
- return;
- }
-
// p1 (with file-upload) uploads a file
const p1Panel = p1.getFileSharingPanel();
@@ -92,10 +87,6 @@ describe('File sharing', () => {
});
it('user without file-upload can download but not delete files', async () => {
- if (!fileSharingEnabled) {
- return;
- }
-
// p1 (with file-upload) uploads a fresh file
const p1Panel = p1.getFileSharingPanel();
@@ -117,10 +108,6 @@ describe('File sharing', () => {
});
it('dragging into conference opens file sharing tab', async () => {
- if (!fileSharingEnabled) {
- return;
- }
-
// p1 already has file-upload feature
const panel = p1.getFileSharingPanel();
@@ -140,10 +127,6 @@ describe('File sharing', () => {
});
it('dragging on pre-join screen does not open file sharing', async () => {
- if (!fileSharingEnabled) {
- return;
- }
-
// Join with iFrame API, file-upload feature, and pre-join screen enabled — but do NOT click join
p1 = await joinJaasMuc(
{
diff --git a/tests/specs/media/codecSelection.spec.ts b/tests/specs/media/codecSelection.spec.ts
index 5394c5c1ce..ae8873ab09 100644
--- a/tests/specs/media/codecSelection.spec.ts
+++ b/tests/specs/media/codecSelection.spec.ts
@@ -80,7 +80,7 @@ describe('Codec selection', () => {
]);
});
- it('codec switch over', async () => {
+ it('codec switch over', async function() {
await hangupAllParticipants();
await ensureTwoParticipants({
@@ -94,7 +94,8 @@ describe('Codec selection', () => {
// Disable this test on Firefox because it doesn't support VP9 encode.
if (p1.driver.isFirefox) {
- return;
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
}
// Check if p1 and p2 are encoding in VP9 which is the default codec.
diff --git a/tests/specs/media/mute.spec.ts b/tests/specs/media/mute.spec.ts
index 19e0e45b56..15d96d42b3 100644
--- a/tests/specs/media/mute.spec.ts
+++ b/tests/specs/media/mute.spec.ts
@@ -27,11 +27,12 @@ describe('Mute', () => {
it('unmute p2 and check', () => toggleMuteAndCheck(ctx.p2, ctx.p1, false));
- it('p1 mutes p2 and check', async () => {
+ it('p1 mutes p2 and check', async function() {
const { p1, p2 } = ctx;
if (!await p1.isModerator()) {
- return;
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
}
await p1.getFilmstrip().muteAudio(p2);
@@ -40,9 +41,14 @@ describe('Mute', () => {
await p2.getFilmstrip().assertAudioMuteIconIsDisplayed(p2);
});
- it('p2 unmute after p1 mute and check', async () => {
+ it('p2 unmute after p1 mute and check', async function() {
const { p1, p2 } = ctx;
+ if (!await p1.isModerator()) {
+ // eslint-disable-next-line @typescript-eslint/no-invalid-this
+ this.skip();
+ }
+
await unmuteAudioAndCheck(p2, p1);
});
diff --git a/tests/specs/misc/polls.spec.ts b/tests/specs/misc/polls.spec.ts
index d3fb9626f4..4e8b06cbc2 100644
--- a/tests/specs/misc/polls.spec.ts
+++ b/tests/specs/misc/polls.spec.ts
@@ -72,6 +72,11 @@ describe('Polls', () => {
const { p1 } = ctx;
await p1.getChatPanel().clickSendPollButton();
+ await p1.driver.$('button=Send').waitForExist({
+ reverse: true,
+ timeout: 2000
+ });
+ expect(await p1.driver.$('button=Send').isExisting()).toBe(false);
});
it('vote on poll', async () => {
diff --git a/tests/specs/ui/chatPanel.spec.ts b/tests/specs/ui/chatPanel.spec.ts
index 78949abba2..2bb586d232 100644
--- a/tests/specs/ui/chatPanel.spec.ts
+++ b/tests/specs/ui/chatPanel.spec.ts
@@ -24,7 +24,7 @@ describe('Chat panel', () => {
await chatPanel.pressShortcut();
expect(await chatPanel.isOpen()).toBe(true);
});
- it('use button to open', async () => {
+ it('use button to close', async () => {
const { p1 } = ctx;
await p1.getToolbar().clickCloseChatButton();