Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Meet/RoomSetupTest.php
Show All 11 Lines | |||||
class RoomSetupTest extends TestCaseDusk | class RoomSetupTest extends TestCaseDusk | ||||
{ | { | ||||
/** | /** | ||||
* {@inheritDoc} | * {@inheritDoc} | ||||
*/ | */ | ||||
public function setUp(): void | public function setUp(): void | ||||
{ | { | ||||
parent::setUp(); | parent::setUp(); | ||||
$this->setupTestRoom(); | $this->resetTestRoom(); | ||||
} | } | ||||
public function tearDown(): void | public function tearDown(): void | ||||
{ | { | ||||
$this->resetTestRoom(); | $this->resetTestRoom(); | ||||
parent::tearDown(); | parent::tearDown(); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 230 Lines • ▼ Show 20 Lines | public function testTwoUsersInARoom(): void | ||||
// it should not destroy the session | // it should not destroy the session | ||||
$browser->click('@menu button.link-logout') | $browser->click('@menu button.link-logout') | ||||
->waitForLocation('/dashboard'); | ->waitForLocation('/dashboard'); | ||||
// Expect other participants be informed about the end of the session | // Expect other participants be informed about the end of the session | ||||
$guest->with(new Dialog('#leave-dialog'), function (Browser $browser) { | $guest->with(new Dialog('#leave-dialog'), function (Browser $browser) { | ||||
$browser->assertSeeIn('@title', 'Room closed') | $browser->assertSeeIn('@title', 'Room closed') | ||||
->assertSeeIn('@body', "The session has been closed by the room owner.") | ->assertSeeIn('@body', "The session has been closed by the room owner.") | ||||
->assertMissing('@button-cancel') | ->assertSeeIn('@button-cancel', 'Close') | ||||
->assertSeeIn('@button-action', 'Close') | ->click('@button-cancel'); | ||||
->click('@button-action'); | |||||
}) | }) | ||||
->assertMissing('#leave-dialog') | ->assertMissing('#leave-dialog') | ||||
->waitForLocation('/login'); | ->waitForLocation('/login'); | ||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Test two subscribers-only users in a room | * Test two subscribers-only users in a room | ||||
▲ Show 20 Lines • Show All 178 Lines • ▼ Show 20 Lines | public function testDemoteToSubscriber(): void | ||||
->waitFor('@session .meet-video:not(.self) video') | ->waitFor('@session .meet-video:not(.self) video') | ||||
->assertElementsCount('@session div.meet-video', 2) | ->assertElementsCount('@session div.meet-video', 2) | ||||
->assertElementsCount('@session video', 2) | ->assertElementsCount('@session video', 2) | ||||
->assertElementsCount('@session div.meet-subscriber', 0); | ->assertElementsCount('@session div.meet-subscriber', 0); | ||||
$guest1 | $guest1 | ||||
->with(new Dialog('#media-setup-dialog'), function (Browser $browser) { | ->with(new Dialog('#media-setup-dialog'), function (Browser $browser) { | ||||
$browser->assertSeeIn('@title', 'Media setup') | $browser->assertSeeIn('@title', 'Media setup') | ||||
->click('@button-action'); | ->click('@button-cancel'); | ||||
}) | }) | ||||
->waitFor('@session .meet-video.self') | ->waitFor('@session .meet-video.self') | ||||
->assertElementsCount('@session div.meet-video', 2) | ->assertElementsCount('@session div.meet-video', 2) | ||||
->assertElementsCount('@session video', 2) | ->assertElementsCount('@session video', 2) | ||||
->assertElementsCount('@session div.meet-subscriber', 0); | ->assertElementsCount('@session div.meet-subscriber', 0); | ||||
// Demote the owner to a subscriber | // Demote the owner to a subscriber | ||||
$browser | $browser | ||||
Show All 17 Lines | public function testDemoteToSubscriber(): void | ||||
$browser->assertSeeIn('.action-role-publisher', 'Audio & Video publishing') | $browser->assertSeeIn('.action-role-publisher', 'Audio & Video publishing') | ||||
->assertNotChecked('.action-role-publisher input') | ->assertNotChecked('.action-role-publisher input') | ||||
->click('.action-role-publisher') | ->click('.action-role-publisher') | ||||
->waitUntilMissing('.dropdown-menu'); | ->waitUntilMissing('.dropdown-menu'); | ||||
}) | }) | ||||
->waitUntilMissing('@session .meet-subscriber.self') | ->waitUntilMissing('@session .meet-subscriber.self') | ||||
->with(new Dialog('#media-setup-dialog'), function (Browser $browser) { | ->with(new Dialog('#media-setup-dialog'), function (Browser $browser) { | ||||
$browser->assertSeeIn('@title', 'Media setup') | $browser->assertSeeIn('@title', 'Media setup') | ||||
->click('@button-action'); | ->click('@button-cancel'); | ||||
}) | }) | ||||
->waitFor('@session div.meet-video.self') | ->waitFor('@session div.meet-video.self') | ||||
->assertElementsCount('@session div.meet-video', 2) | ->assertElementsCount('@session div.meet-video', 2) | ||||
->assertElementsCount('@session video', 2) | ->assertElementsCount('@session video', 2) | ||||
->assertElementsCount('@session div.meet-subscriber', 0); | ->assertElementsCount('@session div.meet-subscriber', 0); | ||||
}); | }); | ||||
} | } | ||||
Show All 34 Lines | public function testMediaSetupDialog(): void | ||||
->assertVisible('form > div:nth-child(1) video') | ->assertVisible('form > div:nth-child(1) video') | ||||
->assertVisible('form > div:nth-child(1) .volume') | ->assertVisible('form > div:nth-child(1) .volume') | ||||
->assertVisible('form > div:nth-child(2) svg') | ->assertVisible('form > div:nth-child(2) svg') | ||||
->assertAttribute('form > div:nth-child(2) .input-group-text', 'title', 'Microphone') | ->assertAttribute('form > div:nth-child(2) .input-group-text', 'title', 'Microphone') | ||||
->assertVisible('form > div:nth-child(2) select') | ->assertVisible('form > div:nth-child(2) select') | ||||
->assertVisible('form > div:nth-child(3) svg') | ->assertVisible('form > div:nth-child(3) svg') | ||||
->assertAttribute('form > div:nth-child(3) .input-group-text', 'title', 'Camera') | ->assertAttribute('form > div:nth-child(3) .input-group-text', 'title', 'Camera') | ||||
->assertVisible('form > div:nth-child(3) select') | ->assertVisible('form > div:nth-child(3) select') | ||||
->assertMissing('@button-cancel') | ->assertSeeIn('@button-cancel', 'Close') | ||||
->assertSeeIn('@button-action', 'Close') | ->click('@button-cancel'); | ||||
->click('@button-action'); | |||||
}) | }) | ||||
->assertMissing('#media-setup-dialog') | ->assertMissing('#media-setup-dialog') | ||||
// Test mute audio and video | // Test mute audio and video | ||||
->click('.controls button.link-setup') | ->click('.controls button.link-setup') | ||||
->with(new Dialog('#media-setup-dialog'), function (Browser $browser) { | ->with(new Dialog('#media-setup-dialog'), function (Browser $browser) { | ||||
$browser->select('form > div:nth-child(2) select', '') | $browser->select('form > div:nth-child(2) select', '') | ||||
->select('form > div:nth-child(3) select', '') | ->select('form > div:nth-child(3) select', '') | ||||
->click('@button-action'); | ->click('@button-cancel'); | ||||
}) | }) | ||||
->assertMissing('#media-setup-dialog') | ->assertMissing('#media-setup-dialog') | ||||
->assertVisible('@session .meet-video .status .status-audio') | ->assertVisible('@session .meet-video .status .status-audio') | ||||
->assertVisible('@session .meet-video .status .status-video'); | ->assertVisible('@session .meet-video .status .status-video'); | ||||
$guest->waitFor('@session video') | $guest->waitFor('@session video') | ||||
->waitFor('@session .meet-video .status .status-audio') | ->waitFor('@session .meet-video .status .status-audio') | ||||
->assertVisible('@session .meet-video .status .status-video'); | ->assertVisible('@session .meet-video .status .status-video'); | ||||
}); | }); | ||||
} | } | ||||
} | } |