Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2485068
StatsTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
StatsTest.php
View Options
<?php
namespace
Tests\Browser\Reseller
;
use
Tests\Browser
;
use
Tests\Browser\Pages\Admin\Stats
;
use
Tests\Browser\Pages\Dashboard
;
use
Tests\Browser\Pages\Home
;
use
Tests\TestCaseDusk
;
class
StatsTest
extends
TestCaseDusk
{
/**
* {@inheritDoc}
*/
public
function
setUp
():
void
{
parent
::
setUp
();
self
::
useResellerUrl
();
}
/**
* Test Stats page (unauthenticated)
*/
public
function
testStatsUnauth
():
void
{
// Test that the page requires authentication
$this
->
browse
(
function
(
Browser
$browser
)
{
$browser
->
visit
(
'/stats'
)->
on
(
new
Home
());
});
}
/**
* Test Stats page
*/
public
function
testStats
():
void
{
$this
->
browse
(
function
(
Browser
$browser
)
{
$browser
->
visit
(
new
Home
())
->
submitLogon
(
'reseller@'
.
\config
(
'app.domain'
),
\App\Utils
::
generatePassphrase
(),
true
)
->
on
(
new
Dashboard
())
->
assertSeeIn
(
'@links .link-stats'
,
'Stats'
)
->
click
(
'@links .link-stats'
)
->
on
(
new
Stats
())
->
assertElementsCount
(
'@container > div'
,
5
)
->
waitForTextIn
(
'@container #chart-users svg .title'
,
'Users - last 8 weeks'
)
->
waitForTextIn
(
'@container #chart-users-all svg .title'
,
'All Users - last year'
)
->
waitForTextIn
(
'@container #chart-payers svg .title'
,
'Payers - last year'
)
->
waitForTextIn
(
'@container #chart-discounts svg .title'
,
'Discounts'
)
->
waitForTextIn
(
'@container #chart-vouchers svg .title'
,
'Vouchers'
);
});
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Thu, Nov 20, 9:07 PM (1 d, 3 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
387301
Default Alt Text
StatsTest.php (1 KB)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment