Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F8199112
RoomsTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
RoomsTest.php
View Options
<?php
namespace
Tests\Browser\Meet
;
use
App\Sku
;
use
Tests\Browser
;
use
Tests\Browser\Components\Toast
;
use
Tests\Browser\Pages\Dashboard
;
use
Tests\Browser\Pages\Home
;
use
Tests\Browser\Pages\Meet\Room
as
RoomPage
;
use
Tests\Browser\Pages\UserInfo
;
use
Tests\TestCaseDusk
;
class
RoomsTest
extends
TestCaseDusk
{
/**
* {@inheritDoc}
*/
public
function
setUp
():
void
{
parent
::
setUp
();
$this
->
clearMeetEntitlements
();
}
/**
* {@inheritDoc}
*/
public
function
tearDown
():
void
{
$this
->
clearMeetEntitlements
();
parent
::
tearDown
();
}
/**
* Test rooms page (unauthenticated and unauthorized)
*
* @group meet
*/
public
function
testRoomsUnauth
():
void
{
// Test that the page requires authentication
$this
->
browse
(
function
(
Browser
$browser
)
{
$browser
->
visit
(
'/rooms'
)
->
on
(
new
Home
())
// User has no 'meet' entitlement yet, expect redirect to error page
->
submitLogon
(
'john@kolab.org'
,
'simple123'
,
false
)
->
waitFor
(
'#app > #error-page'
)
->
assertSeeIn
(
'#error-page .code'
,
'403'
)
->
assertSeeIn
(
'#error-page .message'
,
'Access denied'
);
});
}
/**
* Test rooms page
*
* @group meet
*/
public
function
testRooms
():
void
{
$this
->
browse
(
function
(
Browser
$browser
)
{
$href
=
\config
(
'app.url'
)
.
'/meet/john'
;
$john
=
$this
->
getTestUser
(
'john@kolab.org'
);
// User has no 'meet' entitlement yet
$browser
->
visit
(
'/login'
)
->
on
(
new
Home
())
->
submitLogon
(
'john@kolab.org'
,
'simple123'
,
true
)
->
on
(
new
Dashboard
())
->
assertMissing
(
'@links a.link-chat'
);
// Goto user subscriptions, and enable 'meet' subscription
$browser
->
visit
(
'/user/'
.
$john
->
id
)
->
on
(
new
UserInfo
())
->
whenAvailable
(
'@skus'
,
function
(
$browser
)
{
$browser
->
click
(
'#sku-input-meet'
);
})
->
scrollTo
(
'#general button[type=submit]'
)->
pause
(
200
)
->
click
(
'#general button[type=submit]'
)
->
assertToast
(
Toast
::
TYPE_SUCCESS
,
'User data updated successfully.'
)
->
click
(
'.navbar-brand'
)
->
on
(
new
Dashboard
())
->
assertSeeIn
(
'@links a.link-chat'
,
'Video chat'
)
// Make sure the element also exists on Dashboard page load
->
refresh
()
->
on
(
new
Dashboard
())
->
assertSeeIn
(
'@links a.link-chat'
,
'Video chat'
);
// Test Video chat page
$browser
->
click
(
'@links a.link-chat'
)
->
waitFor
(
'#meet-rooms'
)
->
waitFor
(
'.card-text a'
)
->
assertSeeIn
(
'.card-title'
,
'Voice & Video Conferencing'
)
->
assertSeeIn
(
'.card-text a'
,
$href
)
->
assertAttribute
(
'.card-text a'
,
'href'
,
'/meet/john'
)
->
click
(
'.card-text a'
)
->
on
(
new
RoomPage
(
'john'
))
// check that entering the room skips the logon form
->
assertMissing
(
'@toolbar'
)
->
assertMissing
(
'@menu'
)
->
assertMissing
(
'@session'
)
->
assertMissing
(
'@chat'
)
->
assertMissing
(
'@login-form'
)
->
assertVisible
(
'@setup-form'
)
->
assertSeeIn
(
'@setup-status-message'
,
"The room is closed. It will be open for others after you join."
)
->
assertSeeIn
(
'@setup-button'
,
"JOIN"
)
->
click
(
'@setup-button'
)
->
waitFor
(
'@session'
)
->
assertMissing
(
'@setup-form'
);
});
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, Jul 8, 10:05 PM (1 d, 9 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1052114
Default Alt Text
RoomsTest.php (3 KB)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment