Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/UsersTest.php
Show First 20 Lines • Show All 101 Lines • ▼ Show 20 Lines | public function testList(): void | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$browser->visit(new Home()) | $browser->visit(new Home()) | ||||
->submitLogon('john@kolab.org', 'simple123', true) | ->submitLogon('john@kolab.org', 'simple123', true) | ||||
->on(new Dashboard()) | ->on(new Dashboard()) | ||||
->assertSeeIn('@links .link-users', 'User accounts') | ->assertSeeIn('@links .link-users', 'User accounts') | ||||
->click('@links .link-users') | ->click('@links .link-users') | ||||
->on(new UserList()) | ->on(new UserList()) | ||||
->whenAvailable('@table', function (Browser $browser) { | ->whenAvailable('@table', function (Browser $browser) { | ||||
$browser->assertElementsCount('tbody tr', 4) | $browser->waitFor('tbody tr') | ||||
->assertElementsCount('tbody tr', 4) | |||||
->assertSeeIn('tbody tr:nth-child(1) a', 'jack@kolab.org') | ->assertSeeIn('tbody tr:nth-child(1) a', 'jack@kolab.org') | ||||
->assertSeeIn('tbody tr:nth-child(2) a', 'joe@kolab.org') | ->assertSeeIn('tbody tr:nth-child(2) a', 'joe@kolab.org') | ||||
->assertSeeIn('tbody tr:nth-child(3) a', 'john@kolab.org') | ->assertSeeIn('tbody tr:nth-child(3) a', 'john@kolab.org') | ||||
->assertSeeIn('tbody tr:nth-child(4) a', 'ned@kolab.org') | ->assertSeeIn('tbody tr:nth-child(4) a', 'ned@kolab.org') | ||||
->assertVisible('tbody tr:nth-child(1) button.button-delete') | ->assertVisible('tbody tr:nth-child(1) button.button-delete') | ||||
->assertVisible('tbody tr:nth-child(2) button.button-delete') | ->assertVisible('tbody tr:nth-child(2) button.button-delete') | ||||
->assertVisible('tbody tr:nth-child(3) button.button-delete') | ->assertVisible('tbody tr:nth-child(3) button.button-delete') | ||||
->assertVisible('tbody tr:nth-child(4) button.button-delete'); | ->assertVisible('tbody tr:nth-child(4) button.button-delete'); | ||||
▲ Show 20 Lines • Show All 392 Lines • ▼ Show 20 Lines | public function testDiscountedPrices(): void | ||||
$wallet->save(); | $wallet->save(); | ||||
// SKUs on user edit page | // SKUs on user edit page | ||||
$this->browse(function (Browser $browser) { | $this->browse(function (Browser $browser) { | ||||
$browser->visit('/logout') | $browser->visit('/logout') | ||||
->on(new Home()) | ->on(new Home()) | ||||
->submitLogon('john@kolab.org', 'simple123', true) | ->submitLogon('john@kolab.org', 'simple123', true) | ||||
->visit(new UserList()) | ->visit(new UserList()) | ||||
->waitFor('@table tr:nth-child(2)') | |||||
->click('@table tr:nth-child(2) a') | ->click('@table tr:nth-child(2) a') | ||||
->on(new UserInfo()) | ->on(new UserInfo()) | ||||
->with('@form', function (Browser $browser) { | ->with('@form', function (Browser $browser) { | ||||
$browser->whenAvailable('@skus', function (Browser $browser) { | $browser->whenAvailable('@skus', function (Browser $browser) { | ||||
$quota_input = new QuotaInput('tbody tr:nth-child(2) .range-input'); | $quota_input = new QuotaInput('tbody tr:nth-child(2) .range-input'); | ||||
$browser->waitFor('tbody tr') | $browser->waitFor('tbody tr') | ||||
->assertElementsCount('tbody tr', 5) | ->assertElementsCount('tbody tr', 5) | ||||
// Mailbox SKU | // Mailbox SKU | ||||
Show All 34 Lines |