Files
roundcubemail/tests/Browser/Contacts/PrintTest.php
Michael Voříšek 6a53a1d853 Fix CS (whitespace, visibility) (#9297)
* Fix "method_argument_space"

* Fix "control_structure_continuation_position"

* Fix "new_with_parentheses"

* Fix "blank_line_before_statement"

* Fix "visibility_required"

* Fix some "array_indentation"

* Fix some "array_indentation" - unify all "rcube::raise_error" calls

* rm useless eslint ignores and add rules counts

* sort eslint ignores

* fix eslint ignores grammar

* Revert "Fix "blank_line_before_statement""

* fix CS 3.46.0
2024-01-04 14:26:35 +01:00

53 lines
1.5 KiB
PHP

<?php
namespace Tests\Browser\Contacts;
use Tests\Browser\Components\App;
class PrintTest extends \Tests\Browser\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);
});
}
}