Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/DomainTest.php
Show All 34 Lines | class DomainTest extends TestCaseDusk | ||||
{ | { | ||||
$this->browse(function ($browser) { | $this->browse(function ($browser) { | ||||
// FIXME: I couldn't make loginAs() method working | // FIXME: I couldn't make loginAs() method working | ||||
// Note: Here we're also testing that unauthenticated request | // Note: Here we're also testing that unauthenticated request | ||||
// is passed to logon form and then "redirected" to the requested page | // is passed to logon form and then "redirected" to the requested page | ||||
$browser->visit('/domain/123') | $browser->visit('/domain/123') | ||||
->on(new Home()) | ->on(new Home()) | ||||
->submitLogon('john@kolab.org', 'simple123') | ->submitLogon('john@kolab.org', \App\Utils::generatePassphrase()) | ||||
->assertErrorPage(404); | ->assertErrorPage(404); | ||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Test domain info page (existing domain) | * Test domain info page (existing domain) | ||||
* | * | ||||
* @depends testDomainInfo404 | * @depends testDomainInfo404 | ||||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | class DomainTest extends TestCaseDusk | ||||
* @depends testDomainListUnauth | * @depends testDomainListUnauth | ||||
*/ | */ | ||||
public function testDomainList(): void | public function testDomainList(): void | ||||
{ | { | ||||
$this->browse(function ($browser) { | $this->browse(function ($browser) { | ||||
// Login the user | // Login the user | ||||
$browser->visit('/login') | $browser->visit('/login') | ||||
->on(new Home()) | ->on(new Home()) | ||||
->submitLogon('john@kolab.org', 'simple123', true) | ->submitLogon('john@kolab.org', \App\Utils::generatePassphrase(), 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()) | ||||
->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') | ||||
Show All 15 Lines | class DomainTest extends TestCaseDusk | ||||
* Test domains list page (user with no domains) | * Test domains list page (user with no domains) | ||||
*/ | */ | ||||
public function testDomainListEmpty(): void | public function testDomainListEmpty(): void | ||||
{ | { | ||||
$this->browse(function ($browser) { | $this->browse(function ($browser) { | ||||
// Login the user | // Login the user | ||||
$browser->visit('/login') | $browser->visit('/login') | ||||
->on(new Home()) | ->on(new Home()) | ||||
->submitLogon('jack@kolab.org', 'simple123', true) | ->submitLogon('jack@kolab.org', \App\Utils::generatePassphrase(), true) | ||||
->on(new Dashboard()) | ->on(new Dashboard()) | ||||
->assertVisible('@links a.link-profile') | ->assertVisible('@links a.link-profile') | ||||
->assertMissing('@links a.link-domains') | ->assertMissing('@links a.link-domains') | ||||
->assertMissing('@links a.link-users') | ->assertMissing('@links a.link-users') | ||||
->assertMissing('@links a.link-wallet'); | ->assertMissing('@links a.link-wallet'); | ||||
/* | /* | ||||
// On dashboard click the "Domains" link | // On dashboard click the "Domains" link | ||||
->assertSeeIn('@links a.link-domains', 'Domains') | ->assertSeeIn('@links a.link-domains', 'Domains') | ||||
Show All 9 Lines |