Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2513265
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/tests/Browser/Admin/StatsTest.php b/src/tests/Browser/Admin/StatsTest.php
index 629d6b4b..b877cc0f 100644
--- a/src/tests/Browser/Admin/StatsTest.php
+++ b/src/tests/Browser/Admin/StatsTest.php
@@ -1,45 +1,41 @@
<?php
namespace Tests\Browser\Admin;
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::useAdminUrl();
}
/**
* Test Stats page
*/
public function testStats(): void
{
$this->browse(function (Browser $browser) {
$browser->visit(new Home())
->submitLogon('jeroen@jeroen.jeroen', \App\Utils::generatePassphrase(), true)
->on(new Dashboard())
->assertSeeIn('@links .link-stats', 'Stats')
->click('@links .link-stats')
->on(new Stats())
->assertElementsCount('@container > div', 4)
- ->waitFor('@container #chart-users svg')
- ->assertSeeIn('@container #chart-users svg .title', 'Users - last 8 weeks')
- ->waitFor('@container #chart-users-all svg')
- ->assertSeeIn('@container #chart-users-all svg .title', 'All Users - last year')
- ->waitFor('@container #chart-income svg')
- ->assertSeeIn('@container #chart-income svg .title', 'Income in CHF - last 8 weeks')
- ->waitFor('@container #chart-discounts svg')
- ->assertSeeIn('@container #chart-discounts svg .title', 'Discounts');
+ ->waitForTextIn('@container #chart-users svg .title', 'Users - last 8 weeks')
+ ->waitForTextIn('@container #chart-users-all svg .title', 'All Users - last year')
+ ->waitForTextIn('@container #chart-income svg .title', 'Income in CHF - last 8 weeks')
+ ->waitForTextIn('@container #chart-discounts svg .title', 'Discounts');
});
}
}
diff --git a/src/tests/Browser/Reseller/StatsTest.php b/src/tests/Browser/Reseller/StatsTest.php
index 3347ed6f..27fe981d 100644
--- a/src/tests/Browser/Reseller/StatsTest.php
+++ b/src/tests/Browser/Reseller/StatsTest.php
@@ -1,54 +1,51 @@
<?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', 3)
- ->waitFor('@container #chart-users svg')
- ->assertSeeIn('@container #chart-users svg .title', 'Users - last 8 weeks')
- ->waitFor('@container #chart-users-all svg')
- ->assertSeeIn('@container #chart-users-all svg .title', 'All Users - last year')
- ->waitFor('@container #chart-discounts svg')
- ->assertSeeIn('@container #chart-discounts svg .title', 'Discounts');
+ ->waitForTextIn('@container #chart-users svg .title', 'Users - last 8 weeks')
+ ->waitForTextIn('@container #chart-users-all svg .title', 'All Users - last year')
+ ->waitForTextIn('@container #chart-discounts svg .title', 'Discounts');
});
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Apr 18, 10:16 AM (10 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
436209
Default Alt Text
(4 KB)
Attached To
Mode
R2 kolab
Attached
Detach File
Event Timeline
Log In to Comment