Files
roundcubemail/tests/Browser/Contacts/PrintTest.php
Michael Voříšek 54f4aa33f9 Fix CS - imports (#9316)
* fix Tests\Browser\TestCase imports

* fix remaining imports

* fix PHPUnit\Framework\TestCase imports

* import GuzzleHttp\Client

* fix remaining

* "php_unit_method_casing" is not todo

* fix "single_line_comment_spacing"

* fix 2nd commit done using older fixer
2024-01-21 19:13:31 +01:00

54 lines
1.5 KiB
PHP

<?php
namespace Tests\Browser\Contacts;
use Tests\Browser\Components\App;
use Tests\Browser\TestCase;
class PrintTest extends TestCase
{
public static function setUpBeforeClass(): void
{
\bootstrap::init_db();
}
/**
* Test Print action
*/
public function testPrint()
{
$this->browse(function ($browser) {
$browser->go('addressbook');
$browser->waitFor('#contacts-table tbody tr:first-child')
->ctrlClick('#contacts-table tbody tr:first-child');
[$current_window, $new_window] = $browser->openWindow(function ($browser) {
if ($browser->isPhone()) {
$this->markTestSkipped();
}
$browser->clickToolbarMenuItem('print');
});
$browser->driver->switchTo()->window($new_window);
$browser->with(new App(), static function ($browser) {
$browser->assertEnv([
'task' => 'addressbook',
'action' => 'print',
]);
});
$browser->assertVisible('#contactphoto img')
->assertSeeIn('#contacthead .firstname', 'John')
->assertSeeIn('#contacthead .surname', 'Doe')
->assertSeeIn('#contacttabs fieldset:first-child legend', 'Properties')
->assertSeeIn('#contacttabs', 'johndoe@example.org');
$browser->driver->close();
$browser->driver->switchTo()->window($current_window);
});
}
}