Changeset View
Changeset View
Standalone View
Standalone View
src/tests/Browser/SharedFolderTest.php
Show First 20 Lines • Show All 150 Lines • ▼ Show 20 Lines | public function testCreateUpdateDelete(): void | ||||
->assertSeeIn('div.row:nth-child(3) label', 'Domain') | ->assertSeeIn('div.row:nth-child(3) label', 'Domain') | ||||
->assertSelectHasOptions('div.row:nth-child(3) select', ['kolab.org']) | ->assertSelectHasOptions('div.row:nth-child(3) select', ['kolab.org']) | ||||
->assertValue('div.row:nth-child(3) select', 'kolab.org') | ->assertValue('div.row:nth-child(3) select', 'kolab.org') | ||||
->assertSeeIn('div.row:nth-child(4) label', 'Email Addresses') | ->assertSeeIn('div.row:nth-child(4) label', 'Email Addresses') | ||||
->with(new ListInput('#aliases'), function (Browser $browser) { | ->with(new ListInput('#aliases'), function (Browser $browser) { | ||||
$browser->assertListInputValue([]) | $browser->assertListInputValue([]) | ||||
->assertValue('@input', ''); | ->assertValue('@input', ''); | ||||
}) | }) | ||||
->assertSeeIn('div.row:nth-child(5) label', 'Subscriptions') | |||||
->with('@skus', function ($browser) { | |||||
$browser->assertElementsCount('tbody tr', 1) | |||||
->assertSeeIn('tbody tr:nth-child(1) td.name', 'Shared Folder') | |||||
->assertSeeIn('tbody tr:nth-child(1) td.price', '0,89 CHF/month') | |||||
->assertChecked('tbody tr:nth-child(1) td.selection input') | |||||
->assertDisabled('tbody tr:nth-child(1) td.selection input') | |||||
->assertTip( | |||||
'tbody tr:nth-child(1) td.buttons button', | |||||
'A shared folder' | |||||
); | |||||
}) | |||||
->assertSeeIn('button[type=submit]', 'Submit'); | ->assertSeeIn('button[type=submit]', 'Submit'); | ||||
}) | }) | ||||
// Test error conditions | // Test error conditions | ||||
->type('#name', str_repeat('A', 192)) | ->type('#name', str_repeat('A', 192)) | ||||
->select('#type', 'event') | ->select('#type', 'event') | ||||
->assertMissing('#aliases') | ->assertMissing('#aliases') | ||||
->click('@general button[type=submit]') | ->click('@general button[type=submit]') | ||||
->waitFor('#name + .invalid-feedback') | ->waitFor('#name + .invalid-feedback') | ||||
▲ Show 20 Lines • Show All 97 Lines • ▼ Show 20 Lines | public function testCreateUpdateDelete(): void | ||||
->with('@general', function (Browser $browser) { | ->with('@general', function (Browser $browser) { | ||||
// Assert form content | // Assert form content | ||||
$browser->assertFocused('#name') | $browser->assertFocused('#name') | ||||
->assertValue('div.row:nth-child(2) input[type=text]', 'Test Folder2') | ->assertValue('div.row:nth-child(2) input[type=text]', 'Test Folder2') | ||||
->assertSelected('div.row:nth-child(3) select:disabled', 'mail') | ->assertSelected('div.row:nth-child(3) select:disabled', 'mail') | ||||
->with(new ListInput('#aliases'), function (Browser $browser) { | ->with(new ListInput('#aliases'), function (Browser $browser) { | ||||
$browser->assertListInputValue(['folder-alias1@kolab.org', 'folder-alias2@kolab.org']) | $browser->assertListInputValue(['folder-alias1@kolab.org', 'folder-alias2@kolab.org']) | ||||
->assertValue('@input', ''); | ->assertValue('@input', ''); | ||||
}) | |||||
->with('@skus', function ($browser) { | |||||
$browser->assertElementsCount('tbody tr', 1) | |||||
->assertSeeIn('tbody tr:nth-child(1) td.name', 'Shared Folder') | |||||
->assertSeeIn('tbody tr:nth-child(1) td.price', '0,89 CHF/month') | |||||
->assertChecked('tbody tr:nth-child(1) td.selection input') | |||||
->assertDisabled('tbody tr:nth-child(1) td.selection input') | |||||
->assertTip( | |||||
'tbody tr:nth-child(1) td.buttons button', | |||||
'A shared folder' | |||||
); | |||||
}); | }); | ||||
}) | }) | ||||
// change folder name, and remove one alias | // change folder name, and remove one alias | ||||
->type('#name', 'Test Folder Update2') | ->type('#name', 'Test Folder Update2') | ||||
->with(new ListInput('#aliases'), function (Browser $browser) { | ->with(new ListInput('#aliases'), function (Browser $browser) { | ||||
$browser->removeListEntry(2); | $browser->removeListEntry(2); | ||||
}) | }) | ||||
->click('@general button[type=submit]') | ->click('@general button[type=submit]') | ||||
▲ Show 20 Lines • Show All 118 Lines • Show Last 20 Lines |