Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Meet/RoomSetupTest.php
Show First 20 Lines • Show All 295 Lines • ▼ Show 20 Lines | public function testSubscribers(): void | ||||
->assertMissing('@setup-form') | ->assertMissing('@setup-form') | ||||
->whenAvailable('@subscribers .meet-subscriber.self', function (Browser $browser) { | ->whenAvailable('@subscribers .meet-subscriber.self', function (Browser $browser) { | ||||
$browser->assertSeeIn('.meet-nickname', 'john'); | $browser->assertSeeIn('.meet-nickname', 'john'); | ||||
}) | }) | ||||
->assertElementsCount('@session div.meet-video', 0) | ->assertElementsCount('@session div.meet-video', 0) | ||||
->assertElementsCount('@session video', 0) | ->assertElementsCount('@session video', 0) | ||||
->assertElementsCount('@session .meet-subscriber', 1) | ->assertElementsCount('@session .meet-subscriber', 1) | ||||
->assertToolbar([ | ->assertToolbar([ | ||||
'audio' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_DISABLED, | 'audio' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_DISABLED, | ||||
'video' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_DISABLED, | 'video' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_DISABLED, | ||||
'screen' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_DISABLED, | 'screen' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_DISABLED, | ||||
'hand' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | 'hand' => 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, | ||||
]); | ]); | ||||
// After the owner "opened the room" guest should be able to join | // After the owner "opened the room" guest should be able to join | ||||
// In one browser window act as a guest | // In one browser window act as a guest | ||||
$guest->visit(new RoomPage('john')) | $guest->visit(new RoomPage('john')) | ||||
->waitUntilMissing('@setup-status-message', 10) | ->waitUntilMissing('@setup-status-message', 10) | ||||
->assertSeeIn('@setup-button', "JOIN") | ->assertSeeIn('@setup-button', "JOIN") | ||||
// 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') | ||||
->assertMissing('@setup-form') | ->assertMissing('@setup-form') | ||||
->whenAvailable('@subscribers .meet-subscriber.self', function (Browser $browser) { | ->whenAvailable('@subscribers .meet-subscriber.self', function (Browser $browser) { | ||||
$browser->assertVisible('.meet-nickname'); | $browser->assertVisible('.meet-nickname'); | ||||
}) | }) | ||||
->whenAvailable('@subscribers .meet-subscriber:not(.self)', function (Browser $browser) { | ->whenAvailable('@subscribers .meet-subscriber:not(.self)', function (Browser $browser) { | ||||
$browser->assertSeeIn('.meet-nickname', 'john'); | $browser->assertSeeIn('.meet-nickname', 'john'); | ||||
}) | }) | ||||
->assertElementsCount('@session div.meet-video', 0) | ->assertElementsCount('@session div.meet-video', 0) | ||||
->assertElementsCount('@session video', 0) | ->assertElementsCount('@session video', 0) | ||||
->assertElementsCount('@session div.meet-subscriber', 2) | ->assertElementsCount('@session div.meet-subscriber', 2) | ||||
->assertToolbar([ | ->assertToolbar([ | ||||
'audio' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_DISABLED, | 'audio' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_DISABLED, | ||||
'video' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_DISABLED, | 'video' => RoomPage::BUTTON_ACTIVE | RoomPage::BUTTON_DISABLED, | ||||
'screen' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_DISABLED, | 'screen' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_DISABLED, | ||||
'hand' => RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED, | 'hand' => 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, | ||||
]); | ]); | ||||
// Check guest's elements in the owner's window | // Check guest's elements in the owner's window | ||||
$browser | $browser | ||||
->whenAvailable('@subscribers .meet-subscriber:not(.self)', function (Browser $browser) { | ->whenAvailable('@subscribers .meet-subscriber:not(.self)', function (Browser $browser) { | ||||
$browser->assertVisible('.meet-nickname'); | $browser->assertVisible('.meet-nickname'); | ||||
}) | }) | ||||
->assertElementsCount('@session div.meet-video', 0) | ->assertElementsCount('@session div.meet-video', 0) | ||||
▲ Show 20 Lines • Show All 220 Lines • Show Last 20 Lines |