Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/DomainTest.php
Show First 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | public function testDomainList(): void | ||||
->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()) | ||||
->waitFor('@table tbody tr') | ->waitFor('@table tbody tr') | ||||
->assertVisible('@table tbody tr:first-child td:first-child svg.fa-globe.text-success') | ->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') | ->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') | ||||
->assertMissing('@table tfoot') | |||||
->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") | ||||
} | } | ||||
/** | |||||
* Test domains list page (user with no domains) | |||||
*/ | |||||
public function testDomainListEmpty(): void | |||||
{ | |||||
$this->browse(function ($browser) { | |||||
// Login the user | |||||
$browser->visit('/login') | |||||
->on(new Home()) | |||||
->submitLogon('jack@kolab.org', 'simple123', true) | |||||
// On dashboard click the "Domains" link | |||||
->on(new Dashboard()) | |||||
->assertSeeIn('@links a.link-domains', 'Domains') | |||||
->click('@links a.link-domains') | |||||
// On Domains List page click the domain entry | |||||
->on(new DomainList()) | |||||
->assertMissing('@table tbody') | |||||
->assertSeeIn('tfoot td', 'There are no domains in this account.'); | |||||
}); | |||||
} | |||||
} | } |