Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Meet/RoomsTest.php
Show All 37 Lines | class RoomsTest extends TestCaseDusk | ||||
*/ | */ | ||||
public function testRoomsUnauth(): void | public function testRoomsUnauth(): void | ||||
{ | { | ||||
// Test that the page requires authentication | // Test that the page requires authentication | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$browser->visit('/rooms') | $browser->visit('/rooms') | ||||
->on(new Home()) | ->on(new Home()) | ||||
// User has no 'meet' entitlement yet, expect redirect to error page | // User has no 'meet' entitlement yet, expect redirect to error page | ||||
->submitLogon('john@kolab.org', 'simple123', false) | ->submitLogon('john@kolab.org', \App\Utils::generatePassphrase(), false) | ||||
->waitFor('#app > #error-page') | ->waitFor('#app > #error-page') | ||||
->assertSeeIn('#error-page .code', '403') | ->assertSeeIn('#error-page .code', '403') | ||||
->assertSeeIn('#error-page .message', 'Access denied'); | ->assertSeeIn('#error-page .message', 'Access denied'); | ||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Test rooms page | * Test rooms page | ||||
* | * | ||||
* @group openvidu | * @group openvidu | ||||
*/ | */ | ||||
public function testRooms(): void | public function testRooms(): void | ||||
{ | { | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$href = \config('app.url') . '/meet/john'; | $href = \config('app.url') . '/meet/john'; | ||||
$john = $this->getTestUser('john@kolab.org'); | $john = $this->getTestUser('john@kolab.org'); | ||||
// User has no 'meet' entitlement yet | // User has no 'meet' entitlement yet | ||||
$browser->visit('/login') | $browser->visit('/login') | ||||
->on(new Home()) | ->on(new Home()) | ||||
->submitLogon('john@kolab.org', 'simple123', true) | ->submitLogon('john@kolab.org', \App\Utils::generatePassphrase(), true) | ||||
->on(new Dashboard()) | ->on(new Dashboard()) | ||||
->assertMissing('@links a.link-chat'); | ->assertMissing('@links a.link-chat'); | ||||
// Goto user subscriptions, and enable 'meet' subscription | // Goto user subscriptions, and enable 'meet' subscription | ||||
$browser->visit('/user/' . $john->id) | $browser->visit('/user/' . $john->id) | ||||
->on(new UserInfo()) | ->on(new UserInfo()) | ||||
->whenAvailable('@skus', function ($browser) { | ->whenAvailable('@skus', function ($browser) { | ||||
$browser->click('#sku-input-meet'); | $browser->click('#sku-input-meet'); | ||||
Show All 35 Lines |