Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/DomainTest.php
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | public function testDomainInfo(): void | ||||
$this->browse(function ($browser) { | $this->browse(function ($browser) { | ||||
// Unconfirmed domain | // Unconfirmed domain | ||||
$domain = Domain::where('namespace', 'kolab.org')->first(); | $domain = Domain::where('namespace', 'kolab.org')->first(); | ||||
$domain->status ^= Domain::STATUS_CONFIRMED; | $domain->status ^= Domain::STATUS_CONFIRMED; | ||||
$domain->save(); | $domain->save(); | ||||
$browser->visit('/domain/' . $domain->id) | $browser->visit('/domain/' . $domain->id) | ||||
->on(new DomainInfo()) | ->on(new DomainInfo()) | ||||
->assertVisible('@status') | |||||
->whenAvailable('@verify', function ($browser) use ($domain) { | ->whenAvailable('@verify', function ($browser) use ($domain) { | ||||
// Make sure the domain is confirmed now | // Make sure the domain is confirmed now | ||||
// TODO: Test verification process failure | // TODO: Test verification process failure | ||||
$domain->status |= Domain::STATUS_CONFIRMED; | $domain->status |= Domain::STATUS_CONFIRMED; | ||||
$domain->save(); | $domain->save(); | ||||
$browser->assertSeeIn('pre', $domain->namespace) | $browser->assertSeeIn('pre', $domain->namespace) | ||||
->assertSeeIn('pre', $domain->hash()) | ->assertSeeIn('pre', $domain->hash()) | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | public function testDomainList(): void | ||||
->on(new Home()) | ->on(new Home()) | ||||
->submitLogon('john@kolab.org', 'simple123', true) | ->submitLogon('john@kolab.org', 'simple123', true) | ||||
// On dashboard click the "Domains" link | // On dashboard click the "Domains" link | ||||
->on(new Dashboard()) | ->on(new Dashboard()) | ||||
->assertSeeIn('@links a.link-domains', 'Domains') | ->assertSeeIn('@links a.link-domains', 'Domains') | ||||
->click('@links a.link-domains') | ->click('@links a.link-domains') | ||||
// On Domains List page click the domain entry | // On Domains List page click the domain entry | ||||
->on(new DomainList()) | ->on(new DomainList()) | ||||
->assertVisible('@table tbody tr:first-child td:first-child svg.fa-globe.text-success') | |||||
->assertText('@table tbody tr:first-child td:first-child svg title', 'Active') | |||||
->assertSeeIn('@table tbody tr:first-child td:first-child', 'kolab.org') | ->assertSeeIn('@table tbody tr:first-child td:first-child', 'kolab.org') | ||||
->click('@table tbody tr:first-child td:first-child a') | ->click('@table tbody tr:first-child td:first-child a') | ||||
// On Domain Info page verify that's the clicked domain | // On Domain Info page verify that's the clicked domain | ||||
->on(new DomainInfo()) | ->on(new DomainInfo()) | ||||
->whenAvailable('@config', function ($browser) { | ->whenAvailable('@config', function ($browser) { | ||||
$browser->assertSeeIn('pre', 'kolab.org'); | $browser->assertSeeIn('pre', 'kolab.org'); | ||||
}); | }); | ||||
}); | }); | ||||
// TODO: Test domains list acting as Ned (John's "delegatee") | // TODO: Test domains list acting as Ned (John's "delegatee") | ||||
} | } | ||||
} | } |