Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/StatusTest.php
Show First 20 Lines • Show All 152 Lines • ▼ Show 20 Lines | public function testDomainStatus(): void | ||||
$domain->status = Domain::STATUS_NEW | Domain::STATUS_ACTIVE | Domain::STATUS_LDAP_READY; | $domain->status = Domain::STATUS_NEW | Domain::STATUS_ACTIVE | Domain::STATUS_LDAP_READY; | ||||
$domain->save(); | $domain->save(); | ||||
$this->browse(function ($browser) use ($domain) { | $this->browse(function ($browser) use ($domain) { | ||||
// Test auto-refresh | // Test auto-refresh | ||||
$browser->on(new Dashboard()) | $browser->on(new Dashboard()) | ||||
->click('@links a.link-domains') | ->click('@links a.link-domains') | ||||
->on(new DomainList()) | ->on(new DomainList()) | ||||
->waitFor('@table tbody tr') | |||||
// Assert domain status icon | // Assert domain status icon | ||||
->assertVisible('@table tbody tr:first-child td:first-child svg.fa-globe.text-danger') | ->assertVisible('@table tbody tr:first-child td:first-child svg.fa-globe.text-danger') | ||||
->assertText('@table tbody tr:first-child td:first-child svg title', 'Not Ready') | ->assertText('@table tbody tr:first-child td:first-child svg title', 'Not Ready') | ||||
->click('@table tbody tr:first-child td:first-child a') | ->click('@table tbody tr:first-child td:first-child a') | ||||
->on(new DomainInfo()) | ->on(new DomainInfo()) | ||||
->with(new Status(), function ($browser) { | ->with(new Status(), function ($browser) { | ||||
$browser->assertSeeIn('@body', 'We are preparing the domain') | $browser->assertSeeIn('@body', 'We are preparing the domain') | ||||
->assertProgress(50, 'Verifying a custom domain...', 'pending') | ->assertProgress(50, 'Verifying a custom domain...', 'pending') | ||||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | public function testUserStatus(): void | ||||
$domain->status ^= Domain::STATUS_CONFIRMED; | $domain->status ^= Domain::STATUS_CONFIRMED; | ||||
$domain->save(); | $domain->save(); | ||||
} | } | ||||
$this->browse(function ($browser) use ($john, $domain) { | $this->browse(function ($browser) use ($john, $domain) { | ||||
$browser->visit(new Dashboard()) | $browser->visit(new Dashboard()) | ||||
->click('@links a.link-users') | ->click('@links a.link-users') | ||||
->on(new UserList()) | ->on(new UserList()) | ||||
->waitFor('@table tbody tr') | |||||
// Assert user status icons | // Assert user status icons | ||||
->assertVisible('@table tbody tr:first-child td:first-child svg.fa-user.text-success') | ->assertVisible('@table tbody tr:first-child td:first-child svg.fa-user.text-success') | ||||
->assertText('@table tbody tr:first-child td:first-child svg title', 'Active') | ->assertText('@table tbody tr:first-child td:first-child svg title', 'Active') | ||||
->assertVisible('@table tbody tr:nth-child(3) td:first-child svg.fa-user.text-danger') | ->assertVisible('@table tbody tr:nth-child(3) td:first-child svg.fa-user.text-danger') | ||||
->assertText('@table tbody tr:nth-child(3) td:first-child svg title', 'Not Ready') | ->assertText('@table tbody tr:nth-child(3) td:first-child svg title', 'Not Ready') | ||||
->click('@table tbody tr:nth-child(3) td:first-child a') | ->click('@table tbody tr:nth-child(3) td:first-child a') | ||||
->on(new UserInfo()) | ->on(new UserInfo()) | ||||
->with('@form', function (Browser $browser) { | ->with('@form', function (Browser $browser) { | ||||
Show All 36 Lines |