Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F257021
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/tests/Browser/Mail/Print.php b/tests/Browser/Mail/Print.php
new file mode 100644
index 000000000..bde42290d
--- /dev/null
+++ b/tests/Browser/Mail/Print.php
@@ -0,0 +1,73 @@
+<?php
+
+namespace Tests\Browser\Mail;
+
+use Tests\Browser\Components\App;
+use Tests\Browser\Components\Popupmenu;
+
+class PrintTest extends \Tests\Browser\TestCase
+{
+ public static function setUpBeforeClass()
+ {
+ \bootstrap::init_imap();
+ \bootstrap::purge_mailbox('INBOX');
+
+ // import email messages
+ foreach (glob(TESTS_DIR . 'data/mail/list_00.eml') as $f) {
+ \bootstrap::import_message($f, 'INBOX');
+ }
+ }
+
+ /**
+ * Test Print action
+ */
+ public function testPrint()
+ {
+ $this->browse(function ($browser) {
+ $browser->go('mail');
+
+ $browser->waitFor('#messagelist tbody tr:first-child')
+ ->ctrlClick('#messagelist tbody tr:first-child');
+
+ $browser->clickToolbarMenuItem('more');
+
+ $browser->with(new Popupmenu('message-menu'), function ($browser) use (&$current_window, &$new_window) {
+ if ($browser->isPhone()) {
+ $browser->assertMissing('a.print');
+ return;
+ }
+
+ list($current_window, $new_window) = $browser->openWindow(function ($browser) {
+ $browser->clickMenuItem('print');
+ });
+ });
+
+ $browser->driver->switchTo()->window($new_window);
+
+ $browser->with(new App(), function ($browser) {
+ $browser->assertEnv([
+ 'task' => 'mail',
+ 'action' => 'print',
+ ]);
+ });
+
+ $browser->assertVisible('img.contactphoto')
+ ->assertSeeIn('.subject', 'Lines')
+ ->assertSeeIn('.message-part div.pre', 'Plain text message body.')
+ ->assertVisible('.message-part div.pre .sig')
+ // Tests "more recipients" link
+ ->with('.headers-table .header.cc', function ($browser) {
+ $browser->assertSee('test10@domain.tld')
+ ->assertDontSee('test11@domain.tld')
+ ->assertSeeIn('a.morelink', '2 more...')
+ ->assertElementsCount('span.adr', 10)
+ ->click('a.morelink')
+ ->assertElementsCount('span.adr', 12)
+ ->assertSee('test12@domain.tld');
+ });
+
+ $browser->driver->close();
+ $browser->driver->switchTo()->window($current_window);
+ });
+ }
+}
diff --git a/tests/Browser/phpunit.xml b/tests/Browser/phpunit.xml
index b9f8e0a96..056eff1a2 100644
--- a/tests/Browser/phpunit.xml
+++ b/tests/Browser/phpunit.xml
@@ -1,33 +1,34 @@
<phpunit backupGlobals="false"
bootstrap="bootstrap.php"
colors="true">
<testsuites>
<testsuite name="Logon">
<file>Logon/Login.php</file>
<file>Logon/Logout.php</file>
</testsuite>
<testsuite name="Contacts">
<file>Contacts/Contacts.php</file>
<file>Contacts/Groups.php</file>
<file>Contacts/Import.php</file>
<file>Contacts/Export.php</file>
</testsuite>
<testsuite name="Settings">
<file>Settings/Settings.php</file>
<file>Settings/Preferences.php</file>
<file>Settings/Preferences/General.php</file>
<file>Settings/Folders.php</file>
<file>Settings/Identities.php</file>
<file>Settings/Responses.php</file>
<file>Settings/About.php</file>
</testsuite>
<testsuite name="Mail">
<file>Mail/Mail.php</file>
<file>Mail/Compose.php</file>
<file>Mail/Getunread.php</file>
<file>Mail/List.php</file>
<file>Mail/Open.php</file>
<file>Mail/Preview.php</file>
+ <file>Mail/Print.php</file>
</testsuite>
</testsuites>
</phpunit>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Jun 10, 11:13 AM (1 d, 15 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
197072
Default Alt Text
(4 KB)
Attached To
Mode
R3 roundcubemail
Attached
Detach File
Event Timeline
Log In to Comment