Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Meet/RoomControlsTest.php
Show First 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | public function testNicknameAndMuting(): void | ||||
// Join the room, disable cam/mic | // Join the room, disable cam/mic | ||||
->select('@setup-mic-select', '') | ->select('@setup-mic-select', '') | ||||
//->select('@setup-cam-select', '') | //->select('@setup-cam-select', '') | ||||
->clickWhenEnabled('@setup-button') | ->clickWhenEnabled('@setup-button') | ||||
->waitFor('@session'); | ->waitFor('@session'); | ||||
// Assert current UI state | // Assert current UI state | ||||
$owner->assertToolbar([ | $owner->assertToolbar([ | ||||
'audio' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED, | 'audio' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | ||||
'video' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED, | 'video' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | ||||
'screen' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | 'screen' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | ||||
'chat' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | 'chat' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | ||||
'fullscreen' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED, | 'fullscreen' => RoomPage::BUTTON_ENABLED, | ||||
'options' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED, | 'options' => RoomPage::BUTTON_ENABLED, | ||||
'logout' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED, | 'logout' => RoomPage::BUTTON_ENABLED, | ||||
]) | ]) | ||||
->whenAvailable('div.meet-video.self', function (Browser $browser) { | ->whenAvailable('div.meet-video.self', function (Browser $browser) { | ||||
$browser->waitFor('video') | $browser->waitFor('video') | ||||
->assertAudioMuted('video', true) | ->assertAudioMuted('video', true) | ||||
->assertSeeIn('.meet-nickname', 'john') | ->assertSeeIn('.meet-nickname', 'john') | ||||
->assertVisible('.controls button.link-fullscreen') | ->assertVisible('.controls button.link-fullscreen') | ||||
->assertMissing('.controls button.link-audio') | ->assertMissing('.controls button.link-audio') | ||||
->assertMissing('.status .status-audio') | ->assertMissing('.status .status-audio') | ||||
->assertMissing('.status .status-video'); | ->assertMissing('.status .status-video'); | ||||
}) | }) | ||||
->whenAvailable('div.meet-video:not(.self)', function (Browser $browser) { | ->whenAvailable('div.meet-video:not(.self)', function (Browser $browser) { | ||||
$browser->waitFor('video') | $browser->waitFor('video') | ||||
->assertVisible('.meet-nickname') | ->assertVisible('.meet-nickname') | ||||
->assertVisible('.controls button.link-fullscreen') | ->assertVisible('.controls button.link-fullscreen') | ||||
->assertVisible('.controls button.link-audio') | ->assertVisible('.controls button.link-audio') | ||||
->assertVisible('.status .status-audio') | ->assertVisible('.status .status-audio') | ||||
->assertMissing('.status .status-video'); | ->assertMissing('.status .status-video'); | ||||
}) | }) | ||||
->assertElementsCount('@session div.meet-video', 2); | ->assertElementsCount('@session div.meet-video', 2); | ||||
// Assert current UI state | // Assert current UI state | ||||
$guest->assertToolbar([ | $guest->assertToolbar([ | ||||
'audio' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | 'audio' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED, | ||||
'video' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED, | 'video' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | ||||
'screen' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | 'screen' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | ||||
'chat' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | 'chat' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | ||||
'fullscreen' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED, | 'fullscreen' => RoomPage::BUTTON_ENABLED, | ||||
'logout' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED, | 'logout' => RoomPage::BUTTON_ENABLED, | ||||
]) | ]) | ||||
->whenAvailable('div.meet-video:not(.self)', function (Browser $browser) { | ->whenAvailable('div.meet-video:not(.self)', function (Browser $browser) { | ||||
$browser->waitFor('video') | $browser->waitFor('video') | ||||
->assertSeeIn('.meet-nickname', 'john') | ->assertSeeIn('.meet-nickname', 'john') | ||||
->assertVisible('.controls button.link-fullscreen') | ->assertVisible('.controls button.link-fullscreen') | ||||
->assertVisible('.controls button.link-audio') | ->assertVisible('.controls button.link-audio') | ||||
->assertMissing('.status .status-audio') | ->assertMissing('.status .status-audio') | ||||
->assertMissing('.status .status-video'); | ->assertMissing('.status .status-video'); | ||||
Show All 10 Lines | public function testNicknameAndMuting(): void | ||||
// Test nickname change propagation | // Test nickname change propagation | ||||
$guest->setNickname('div.meet-video.self', 'guest'); | $guest->setNickname('div.meet-video.self', 'guest'); | ||||
$owner->waitFor('div.meet-video:not(.self) .meet-nickname') | $owner->waitFor('div.meet-video:not(.self) .meet-nickname') | ||||
->assertSeeIn('div.meet-video:not(.self) .meet-nickname', 'guest'); | ->assertSeeIn('div.meet-video:not(.self) .meet-nickname', 'guest'); | ||||
// Test muting audio | // Test muting audio | ||||
$owner->click('@menu button.link-audio') | $owner->click('@menu button.link-audio') | ||||
->assertToolbarButtonState('audio', RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED) | ->assertToolbarButtonState('audio', RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED) | ||||
->assertVisible('div.meet-video.self .status .status-audio'); | ->assertVisible('div.meet-video.self .status .status-audio'); | ||||
// FIXME: It looks that we can't just check the <video> element state | // FIXME: It looks that we can't just check the <video> element state | ||||
// We might consider using OpenVidu API to make sure | // We might consider using OpenVidu API to make sure | ||||
$guest->waitFor('div.meet-video:not(.self) .status .status-audio'); | $guest->waitFor('div.meet-video:not(.self) .status .status-audio'); | ||||
// Test unmuting audio | // Test unmuting audio | ||||
$owner->click('@menu button.link-audio') | $owner->click('@menu button.link-audio') | ||||
->assertToolbarButtonState('audio', RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED) | ->assertToolbarButtonState('audio', RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED) | ||||
->assertMissing('div.meet-video.self .status .status-audio'); | ->assertMissing('div.meet-video.self .status .status-audio'); | ||||
$guest->waitUntilMissing('div.meet-video:not(.self) .status .status-audio'); | $guest->waitUntilMissing('div.meet-video:not(.self) .status .status-audio'); | ||||
// Test muting audio with a keyboard shortcut (key 'm') | // Test muting audio with a keyboard shortcut (key 'm') | ||||
$owner->driver->getKeyboard()->sendKeys('m'); | $owner->driver->getKeyboard()->sendKeys('m'); | ||||
$owner->assertToolbarButtonState('audio', RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED) | $owner->assertToolbarButtonState('audio', RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED) | ||||
->assertVisible('div.meet-video.self .status .status-audio'); | ->assertVisible('div.meet-video.self .status .status-audio'); | ||||
$guest->waitFor('div.meet-video:not(.self) .status .status-audio') | $guest->waitFor('div.meet-video:not(.self) .status .status-audio') | ||||
->assertAudioMuted('div.meet-video:not(.self) video', true); | ->assertAudioMuted('div.meet-video:not(.self) video', true); | ||||
// Test unmuting audio with a keyboard shortcut (key 'm') | // Test unmuting audio with a keyboard shortcut (key 'm') | ||||
$owner->driver->getKeyboard()->sendKeys('m'); | $owner->driver->getKeyboard()->sendKeys('m'); | ||||
$owner->assertToolbarButtonState('audio', RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED) | $owner->assertToolbarButtonState('audio', RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED) | ||||
->assertMissing('div.meet-video.self .status .status-audio'); | ->assertMissing('div.meet-video.self .status .status-audio'); | ||||
$guest->waitUntilMissing('div.meet-video:not(.self) .status .status-audio') | $guest->waitUntilMissing('div.meet-video:not(.self) .status .status-audio') | ||||
->assertAudioMuted('div.meet-video:not(.self) video', false); | ->assertAudioMuted('div.meet-video:not(.self) video', false); | ||||
// Test muting video | // Test muting video | ||||
$owner->click('@menu button.link-video') | $owner->click('@menu button.link-video') | ||||
->assertToolbarButtonState('video', RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED) | ->assertToolbarButtonState('video', RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED) | ||||
->assertVisible('div.meet-video.self .status .status-video'); | ->assertVisible('div.meet-video.self .status .status-video'); | ||||
// FIXME: It looks that we can't just check the <video> element state | // FIXME: It looks that we can't just check the <video> element state | ||||
// We might consider using OpenVidu API to make sure | // We might consider using OpenVidu API to make sure | ||||
$guest->waitFor('div.meet-video:not(.self) .status .status-video'); | $guest->waitFor('div.meet-video:not(.self) .status .status-video'); | ||||
// Test unmuting video | // Test unmuting video | ||||
$owner->click('@menu button.link-video') | $owner->click('@menu button.link-video') | ||||
->assertToolbarButtonState('video', RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_ENABLED) | ->assertToolbarButtonState('video', RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED) | ||||
->assertMissing('div.meet-video.self .status .status-video'); | ->assertMissing('div.meet-video.self .status .status-video'); | ||||
$guest->waitUntilMissing('div.meet-video:not(.self) .status .status-video'); | $guest->waitUntilMissing('div.meet-video:not(.self) .status .status-video'); | ||||
// Test muting other user | // Test muting other user | ||||
$guest->with('div.meet-video:not(.self)', function (Browser $browser) { | $guest->with('div.meet-video:not(.self)', function (Browser $browser) { | ||||
$browser->click('.controls button.link-audio') | $browser->click('.controls button.link-audio') | ||||
->assertAudioMuted('video', true) | ->assertAudioMuted('video', true) | ||||
▲ Show 20 Lines • Show All 159 Lines • Show Last 20 Lines |