Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/Admin/UserTest.php
Show First 20 Lines • Show All 362 Lines • ▼ Show 20 Lines | public function testUserInfo2(): void | ||||
->assertSeeIn('table tbody tr:nth-child(4) td:first-child', 'Activesync') | ->assertSeeIn('table tbody tr:nth-child(4) td:first-child', 'Activesync') | ||||
->assertSeeIn('table tbody tr:nth-child(4) td:last-child', '0,00 CHF/month¹') | ->assertSeeIn('table tbody tr:nth-child(4) td:last-child', '0,00 CHF/month¹') | ||||
->assertSeeIn('table tbody tr:nth-child(5) td:first-child', '2-Factor Authentication') | ->assertSeeIn('table tbody tr:nth-child(5) td:first-child', '2-Factor Authentication') | ||||
->assertSeeIn('table tbody tr:nth-child(5) td:last-child', '0,00 CHF/month¹') | ->assertSeeIn('table tbody tr:nth-child(5) td:last-child', '0,00 CHF/month¹') | ||||
->assertSeeIn('table tbody tr:nth-child(6) td:first-child', 'Private Beta (invitation only)') | ->assertSeeIn('table tbody tr:nth-child(6) td:first-child', 'Private Beta (invitation only)') | ||||
->assertSeeIn('table tbody tr:nth-child(6) td:last-child', '45,09 CHF/month¹') | ->assertSeeIn('table tbody tr:nth-child(6) td:last-child', '45,09 CHF/month¹') | ||||
->assertMissing('table tfoot') | ->assertMissing('table tfoot') | ||||
->assertSeeIn('table + .hint', '¹ applied discount: 10% - Test voucher') | ->assertSeeIn('table + .hint', '¹ applied discount: 10% - Test voucher') | ||||
->assertSeeIn('#reset2fa', 'Reset 2-Factor Auth'); | ->assertSeeIn('#reset2fa', 'Reset 2-Factor Auth') | ||||
->assertMissing('#addbetasku'); | |||||
}); | }); | ||||
// We don't expect John's domains here | // We don't expect John's domains here | ||||
$browser->assertSeeIn('@nav #tab-domains', 'Domains (0)') | $browser->assertSeeIn('@nav #tab-domains', 'Domains (0)') | ||||
->click('@nav #tab-domains') | ->click('@nav #tab-domains') | ||||
->with('@user-domains', function (Browser $browser) { | ->with('@user-domains', function (Browser $browser) { | ||||
$browser->assertElementsCount('table tbody tr', 0) | $browser->assertElementsCount('table tbody tr', 0) | ||||
->assertSeeIn('table tfoot tr td', 'There are no domains in this account.'); | ->assertSeeIn('table tfoot tr td', 'There are no domains in this account.'); | ||||
▲ Show 20 Lines • Show All 130 Lines • ▼ Show 20 Lines | public function testReset2FA(): void | ||||
->assertSeeIn('@button-action', 'Reset') | ->assertSeeIn('@button-action', 'Reset') | ||||
->click('@button-action'); | ->click('@button-action'); | ||||
}) | }) | ||||
->assertToast(Toast::TYPE_SUCCESS, '2-Factor authentication reset successfully.') | ->assertToast(Toast::TYPE_SUCCESS, '2-Factor authentication reset successfully.') | ||||
->assertMissing('#sku' . $sku2fa->id) | ->assertMissing('#sku' . $sku2fa->id) | ||||
->assertSeeIn('@nav #tab-subscriptions', 'Subscriptions (0)'); | ->assertSeeIn('@nav #tab-subscriptions', 'Subscriptions (0)'); | ||||
}); | }); | ||||
} | } | ||||
/** | |||||
* Test adding the beta SKU for the user | |||||
*/ | |||||
public function testAddBetaSku(): void | |||||
{ | |||||
$this->browse(function (Browser $browser) { | |||||
$this->deleteTestUser('userstest1@kolabnow.com'); | |||||
$user = $this->getTestUser('userstest1@kolabnow.com'); | |||||
$sku = Sku::withEnvTenantContext()->where('title', 'beta')->first(); | |||||
$browser->visit(new UserPage($user->id)) | |||||
->click('@nav #tab-subscriptions') | |||||
->waitFor('@user-subscriptions #addbetasku') | |||||
->assertSeeIn('@nav #tab-subscriptions', 'Subscriptions (0)') | |||||
->assertSeeIn('#addbetasku', 'Enable beta program') | |||||
->click('#addbetasku') | |||||
->assertToast(Toast::TYPE_SUCCESS, 'The subscription added successfully.') | |||||
->waitFor('#sku' . $sku->id) | |||||
->assertSeeIn("#sku{$sku->id} td:first-child", 'Private Beta (invitation only)') | |||||
->assertSeeIn("#sku{$sku->id} td:last-child", '0,00 CHF/month') | |||||
->assertMissing('#addbetasku') | |||||
->assertSeeIn('@nav #tab-subscriptions', 'Subscriptions (1)'); | |||||
}); | |||||
} | |||||
} | } |