keep improving audio tests

This commit is contained in:
Gabriel Porfirio 2023-05-18 09:39:06 -03:00
parent c3e7ecb945
commit b1036a1947
2 changed files with 45 additions and 24 deletions

View File

@ -34,21 +34,31 @@ class Audio extends MultiUsers {
}
async muteYourselfByButton() {
try {
await connectMicrophone(this.modPage);
} catch {
await this.modPage.waitAndClick(e.joinAudio);
await connectMicrophone(this.modPage);
}
await this.modPage.waitAndClick(e.muteMicButton);
await this.modPage.wasRemoved(e.isTalking);
await this.modPage.hasElement(e.wasTalking);
await this.modPage.wasRemoved(e.muteMicButton);
await this.modPage.hasElement(e.unmuteMicButton);
await this.modPage.wasRemoved(e.talkingIndicator, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.waitAndClick(e.unmuteMicButton);
await this.modPage.waitAndClick(e.audioDropdownMenu);
await this.modPage.waitAndClick(e.leaveAudio);
}
async changeAudioInput() {
try {
await connectMicrophone(this.modPage);
} catch {
await this.modPage.waitAndClick(e.joinAudio);
await connectMicrophone(this.modPage);
}
await this.modPage.waitAndClick(e.audioDropdownMenu);
await isAudioItemSelected(this.modPage, e.defaultInputAudioDevice);
await this.modPage.waitAndClick(e.secondInputAudioDevice);
@ -56,22 +66,30 @@ class Audio extends MultiUsers {
await this.modPage.hasElement(e.muteMicButton);
await this.modPage.waitAndClick(e.audioDropdownMenu);
await isAudioItemSelected(this.modPage, e.secondInputAudioDevice);
await this.modPage.waitAndClick(e.leaveAudio);
}
async keepMuteStateOnRejoin() {
await connectMicrophone(this);
await this.waitAndClick(e.muteMicButton);
await this.hasElement(e.wasTalking);
await this.wasRemoved(e.muteMicButton);
await this.hasElement(e.unmuteMicButton);
await this.waitAndClick(e.audioDropdownMenu);
await this.waitAndClick(e.leaveAudio);
await this.waitAndClick(e.joinAudio);
await this.waitAndClick(e.microphoneButton);
await this.waitAndClick(e.joinEchoTestButton);
await this.waitForSelector(e.establishingAudioLabel);
await this.wasRemoved(e.establishingAudioLabel, ELEMENT_WAIT_LONGER_TIME);
await this.hasElement(e.unmuteMicButton);
try {
await connectMicrophone(this.modPage);
} catch {
await this.modPage.waitAndClick(e.joinAudio);
await connectMicrophone(this.modPage);
}
await this.modPage.waitAndClick(e.muteMicButton);
await this.modPage.hasElement(e.wasTalking);
await this.modPage.wasRemoved(e.muteMicButton);
await this.modPage.hasElement(e.unmuteMicButton);
await this.modPage.waitAndClick(e.audioDropdownMenu);
await this.modPage.waitAndClick(e.leaveAudio);
await this.modPage.waitAndClick(e.joinAudio);
await this.modPage.waitAndClick(e.microphoneButton);
await this.modPage.waitAndClick(e.joinEchoTestButton);
await this.modPage.waitForSelector(e.establishingAudioLabel);
await this.modPage.wasRemoved(e.establishingAudioLabel, ELEMENT_WAIT_LONGER_TIME);
await this.modPage.hasElement(e.unmuteMicButton);
}
async muteYourselfByTalkingIndicator() {

View File

@ -28,16 +28,19 @@ test.describe.serial('Audio', () => {
test('Change audio input and keep it connected', async () => {
await audio.changeAudioInput();
})
});
test('Keep the last mute state after rejoining audio @ci', async () => {
await audio.keepMuteStateOnRejoin();
});
test('Mute yourself by clicking the talking indicator', async () => {
await audio.keepMuteStateOnRejoin();
});
/*
// https://docs.bigbluebutton.org/2.6/release-tests.html#choosing-different-sources
test('Change audio input and keep it connected', async ({ browser, page }) => {
const audio = new Audio(browser, page);
await audio.init(true, false);
await audio.changeAudioInput();
});
test('Keep the last mute state after rejoining audio @ci', async ({ browser, page }) => {
const audio = new Audio(browser, page);
await audio.init(true, false);