Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Reseller/UserTest.php
Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | public function testUserInfo(): void | ||||
->assertSeeIn('.row:nth-child(6) label', 'External Email') | ->assertSeeIn('.row:nth-child(6) label', 'External Email') | ||||
->assertMissing('.row:nth-child(6) #external_email a') | ->assertMissing('.row:nth-child(6) #external_email a') | ||||
->assertSeeIn('.row:nth-child(7) label', 'Country') | ->assertSeeIn('.row:nth-child(7) label', 'Country') | ||||
->assertSeeIn('.row:nth-child(7) #country', 'United States'); | ->assertSeeIn('.row:nth-child(7) #country', 'United States'); | ||||
}); | }); | ||||
// Some tabs are loaded in background, wait a second | // Some tabs are loaded in background, wait a second | ||||
$browser->pause(500) | $browser->pause(500) | ||||
->assertElementsCount('@nav a', 7); | ->assertElementsCount('@nav a', 8); | ||||
// Note: Finances tab is tested in UserFinancesTest.php | // Note: Finances tab is tested in UserFinancesTest.php | ||||
$browser->assertSeeIn('@nav #tab-finances', 'Finances'); | $browser->assertSeeIn('@nav #tab-finances', 'Finances'); | ||||
// Assert Aliases tab | // Assert Aliases tab | ||||
$browser->assertSeeIn('@nav #tab-aliases', 'Aliases (1)') | $browser->assertSeeIn('@nav #tab-aliases', 'Aliases (1)') | ||||
->click('@nav #tab-aliases') | ->click('@nav #tab-aliases') | ||||
->whenAvailable('@user-aliases', function (Browser $browser) { | ->whenAvailable('@user-aliases', function (Browser $browser) { | ||||
Show All 35 Lines | public function testUserInfo(): void | ||||
// Assert Distribution lists tab | // Assert Distribution lists tab | ||||
$browser->assertSeeIn('@nav #tab-distlists', 'Distribution lists (0)') | $browser->assertSeeIn('@nav #tab-distlists', 'Distribution lists (0)') | ||||
->click('@nav #tab-distlists') | ->click('@nav #tab-distlists') | ||||
->with('@user-distlists', function (Browser $browser) { | ->with('@user-distlists', function (Browser $browser) { | ||||
$browser->assertElementsCount('table tbody tr', 0) | $browser->assertElementsCount('table tbody tr', 0) | ||||
->assertSeeIn('table tfoot tr td', 'There are no distribution lists in this account.'); | ->assertSeeIn('table tfoot tr td', 'There are no distribution lists in this account.'); | ||||
}); | }); | ||||
// Assert Resources tab | |||||
$browser->assertSeeIn('@nav #tab-resources', 'Resources (0)') | |||||
->click('@nav #tab-resources') | |||||
->with('@user-resources', function (Browser $browser) { | |||||
$browser->assertElementsCount('table tbody tr', 0) | |||||
->assertSeeIn('table tfoot tr td', 'There are no resources in this account.'); | |||||
}); | |||||
// Assert Settings tab | |||||
$browser->assertSeeIn('@nav #tab-settings', 'Settings') | |||||
->click('@nav #tab-settings') | |||||
->whenAvailable('@user-settings form', function (Browser $browser) { | |||||
$browser->assertElementsCount('.row', 1) | |||||
->assertSeeIn('.row:first-child label', 'Greylisting') | |||||
->assertSeeIn('.row:first-child .text-success', 'enabled'); | |||||
}); | |||||
}); | }); | ||||
} | } | ||||
/** | /** | ||||
* Test user info page (continue) | * Test user info page (continue) | ||||
* | * | ||||
* @depends testUserInfo | * @depends testUserInfo | ||||
*/ | */ | ||||
Show All 38 Lines | public function testUserInfo2(): void | ||||
->assertSeeIn('.row:nth-child(8) label', 'Address') | ->assertSeeIn('.row:nth-child(8) label', 'Address') | ||||
->assertSeeIn('.row:nth-child(8) #billing_address', $john->getSetting('billing_address')) | ->assertSeeIn('.row:nth-child(8) #billing_address', $john->getSetting('billing_address')) | ||||
->assertSeeIn('.row:nth-child(9) label', 'Country') | ->assertSeeIn('.row:nth-child(9) label', 'Country') | ||||
->assertSeeIn('.row:nth-child(9) #country', 'United States'); | ->assertSeeIn('.row:nth-child(9) #country', 'United States'); | ||||
}); | }); | ||||
// Some tabs are loaded in background, wait a second | // Some tabs are loaded in background, wait a second | ||||
$browser->pause(500) | $browser->pause(500) | ||||
->assertElementsCount('@nav a', 7); | ->assertElementsCount('@nav a', 8); | ||||
// Note: Finances tab is tested in UserFinancesTest.php | // Note: Finances tab is tested in UserFinancesTest.php | ||||
$browser->assertSeeIn('@nav #tab-finances', 'Finances'); | $browser->assertSeeIn('@nav #tab-finances', 'Finances'); | ||||
// Assert Aliases tab | // Assert Aliases tab | ||||
$browser->assertSeeIn('@nav #tab-aliases', 'Aliases (1)') | $browser->assertSeeIn('@nav #tab-aliases', 'Aliases (1)') | ||||
->click('@nav #tab-aliases') | ->click('@nav #tab-aliases') | ||||
->whenAvailable('@user-aliases', function (Browser $browser) { | ->whenAvailable('@user-aliases', function (Browser $browser) { | ||||
Show All 33 Lines | public function testUserInfo2(): void | ||||
->with('@user-distlists table', function (Browser $browser) { | ->with('@user-distlists table', function (Browser $browser) { | ||||
$browser->assertElementsCount('tbody tr', 1) | $browser->assertElementsCount('tbody tr', 1) | ||||
->assertSeeIn('tbody tr:nth-child(1) td:first-child a', 'Test Group') | ->assertSeeIn('tbody tr:nth-child(1) td:first-child a', 'Test Group') | ||||
->assertVisible('tbody tr:nth-child(1) td:first-child svg.text-danger') | ->assertVisible('tbody tr:nth-child(1) td:first-child svg.text-danger') | ||||
->assertSeeIn('tbody tr:nth-child(1) td:last-child a', 'group-test@kolab.org') | ->assertSeeIn('tbody tr:nth-child(1) td:last-child a', 'group-test@kolab.org') | ||||
->assertMissing('tfoot'); | ->assertMissing('tfoot'); | ||||
}); | }); | ||||
// Assert Resources tab | |||||
$browser->assertSeeIn('@nav #tab-resources', 'Resources (2)') | |||||
->click('@nav #tab-resources') | |||||
->with('@user-resources', function (Browser $browser) { | |||||
$browser->assertElementsCount('table tbody tr', 2) | |||||
->assertSeeIn('table tbody tr:nth-child(1) td:first-child', 'Conference Room #1') | |||||
->assertSeeIn('table tbody tr:nth-child(1) td:last-child', 'resource-test1@kolab.org') | |||||
->assertSeeIn('table tbody tr:nth-child(2) td:first-child', 'Conference Room #2') | |||||
->assertSeeIn('table tbody tr:nth-child(2) td:last-child', 'resource-test2@kolab.org') | |||||
->assertMissing('table tfoot'); | |||||
}); | |||||
// Assert Users tab | // Assert Users tab | ||||
$browser->assertSeeIn('@nav #tab-users', 'Users (4)') | $browser->assertSeeIn('@nav #tab-users', 'Users (4)') | ||||
->click('@nav #tab-users') | ->click('@nav #tab-users') | ||||
->with('@user-users table', function (Browser $browser) { | ->with('@user-users table', function (Browser $browser) { | ||||
$browser->assertElementsCount('tbody tr', 4) | $browser->assertElementsCount('tbody tr', 4) | ||||
->assertSeeIn('tbody tr:nth-child(1) td:first-child a', 'jack@kolab.org') | ->assertSeeIn('tbody tr:nth-child(1) td:first-child a', 'jack@kolab.org') | ||||
->assertVisible('tbody tr:nth-child(1) td:first-child svg.text-success') | ->assertVisible('tbody tr:nth-child(1) td:first-child svg.text-success') | ||||
->assertSeeIn('tbody tr:nth-child(2) td:first-child a', 'joe@kolab.org') | ->assertSeeIn('tbody tr:nth-child(2) td:first-child a', 'joe@kolab.org') | ||||
Show All 19 Lines | public function testUserInfo2(): void | ||||
$browser->assertSeeIn('@user-info .card-title', $ned->email) | $browser->assertSeeIn('@user-info .card-title', $ned->email) | ||||
->with('@user-info form', function (Browser $browser) use ($ned) { | ->with('@user-info form', function (Browser $browser) use ($ned) { | ||||
$browser->assertSeeIn('.row:nth-child(2) label', 'ID (Created)') | $browser->assertSeeIn('.row:nth-child(2) label', 'ID (Created)') | ||||
->assertSeeIn('.row:nth-child(2) #userid', "{$ned->id} ({$ned->created_at})"); | ->assertSeeIn('.row:nth-child(2) #userid', "{$ned->id} ({$ned->created_at})"); | ||||
}); | }); | ||||
// Some tabs are loaded in background, wait a second | // Some tabs are loaded in background, wait a second | ||||
$browser->pause(500) | $browser->pause(500) | ||||
->assertElementsCount('@nav a', 7); | ->assertElementsCount('@nav a', 8); | ||||
// Note: Finances tab is tested in UserFinancesTest.php | // Note: Finances tab is tested in UserFinancesTest.php | ||||
$browser->assertSeeIn('@nav #tab-finances', 'Finances'); | $browser->assertSeeIn('@nav #tab-finances', 'Finances'); | ||||
// Assert Aliases tab | // Assert Aliases tab | ||||
$browser->assertSeeIn('@nav #tab-aliases', 'Aliases (0)') | $browser->assertSeeIn('@nav #tab-aliases', 'Aliases (0)') | ||||
->click('@nav #tab-aliases') | ->click('@nav #tab-aliases') | ||||
->whenAvailable('@user-aliases', function (Browser $browser) { | ->whenAvailable('@user-aliases', function (Browser $browser) { | ||||
Show All 40 Lines | public function testUserInfo2(): void | ||||
// We don't expect John's distribution lists here | // We don't expect John's distribution lists here | ||||
$browser->assertSeeIn('@nav #tab-distlists', 'Distribution lists (0)') | $browser->assertSeeIn('@nav #tab-distlists', 'Distribution lists (0)') | ||||
->click('@nav #tab-distlists') | ->click('@nav #tab-distlists') | ||||
->with('@user-distlists', function (Browser $browser) { | ->with('@user-distlists', function (Browser $browser) { | ||||
$browser->assertElementsCount('table tbody tr', 0) | $browser->assertElementsCount('table tbody tr', 0) | ||||
->assertSeeIn('table tfoot tr td', 'There are no distribution lists in this account.'); | ->assertSeeIn('table tfoot tr td', 'There are no distribution lists in this account.'); | ||||
}); | }); | ||||
// Assert Resources tab | |||||
$browser->assertSeeIn('@nav #tab-resources', 'Resources (0)') | |||||
->click('@nav #tab-resources') | |||||
->with('@user-resources', function (Browser $browser) { | |||||
$browser->assertElementsCount('table tbody tr', 0) | |||||
->assertSeeIn('table tfoot tr td', 'There are no resources in this account.'); | |||||
}); | |||||
// Assert Settings tab | // Assert Settings tab | ||||
$browser->assertSeeIn('@nav #tab-settings', 'Settings') | $browser->assertSeeIn('@nav #tab-settings', 'Settings') | ||||
->click('@nav #tab-settings') | ->click('@nav #tab-settings') | ||||
->whenAvailable('@user-settings form', function (Browser $browser) { | ->whenAvailable('@user-settings form', function (Browser $browser) { | ||||
$browser->assertElementsCount('.row', 1) | $browser->assertElementsCount('.row', 1) | ||||
->assertSeeIn('.row:first-child label', 'Greylisting') | ->assertSeeIn('.row:first-child label', 'Greylisting') | ||||
->assertSeeIn('.row:first-child .text-danger', 'disabled'); | ->assertSeeIn('.row:first-child .text-danger', 'disabled'); | ||||
}); | }); | ||||
▲ Show 20 Lines • Show All 138 Lines • Show Last 20 Lines |