Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Meet/RoomQATest.php
<?php | <?php | ||||
namespace Tests\Browser\Meet; | namespace Tests\Browser\Meet; | ||||
use App\OpenVidu\Room; | use App\Meet\Room; | ||||
use Tests\Browser; | use Tests\Browser; | ||||
use Tests\Browser\Pages\Meet\Room as RoomPage; | use Tests\Browser\Pages\Meet\Room as RoomPage; | ||||
use Tests\TestCaseDusk; | use Tests\TestCaseDusk; | ||||
class RoomQATest extends TestCaseDusk | class RoomQATest extends TestCaseDusk | ||||
{ | { | ||||
/** | /** | ||||
* {@inheritDoc} | * {@inheritDoc} | ||||
*/ | */ | ||||
public function setUp(): void | public function setUp(): void | ||||
{ | { | ||||
parent::setUp(); | parent::setUp(); | ||||
$this->setupTestRoom(); | $this->setupTestRoom(); | ||||
} | } | ||||
public function tearDown(): void | public function tearDown(): void | ||||
{ | { | ||||
$this->resetTestRoom(); | $this->resetTestRoom(); | ||||
parent::tearDown(); | parent::tearDown(); | ||||
} | } | ||||
/** | /** | ||||
* Test Q&A queue | * Test Q&A queue | ||||
* | * | ||||
* @group openvidu | * @group meet | ||||
*/ | */ | ||||
public function testQA(): void | public function testQA(): void | ||||
{ | { | ||||
$this->browse(function (Browser $owner, Browser $guest1, Browser $guest2) { | $this->browse(function (Browser $owner, Browser $guest1, Browser $guest2) { | ||||
// Join the room as an owner (authenticate) | // Join the room as an owner (authenticate) | ||||
$owner->visit(new RoomPage('john')) | $owner->visit(new RoomPage('john')) | ||||
->click('@setup-button') | ->click('@setup-button') | ||||
->submitLogon('john@kolab.org', 'simple123') | ->submitLogon('john@kolab.org', 'simple123') | ||||
▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | public function testQA(): void | ||||
->waitFor('@menu button.link-hand') | ->waitFor('@menu button.link-hand') | ||||
->assertToolbarButtonState('hand', RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED) | ->assertToolbarButtonState('hand', RoomPage::BUTTON_INACTIVE | RoomPage::BUTTON_ENABLED) | ||||
->click('@menu button.link-hand') | ->click('@menu button.link-hand') | ||||
->waitFor('@queue .dropdown.self') | ->waitFor('@queue .dropdown.self') | ||||
->assertElementsCount('@queue .dropdown', 2); | ->assertElementsCount('@queue .dropdown', 2); | ||||
// Promote guest (2) to publisher | // Promote guest (2) to publisher | ||||
$owner->waitFor('@queue .dropdown:not(.self)') | $owner->waitFor('@queue .dropdown:not(.self)') | ||||
->pause(8000) // wait until it's not moving, otherwise click() will be possible | ->pause(8000) // wait until it's not moving, otherwise click() will fail | ||||
->click('@queue .dropdown:not(.self)') | ->click('@queue .dropdown:not(.self)') | ||||
->whenAvailable('@queue .dropdown:not(.self) .dropdown-menu', function ($browser) { | ->whenAvailable('@queue .dropdown:not(.self) .dropdown-menu', function ($browser) { | ||||
$browser->click('.action-role-publisher input'); | $browser->click('.action-role-publisher input'); | ||||
}) | }) | ||||
->waitUntilMissing('@queue .dropdown:not(.self)') | ->waitUntilMissing('@queue .dropdown:not(.self)') | ||||
->waitFor('@session .meet-video'); | ->waitFor('@session .meet-video'); | ||||
$guest1->waitFor('@session .meet-video') | $guest1->waitFor('@session .meet-video') | ||||
Show All 19 Lines |