diff --git a/tests/Browser/Mail/Preview.php b/tests/Browser/Mail/Preview.php index b08947a1b..af194eab0 100644 --- a/tests/Browser/Mail/Preview.php +++ b/tests/Browser/Mail/Preview.php @@ -95,4 +95,84 @@ class Preview extends \Tests\Browser\TestCase } }); } + + /** + * Test "X more..." link on mail preview with many recipients, + * and some more + */ + public function testPreviewMorelink() + { + $this->browse(function ($browser) { + $browser->go('mail'); + + $browser->waitFor('#messagelist tbody tr:last-child') + ->click('#messagelist tbody tr:last-child') + ->waitForMessage('loading', 'Loading...') + ->waitFor('#messagecontframe') + ->waitUntilMissing('#messagestack'); + + $browser->withinFrame('#messagecontframe', function ($browser) { + $browser->waitFor('img.contactphoto'); + + $browser->assertSeeIn('.subject', 'Lines') + ->assertSeeIn('.message-part div.pre', 'Plain text message body.') + ->assertVisible('.message-part div.pre .sig'); + + $browser->assertMissing('.headers-table') + ->click('a.envelope') + ->waitFor('.headers-table') + ->assertVisible('.header.cc') + ->assertSeeIn('.header.cc', 'test10@domain.tld') + ->assertDontSeeIn('.header.cc', 'test11@domain.tld') + ->assertSeeIn('.header.cc a.morelink', '2 more...') + ->click('.header.cc a.morelink'); + }); + + $browser->waitFor('.ui-dialog') + ->with('.ui-dialog', function ($browser) { + $browser->assertSeeIn('.ui-dialog-titlebar', 'Cc') + ->assertSeeIn('.ui-dialog-content', 'test1@domain.tld') + ->assertSeeIn('.ui-dialog-content', 'test12@domain.tld'); + + $this->assertCount(12, $browser->elements('span.adr')); + + $browser->click('.ui-dialog-buttonset button.cancel'); + }); + + $browser->waitUntilMissing('.ui-dialog'); + + // Attachments list + $browser->withinFrame('#messagecontframe', function ($browser) { + $browser->with('#attachment-list', function ($browser) { + $this->assertCount(2, $browser->elements('li')); + $browser->assertVisible('li.text.plain') + ->assertSeeIn('li:first-child .attachment-name', 'lines.txt') + ->assertSeeIn('li:first-child .attachment-size', '(~13 B)') + ->assertSeeIn('li:last-child .attachment-name', 'lines_lf.txt') + ->assertSeeIn('li:last-child .attachment-size', '(~11 B)') + ->click('li:first-child a.dropdown'); + }); + + if (!$browser->isPhone()) { + $browser->waitFor('#attachmentmenu') + ->with('#attachmentmenu', function ($browser) { + $browser->assertVisible('a.extwin:not(.disabled)') + ->assertVisible('a.download:not(.disabled)'); + }); + } + }); + + if ($browser->isPhone()) { + $browser->waitFor('#attachmentmenu-clone') + ->with('#attachmentmenu-clone', function ($browser) { + $browser->assertVisible('a.extwin:not(.disabled)') + ->assertVisible('a.download:not(.disabled)'); + }) + ->click('.popover a.cancel') + ->waitUntilMissing('.popover') + ->click('#layout-content .header a.back-list-button') + ->assertVisible('#messagelist'); + } + }); + } } diff --git a/tests/Browser/data/mail/list_00.eml b/tests/Browser/data/mail/list_00.eml index e5977d4fc..3c0d10cc7 100644 --- a/tests/Browser/data/mail/list_00.eml +++ b/tests/Browser/data/mail/list_00.eml @@ -1,18 +1,19 @@ Return-Path: X-Original-To: tb@tester.local +From: "Thomas B." To: Tom Tester Subject: Lines -X-PHP-Originating-Script: 501:rcmail.php +Cc: test1@domain.tld, test2@domain.tld, test3@domain.tld, test4@domain.tld, + test5@domain.tld, test6@domain.tld, test7@domain.tld, test8@domain.tld, + test9@domain.tld, test10@domain.tld, test11@domain.tld, test12@domain.tld MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_8853bfb47b7da1852ac882e69cc724f3" Date: Fri, 23 May 2014 19:44:50 +0200 -From: "Thomas B." Reply-To: hello@roundcube.net Mail-Reply-To: hello@roundcube.net Message-ID: <99839b8ec12482419372f1edafa9de75@woodcrest.local> X-Sender: thomas@roundcube.net -User-Agent: Roundcube Webmail/1.0.1 --=_8853bfb47b7da1852ac882e69cc724f3 Content-Transfer-Encoding: 7bit