Page MenuHomePhorge

No OneTemporary

Size
64 KB
Referenced Files
None
Subscribers
None
diff --git a/tests/Browser/Contacts/Contacts.php b/tests/Browser/Contacts/ContactsTest.php
similarity index 97%
rename from tests/Browser/Contacts/Contacts.php
rename to tests/Browser/Contacts/ContactsTest.php
index abb4ac082..9f8a98fe1 100644
--- a/tests/Browser/Contacts/Contacts.php
+++ b/tests/Browser/Contacts/ContactsTest.php
@@ -1,81 +1,81 @@
<?php
namespace Tests\Browser\Contacts;
use Tests\Browser\Components\App;
-class Contacts extends \Tests\Browser\TestCase
+class ContactsTest extends \Tests\Browser\TestCase
{
protected function setUp()
{
parent::setUp();
\bootstrap::init_db();
}
/**
* Contacts UI Basics
*/
public function testContactsUI()
{
$this->browse(function ($browser) {
$browser->go('addressbook');
$browser->with(new App(), function ($browser) {
// check task
$browser->assertEnv('task', 'addressbook');
// these objects should be there always
$browser->assertObjects(['qsearchbox', 'folderlist', 'contactslist', 'countdisplay']);
});
if (!$browser->isDesktop()) {
$browser->assertMissing('#directorylist');
$browser->click('a.back-sidebar-button');
}
// Groups/Addressbooks list
$browser->assertVisible('#directorylist');
$browser->assertSeeIn('#directorylist li:first-child', 'Personal Addresses');
$browser->assertMissing('#directorylist .treetoggle.expanded');
// Contacts list
if (!$browser->isDesktop()) {
$browser->assertMissing('#contacts-table');
$browser->click('#directorylist li:first-child');
$browser->waitFor('#contacts-table');
}
else {
$browser->assertVisible('#contacts-table');
}
// Contacts list menu
if ($browser->isPhone()) {
$browser->assertToolbarMenu(['select'], []);
}
else if ($browser->isTablet()) {
$browser->click('.toolbar-list-button')
->waitFor('#toolbar-list-menu')
->assertVisible('#toolbar-list-menu a.select:not(.disabled)')
->click();
}
else {
$browser->assertVisible('#toolbar-list-menu a.select:not(.disabled)');
}
// Toolbar menu
$browser->assertToolbarMenu(
['create', 'search', 'import', 'export'], // active items
['print', 'delete', 'more'], // inactive items
);
// Contact frame
if (!$browser->isPhone()) {
$browser->assertVisible('#contact-frame');
}
// Task menu
$browser->assertTaskMenu('contacts');
});
}
}
diff --git a/tests/Browser/Contacts/Export.php b/tests/Browser/Contacts/ExportTest.php
similarity index 96%
rename from tests/Browser/Contacts/Export.php
rename to tests/Browser/Contacts/ExportTest.php
index cfe3977de..807ff6386 100644
--- a/tests/Browser/Contacts/Export.php
+++ b/tests/Browser/Contacts/ExportTest.php
@@ -1,55 +1,55 @@
<?php
namespace Tests\Browser\Contacts;
-class Export extends \Tests\Browser\TestCase
+class ExportTest extends \Tests\Browser\TestCase
{
/**
* Test exporting all contacts
*/
public function testExportAll()
{
\bootstrap::init_db();
$this->browse(function ($browser) {
$browser->go('addressbook');
$browser->clickToolbarMenuItem('export');
// Parse the downloaded vCard file
$vcard_content = $browser->readDownloadedFile('contacts.vcf');
$vcard = new \rcube_vcard();
$contacts = $vcard->import($vcard_content);
$this->assertCount(2, $contacts);
$this->assertSame('John Doe', $contacts[0]->displayname);
$this->assertSame('Jane Stalone', $contacts[1]->displayname);
$browser->removeDownloadedFile('contacts.vcf');
});
}
/**
* Test exporting selected contacts
*
* @depends testExportAll
*/
public function testExportSelected()
{
$this->browse(function ($browser) {
$browser->ctrlClick('#contacts-table tbody tr:first-child');
$browser->clickToolbarMenuItem('export', 'export.select');
$vcard_content = $browser->readDownloadedFile('contacts.vcf');
$vcard = new \rcube_vcard();
$contacts = $vcard->import($vcard_content);
// Parse the downloaded vCard file
$this->assertCount(1, $contacts);
$this->assertSame('John Doe', $contacts[0]->displayname);
$browser->removeDownloadedFile('contacts.vcf');
});
}
}
diff --git a/tests/Browser/Contacts/Groups.php b/tests/Browser/Contacts/GroupsTest.php
similarity index 99%
rename from tests/Browser/Contacts/Groups.php
rename to tests/Browser/Contacts/GroupsTest.php
index 0d0fef794..c5989cb29 100644
--- a/tests/Browser/Contacts/Groups.php
+++ b/tests/Browser/Contacts/GroupsTest.php
@@ -1,181 +1,181 @@
<?php
namespace Tests\Browser\Contacts;
use Tests\Browser\Components\Popupmenu;
-class Groups extends \Tests\Browser\TestCase
+class GroupsTest extends \Tests\Browser\TestCase
{
/**
* Contact groups UI basics
*/
public function testGroups()
{
\bootstrap::init_db();
$this->browse(function ($browser) {
$browser->go('addressbook');
if (!$browser->isDesktop()) {
$browser->assertMissing('#directorylist');
$browser->click('a.back-sidebar-button');
}
// Groups/Addressbooks list
$browser->assertVisible('#directorylist');
$browser->assertSeeIn('#directorylist li:first-child', 'Personal Addresses');
$browser->assertSeeIn('#layout-sidebar .header', 'Groups');
$browser->click('#layout-sidebar .header .sidebar-menu');
$browser->with(new Popupmenu('groupoptions-menu'), function ($browser) {
// Note: These are button class names, not action names
$active = ['create'];
$disabled = ['group.rename', 'group.delete', 'search', 'search.delete'];
$browser->assertMenuState($active, $disabled);
$browser->closeMenu();
});
});
}
/**
* Contact group creation
*/
public function testGroupCreate()
{
$this->browse(function ($browser) {
$browser->go('addressbook');
if (!$browser->isDesktop()) {
$browser->click('a.back-sidebar-button');
}
$browser->click('#layout-sidebar .header .sidebar-menu');
$browser->with(new Popupmenu('groupoptions-menu'), function ($browser) {
$browser->clickMenuItem('create');
});
$browser->waitFor('.ui-dialog');
$browser->with('.ui-dialog', function ($browser) {
$browser
->assertSeeIn('.ui-dialog-titlebar', 'Create new group')
->assertFocused('input.form-control')
->type('input.form-control', 'New Group')
->click('button.mainaction');
});
$browser->waitUntilMissing('.ui-dialog');
$browser->with('#directorylist', function ($browser) {
$browser->waitFor('li:first-child ul.groups')
->assertVisible('.treetoggle.expanded')
->assertElementsCount('ul.groups > li.contactgroup', 1)
->assertSeeIn('ul.groups > li.contactgroup', 'New Group');
// Test expand toggle
$browser->click('.treetoggle.expanded')
->assertMissing('ul.groups')
->click('.treetoggle.collapsed')
->assertSeeIn('ul.groups > li.contactgroup', 'New Group');
});
});
}
/**
* Contact group rename
*
* @depends testGroupCreate
*/
public function testGroupRename()
{
$this->browse(function ($browser) {
$browser->go('addressbook');
if (!$browser->isDesktop()) {
$browser->click('a.back-sidebar-button');
}
$browser->click('#directorylist ul.groups > li:first-child');
if (!$browser->isDesktop()) {
$browser->click('a.back-sidebar-button');
}
$browser->click('#layout-sidebar .header .sidebar-menu');
$browser->with(new Popupmenu('groupoptions-menu'), function ($browser) {
$browser->clickMenuItem('group.rename');
});
$browser->waitFor('.ui-dialog');
$browser->with('.ui-dialog', function ($browser) {
$browser->assertSeeIn('.ui-dialog-titlebar', 'Rename group')
->assertFocused('input.form-control')
->assertValue('input.form-control', 'New Group')
->type('input.form-control', 'Renamed')
->click('button.mainaction');
});
$browser->waitUntilMissing('.ui-dialog');
$browser->with('#directorylist', function ($browser) {
$browser->waitFor('li:first-child ul.groups')
->assertVisible('.treetoggle.expanded')
->assertElementsCount('ul.groups > li.contactgroup', 1)
->assertSeeIn('ul.groups > li.contactgroup', 'Renamed');
// Test if expand toggle is still working
$browser->click('.treetoggle.expanded')
->assertMissing('ul.groups')
->click('.treetoggle.collapsed')
->assertSeeIn('ul.groups > li.contactgroup', 'Renamed');
});
});
}
/**
* Contact group deletion
*
* @depends testGroupRename
*/
public function testGroupDelete()
{
$this->browse(function ($browser) {
$browser->go('addressbook');
if (!$browser->isDesktop()) {
$browser->click('a.back-sidebar-button');
}
$browser->click('#directorylist ul.groups > li:first-child');
if (!$browser->isDesktop()) {
$browser->click('a.back-sidebar-button');
}
$browser->click('#layout-sidebar .header .sidebar-menu');
$browser->with(new Popupmenu('groupoptions-menu'), function ($browser) {
$browser->clickMenuItem('group.delete');
});
$browser->waitFor('.ui-dialog');
$browser->with('.ui-dialog', function ($browser) {
$browser->assertSeeIn('.ui-dialog-titlebar', 'Are you sure...')
->assertSeeIn('.ui-dialog-content', 'Do you really want to delete selected group?')
->assertFocused('button.mainaction.delete')
->click('button.mainaction.delete');
});
$browser->waitUntilMissing('.ui-dialog');
$browser->with('#directorylist', function ($browser) {
$browser->assertMissing('.treetoggle.expanded')
->assertMissing('ul.groups');
});
});
}
}
diff --git a/tests/Browser/Contacts/Import.php b/tests/Browser/Contacts/ImportTest.php
similarity index 98%
rename from tests/Browser/Contacts/Import.php
rename to tests/Browser/Contacts/ImportTest.php
index 9d152c1e0..aad53306f 100644
--- a/tests/Browser/Contacts/Import.php
+++ b/tests/Browser/Contacts/ImportTest.php
@@ -1,106 +1,106 @@
<?php
namespace Tests\Browser\Contacts;
use Tests\Browser\Components\App;
-class Import extends \Tests\Browser\TestCase
+class ImportTest extends \Tests\Browser\TestCase
{
/**
* Test basic elements of contacts import UI
*/
public function testImportUI()
{
\bootstrap::init_db();
$this->browse(function ($browser) {
$browser->go('addressbook');
$browser->clickToolbarMenuItem('import');
$browser->assertSeeIn('.ui-dialog-title', 'Import contacts');
$browser->assertVisible('.ui-dialog button.mainaction.import');
$browser->assertVisible('.ui-dialog button.cancel');
$browser->withinFrame('.ui-dialog iframe', function ($browser) {
// check task and action
$browser->with(new App(), function ($browser) {
$browser->assertEnv('task', 'addressbook');
$browser->assertEnv('action', 'import');
// these objects should be there always
$browser->assertObjects(['importform']);
});
$browser->assertSee('You can upload');
$browser->assertVisible('#rcmImportForm');
$browser->assertVisible('#rcmImportForm select');
$browser->assertVisible('#rcmImportForm .custom-switch');
// FIXME: selecting the file input directly does not work
$browser->assertVisible('#rcmImportForm .custom-file');
$browser->assertSelected('#rcmImportForm select', 0);
});
// Close the dialog
$browser->click('.ui-dialog button.cancel');
$browser->assertMissing('.ui-dialog');
});
}
/**
* Import contacts from a vCard file
*
* @depends testImportUI
*/
public function testImportProcess()
{
$this->browse(function ($browser) {
// Open the dialog again
$browser->clickToolbarMenuItem('import');
$browser->assertSeeIn('.ui-dialog-title', 'Import contacts');
// Submit the form with no file attached
$browser->click('.ui-dialog button.mainaction');
$browser->waitForText('Attention');
$browser->assertSee('Please select a file');
$browser->driver->getKeyboard()->sendKeys(\Facebook\WebDriver\WebDriverKeys::ESCAPE);
$browser->assertElementsCount('.ui-dialog', 1);
$browser->withinFrame('.ui-dialog iframe', function ($browser) {
$browser->attach('.custom-file input', TESTS_DIR . 'data/contacts.vcf');
});
$browser->click('.ui-dialog button.mainaction');
$browser->withinFrame('.ui-dialog iframe', function ($browser) {
$browser->waitForText('Successfully imported 2 contacts:');
});
// Close the dialog
$browser->click('.ui-dialog button.cancel');
// Expected existing contacts + imported
$browser->waitFor('#contacts-table tr')
->assertElementsCount('#contacts-table tbody tr', 4)
->assertSeeIn('#rcmcountdisplay', '1 – 4 of 4');
});
}
/**
* Test imported contact
*
* @depends testImportProcess
*/
public function testImportResult()
{
$this->browse(function ($browser) {
// Open the dialog again
$browser->click('#contacts-table tr:last-child');
$browser->withinFrame('#contact-frame', function ($browser) {
$browser->waitFor('a.email'); // wait for iframe to load
$browser->assertSeeIn('.names', 'Sylvester Stalone');
$browser->assertSeeIn('a.email', 's.stalone@rambo.tv');
});
});
}
}
diff --git a/tests/Browser/Logon/Login.php b/tests/Browser/Logon/LoginTest.php
similarity index 97%
rename from tests/Browser/Logon/Login.php
rename to tests/Browser/Logon/LoginTest.php
index 306939569..95c614de2 100644
--- a/tests/Browser/Logon/Login.php
+++ b/tests/Browser/Logon/LoginTest.php
@@ -1,53 +1,53 @@
<?php
namespace Tests\Browser;
use Tests\Browser\Components\App;
-class Login extends TestCase
+class LoginTest extends TestCase
{
protected function setUp()
{
parent::setUp();
\bootstrap::init_db();
\bootstrap::init_imap();
}
public function testLogin()
{
// First test, we're already on the logon page
$this->browse(function ($browser) {
$browser->visit('/');
$browser->assertTitleContains($this->app->config->get('product_name'));
// task should be set to 'login'
$browser->with(new App(), function ($browser) {
$browser->assertEnv('task', 'login');
});
// Logon form
$browser->assertVisible('#logo');
$browser->assertVisible('#login-form');
$browser->assertVisible('#rcmloginuser');
$browser->assertVisible('#rcmloginpwd');
$browser->assertVisible('#rcmloginsubmit');
$browser->assertSee($this->app->config->get('product_name'));
// Support link
if ($url = $this->app->config->get('support_url')) {
$browser->assertSeeLink('Get support');
$this->assertStringStartsWith($url, $browser->attribute('.support-link', 'href'));
}
// test valid login
$browser->go('mail');
// task should be set to 'mail' now
$browser->with(new App(), function ($browser) {
$browser->assertEnv('task', 'mail');
});
});
}
}
diff --git a/tests/Browser/Logon/Logout.php b/tests/Browser/Logon/LogoutTest.php
similarity index 95%
rename from tests/Browser/Logon/Logout.php
rename to tests/Browser/Logon/LogoutTest.php
index 96105d61c..ec2b811fd 100644
--- a/tests/Browser/Logon/Logout.php
+++ b/tests/Browser/Logon/LogoutTest.php
@@ -1,28 +1,28 @@
<?php
namespace Tests\Browser;
use Tests\Browser\Components\App;
-class Logout extends TestCase
+class LogoutTest extends TestCase
{
public function testLogout()
{
$this->browse(function ($browser) {
$browser->go('settings');
// click the Logout button in taskmenu
$browser->clickTaskMenuItem('logout');
// task should be set to 'login'
$browser->with(new App(), function ($browser) {
$browser->assertEnv('task', 'login');
});
// form should exist
$browser->assertVisible('input[name="_user"]');
$browser->assertVisible('input[name="_pass"]');
$browser->assertMissing('#taskmenu');
});
}
}
diff --git a/tests/Browser/Mail/Compose.php b/tests/Browser/Mail/ComposeTest.php
similarity index 97%
rename from tests/Browser/Mail/Compose.php
rename to tests/Browser/Mail/ComposeTest.php
index 2d8054cce..b9b8812c6 100644
--- a/tests/Browser/Mail/Compose.php
+++ b/tests/Browser/Mail/ComposeTest.php
@@ -1,68 +1,68 @@
<?php
namespace Tests\Browser\Mail;
use Tests\Browser\Components\App;
-class Compose extends \Tests\Browser\TestCase
+class ComposeTest extends \Tests\Browser\TestCase
{
public function testCompose()
{
$this->browse(function ($browser) {
$browser->go('mail');
$browser->clickTaskMenuItem('compose');
// check task and action
$browser->with(new App(), function ($browser) {
$browser->assertEnv('task', 'mail');
$browser->assertEnv('action', 'compose');
// these objects should be there always
$browser->assertObjects([
'qsearchbox',
'addressbookslist',
'contactslist',
'messageform',
'attachmentlist',
'filedrop',
'uploadform'
]);
});
// Toolbar menu
$browser->assertToolbarMenu(
['save.draft', 'responses', 'spellcheck'], // active items
['signature'], // inactive items
);
if ($browser->isPhone()) {
$browser->assertToolbarMenu(['options'], []);
}
else {
$browser->assertToolbarMenu(['attach'], []);
$browser->assertMissing('#toolbar-menu a.options');
}
// Task menu
$browser->assertTaskMenu('compose');
// Header inputs
$browser->assertVisible('#_from');
$browser->assertVisible('#compose-subject');
$browser->assertInputValue('#compose-subject', '');
// Mail body input
$browser->assertVisible('#composebodycontainer.html-editor');
$browser->assertVisible('#composebodycontainer > textarea');
if ($browser->isPhone()) {
$browser->clickToolbarMenuItem('options');
}
// Compose options
$browser->assertSeeIn('#layout-sidebar .header', 'Options and attachments');
$browser->assertVisible('#compose-attachments');
});
}
}
diff --git a/tests/Browser/Mail/Getunread.php b/tests/Browser/Mail/GetunreadTest.php
similarity index 95%
rename from tests/Browser/Mail/Getunread.php
rename to tests/Browser/Mail/GetunreadTest.php
index d6ac9d593..e1242e8da 100644
--- a/tests/Browser/Mail/Getunread.php
+++ b/tests/Browser/Mail/GetunreadTest.php
@@ -1,41 +1,41 @@
<?php
namespace Tests\Browser\Mail;
-class Getunread extends \Tests\Browser\TestCase
+class GetunreadTest extends \Tests\Browser\TestCase
{
protected static $msgcount = 0;
public static function setUpBeforeClass()
{
\bootstrap::init_imap();
\bootstrap::purge_mailbox('INBOX');
// import email messages
foreach (glob(TESTS_DIR . 'data/mail/list_??.eml') as $f) {
\bootstrap::import_message($f, 'INBOX');
self::$msgcount++;
}
}
public function testGetunread()
{
$this->browse(function ($browser) {
$browser->go('mail');
$browser->waitFor('#messagelist tbody tr');
// Messages list state
$browser->assertElementsCount('#messagelist tbody tr.unread', self::$msgcount);
if (!$browser->isDesktop()) {
$browser->click('.back-sidebar-button');
}
// Folders list state
$browser->assertVisible('.folderlist li.inbox.unread');
$this->assertEquals(strval(self::$msgcount), $browser->text('.folderlist li.inbox span.unreadcount'));
});
}
}
diff --git a/tests/Browser/Mail/List.php b/tests/Browser/Mail/ListTest.php
similarity index 99%
rename from tests/Browser/Mail/List.php
rename to tests/Browser/Mail/ListTest.php
index fea7a3061..8405b1b2f 100644
--- a/tests/Browser/Mail/List.php
+++ b/tests/Browser/Mail/ListTest.php
@@ -1,133 +1,133 @@
<?php
namespace Tests\Browser\Mail;
use Tests\Browser\Components\Toolbarmenu;
-class MailList extends \Tests\Browser\TestCase
+class ListTest extends \Tests\Browser\TestCase
{
protected static $msgcount = 0;
public static function setUpBeforeClass()
{
\bootstrap::init_imap();
\bootstrap::purge_mailbox('INBOX');
// import email messages
foreach (glob(TESTS_DIR . 'data/mail/list_??.eml') as $f) {
\bootstrap::import_message($f, 'INBOX');
self::$msgcount++;
}
}
public function testList()
{
$this->browse(function ($browser) {
$browser->go('mail');
$browser->assertElementsCount('#messagelist tbody tr', self::$msgcount);
// check message list
$browser->assertVisible('#messagelist tbody tr:first-child.unread');
$this->assertEquals('Test HTML with local and remote image',
$browser->text('#messagelist tbody tr:first-child span.subject'));
// Note: This element icon has width=0, use assertPresent() not assertVisible()
$browser->assertPresent('#messagelist tbody tr:first-child span.msgicon.unread');
// List toolbar menu
$browser->assertVisible('#layout-list .header a.toolbar-button.refresh:not(.disabled)');
if ($browser->isDesktop()) {
$browser->with('#toolbar-list-menu', function ($browser) {
$browser->assertVisible('a.select:not(.disabled)');
$browser->assertVisible('a.options:not(.disabled)');
$imap = \bootstrap::get_storage();
if ($imap->get_threading()) {
$browser->assertVisible('a.threads:not(.disabled)');
}
else {
$browser->assertMissing('a.threads');
}
});
}
else if ($browser->isTablet()) {
$browser->click('.toolbar-list-button')
->waitFor('#toolbar-list-menu');
$browser->with('#toolbar-list-menu', function ($browser) {
$browser->assertVisible('a.select:not(.disabled)');
$browser->assertVisible('a.options:not(.disabled)');
$imap = \bootstrap::get_storage();
if ($imap->get_threading()) {
$browser->assertVisible('a.threads:not(.disabled)');
}
else {
$browser->assertMissing('a.threads');
}
});
$browser->click(); // hide the popup menu
}
else { // phone
// On phones list options are in the toolbar menu
$browser->with(new Toolbarmenu(), function ($browser) {
$active = ['select', 'options'];
$missing = [];
$imap = \bootstrap::get_storage();
if ($imap->get_threading()) {
$active[] = 'threads';
}
else {
$missing[] = 'threads';
}
$browser->assertMenuState($active, [], $missing);
});
}
});
}
/**
* @depends testList
*/
public function testListSelection()
{
$this->browse(function ($browser) {
if ($browser->isPhone()) {
$browser->with(new Toolbarmenu(), function ($browser) {
$browser->clickMenuItem('select');
});
}
else if ($browser->isTablet()) {
$browser->click('.toolbar-list-button');
$browser->click('#toolbar-list-menu a.select');
}
else {
$browser->click('#toolbar-list-menu a.select');
$browser->assertFocused('#toolbar-list-menu a.select');
}
// Popup menu content
$browser->with('#listselect-menu', function($browser) {
$browser->assertVisible('a.selection:not(.disabled)');
$browser->assertVisible('a.select.all:not(.disabled)');
$browser->assertVisible('a.select.page:not(.disabled)');
$browser->assertVisible('a.select.unread:not(.disabled)');
$browser->assertVisible('a.select.flagged:not(.disabled)');
$browser->assertVisible('a.select.invert:not(.disabled)');
$browser->assertVisible('a.select.none:not(.disabled)');
});
// Close the menu(s) by clicking the page body
$browser->click();
$browser->waitUntilMissing('#listselect-menu');
// TODO: Test selection actions
});
}
}
diff --git a/tests/Browser/Mail/Mail.php b/tests/Browser/Mail/MailTest.php
similarity index 98%
rename from tests/Browser/Mail/Mail.php
rename to tests/Browser/Mail/MailTest.php
index abfe6963b..2ddd90e79 100644
--- a/tests/Browser/Mail/Mail.php
+++ b/tests/Browser/Mail/MailTest.php
@@ -1,84 +1,84 @@
<?php
namespace Tests\Browser\Mail;
use Tests\Browser\Components\App;
use Tests\Browser\Components\Popupmenu;
-class Mail extends \Tests\Browser\TestCase
+class MailTest extends \Tests\Browser\TestCase
{
public function testMailUI()
{
$this->browse(function ($browser) {
$browser->go('mail');
// check task
$browser->with(new App(), function ($browser) {
$browser->assertEnv('task', 'mail');
// these objects should be there always
$browser->assertObjects([
'qsearchbox',
'mailboxlist',
'messagelist',
'quotadisplay',
'search_filter',
'countdisplay',
]);
});
if (!$browser->isDesktop()) {
$browser->click('.back-sidebar-button');
}
$browser->assertSeeIn('#layout-sidebar .header', TESTS_USER);
// Folders list
$browser->assertVisible('#mailboxlist li.mailbox.inbox.selected');
if (!$browser->isDesktop()) {
$browser->click('.back-list-button');
}
// Mail preview frame
if (!$browser->isPhone()) {
$browser->assertVisible('#messagecontframe');
}
// Toolbar menu
$browser->assertToolbarMenu(
['more'], // active items
['reply', 'reply-all', 'forward', 'delete', 'markmessage'], // inactive items
);
// Task menu
$browser->assertTaskMenu('mail');
});
}
/**
* Test message menu
*/
public function testMessageMenu()
{
$this->browse(function ($browser) {
$browser->go('mail');
$browser->clickToolbarMenuItem('more');
$browser->with(new Popupmenu('message-menu'), function ($browser) {
// Note: These are button class names, not action names
$active = ['import'];
$disabled = ['print', 'download', 'edit.asnew', 'source', 'move', 'copy', 'extwin'];
$hidden = [];
if ($browser->isPhone()) {
$hidden = ['print', 'extwin'];
$disabled = array_diff($disabled, $hidden);
}
$browser->assertMenuState($active, $disabled, $hidden);
$browser->closeMenu();
});
});
}
}
diff --git a/tests/Browser/Mail/Open.php b/tests/Browser/Mail/OpenTest.php
similarity index 97%
rename from tests/Browser/Mail/Open.php
rename to tests/Browser/Mail/OpenTest.php
index 413a70b45..c427ac6cb 100644
--- a/tests/Browser/Mail/Open.php
+++ b/tests/Browser/Mail/OpenTest.php
@@ -1,67 +1,67 @@
<?php
namespace Tests\Browser\Mail;
use Tests\Browser\Components\App;
use Tests\Browser\Components\Popupmenu;
-class Open extends \Tests\Browser\TestCase
+class OpenTest 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 Open in New Window action
*/
public function testOpenInNewWindow()
{
$this->browse(function ($browser) {
if ($browser->isPhone()) {
$this->markTestSkipped();
}
$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) {
$uids = $browser->driver->executeScript('return rcmail.message_list.get_selection()');
$this->assertCount(1, $uids);
$this->assertTrue(is_int($uids[0]) && $uids[0] > 0);
$uid = $uids[0];
list($current_window, $new_window) = $browser->openWindow(function ($browser) {
$browser->clickMenuItem('extwin');
});
$browser->driver->switchTo()->window($new_window);
$browser->with(new App(), function ($browser) use ($uid) {
$browser->assertEnv([
'task' => 'mail',
'action' => 'show',
'uid' => $uid,
]);
// TODO: werify the toolbar, which is different here than in the preview frame
});
$browser->driver->close();
$browser->driver->switchTo()->window($current_window);
});
});
}
}
diff --git a/tests/Browser/Mail/Preview.php b/tests/Browser/Mail/PreviewTest.php
similarity index 99%
rename from tests/Browser/Mail/Preview.php
rename to tests/Browser/Mail/PreviewTest.php
index 71c5bcda8..aa33f46da 100644
--- a/tests/Browser/Mail/Preview.php
+++ b/tests/Browser/Mail/PreviewTest.php
@@ -1,176 +1,176 @@
<?php
namespace Tests\Browser\Mail;
use Tests\Browser\Components\App;
use Tests\Browser\Components\Popupmenu;
-class Preview extends \Tests\Browser\TestCase
+class PreviewTest 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_??.eml') as $f) {
\bootstrap::import_message($f, 'INBOX');
}
}
/**
* Test opening an email in preview frame
*/
public function testPreview()
{
$this->browse(function ($browser) {
$browser->go('mail');
$browser->waitFor('#messagelist tbody tr:first-child')
->click('#messagelist tbody tr:first-child')
->waitForMessage('loading', 'Loading...')
->waitFor('#messagecontframe')
->waitUntilMissing('#messagestack');
// On phone check frame controls
if ($browser->isPhone()) {
$browser->with('#layout-content .footer', function ($browser) {
$browser->assertVisible('a.button.prev.disabled')
->assertVisible('a.button.next:not(.disabled)')
->assertVisible('a.button.reply:not(.disabled)')
->assertSeeIn('a.button.prev', 'Previous')
->assertSeeIn('a.button.reply', 'Reply')
->assertSeeIn('a.button.next', 'Next');
});
}
$browser->withinFrame('#messagecontframe', function ($browser) {
$browser->waitFor('img.contactphoto');
// Privacy warning
$browser->assertVisible('#remote-objects-message.alert-warning')
->assertSeeIn('#remote-objects-message', 'To protect your privacy remote resources have been blocked.');
// Images
$this->assertRegExp('/action=get/', $browser->attribute('p#v1attached > img', 'src'));
$this->assertRegExp('/blocked/', $browser->attribute('p#v1remote > img', 'src'));
// Attachments list
$browser->with('#attachment-list', function ($browser) {
$browser->assertVisible('li.image.ico')
->assertSeeIn('li .attachment-name', 'favicon.ico')
->assertSeeIn('li .attachment-size', '(~2 KB)')
->click('a.dropdown');
});
if (!$browser->isPhone()) {
$browser->waitFor('#attachmentmenu')
->with('#attachmentmenu', function ($browser) {
$browser->assertVisible('a.extwin.disabled')
->assertVisible('a.download:not(.disabled)')
->click('a.download');
});
}
});
if ($browser->isPhone()) {
$browser->waitFor('#attachmentmenu-clone')
->with('#attachmentmenu-clone', function ($browser) {
$browser->assertVisible('a.extwin.disabled')
->assertVisible('a.download:not(.disabled)')
->click('a.download');
});
}
$ico = $browser->readDownloadedFile('favicon.ico');
$this->assertTrue(strlen($ico) == 2294);
$this->assertSame("\0\0\1\0", substr($ico, 0, 4));
$browser->removeDownloadedFile('favicon.ico');
// On phone check Back button
if ($browser->isPhone()) {
$browser->click('#layout-content .header a.back-list-button')
->assertVisible('#messagelist');
}
});
}
/**
* 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')
->assertElementsCount('span.adr', 12)
->click('.ui-dialog-buttonset button.cancel');
});
$browser->waitUntilMissing('.ui-dialog');
// Attachments list
$browser->withinFrame('#messagecontframe', function ($browser) {
$browser->with('#attachment-list', function ($browser) {
$browser->assertElementsCount('li', 2)
->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/Mail/Print.php b/tests/Browser/Mail/PrintTest.php
similarity index 100%
rename from tests/Browser/Mail/Print.php
rename to tests/Browser/Mail/PrintTest.php
diff --git a/tests/Browser/Settings/About.php b/tests/Browser/Settings/AboutTest.php
similarity index 94%
rename from tests/Browser/Settings/About.php
rename to tests/Browser/Settings/AboutTest.php
index 667c5078d..c2b9932af 100644
--- a/tests/Browser/Settings/About.php
+++ b/tests/Browser/Settings/AboutTest.php
@@ -1,31 +1,31 @@
<?php
namespace Tests\Browser\Settings;
use Tests\Browser\Components\App;
-class About extends \Tests\Browser\TestCase
+class AboutTest extends \Tests\Browser\TestCase
{
public function testAbout()
{
$this->browse(function ($browser) {
$browser->go('settings');
$browser->clickTaskMenuItem('about');
$browser->assertSeeIn('.ui-dialog-title', 'About');
$browser->assertVisible('.ui-dialog #aboutframe');
$browser->withinFrame('#aboutframe', function ($browser) {
// check task and action
$browser->with(new App(), function ($browser) {
$browser->assertEnv('task', 'settings');
$browser->assertEnv('action', 'about');
});
$browser->assertSee($this->app->config->get('product_name'));
$browser->assertVisible('#pluginlist');
});
});
}
}
diff --git a/tests/Browser/Settings/Folders.php b/tests/Browser/Settings/FoldersTest.php
similarity index 99%
rename from tests/Browser/Settings/Folders.php
rename to tests/Browser/Settings/FoldersTest.php
index d9bfb411d..4a9a8a7cf 100644
--- a/tests/Browser/Settings/Folders.php
+++ b/tests/Browser/Settings/FoldersTest.php
@@ -1,148 +1,148 @@
<?php
namespace Tests\Browser\Settings;
use Tests\Browser\Components\App;
-class Folders extends \Tests\Browser\TestCase
+class FoldersTest extends \Tests\Browser\TestCase
{
public static function setUpBeforeClass()
{
\bootstrap::init_imap();
\bootstrap::reset_mailboxes();
}
/**
* Test Folders UI
*/
public function testFolders()
{
$this->browse(function ($browser) {
$browser->go('settings', 'folders');
// task should be set to 'settings' and action to 'folders'
$browser->with(new App(), function ($browser) {
$browser->assertEnv('task', 'settings');
$browser->assertEnv('action', 'folders');
// these objects should be there always
$browser->assertObjects(['quotadisplay', 'subscriptionlist']);
});
if ($browser->isDesktop()) {
$browser->assertVisible('#settings-menu li.folders.selected');
}
if ($browser->isPhone()) {
$browser->assertVisible('.floating-action-buttons a.create:not(.disabled)');
}
else {
$browser->assertMissing('.floating-action-buttons a.create:not(.disabled)');
}
// Toolbar menu
$browser->assertToolbarMenu(['create'], ['delete', 'purge']);
// Folders list
$browser->with('#subscription-table', function ($browser) {
$browser->assertElementsCount('li', 5)
// Note: first li element is root which is hidden in Elastic
->assertHasClass('li:nth-child(2)', 'inbox')
->assertSeeIn('li:nth-child(2)', 'Inbox')
->assertPresent('li:nth-child(2) [type=checkbox][disabled]')
->assertHasClass('li:nth-child(3)', 'drafts')
->assertSeeIn('li:nth-child(3)', 'Drafts')
->assertPresent('li:nth-child(3) [type=checkbox][disabled]')
->assertHasClass('li:nth-child(4)', 'sent')
->assertSeeIn('li:nth-child(4)', 'Sent')
->assertPresent('li:nth-child(4) [type=checkbox][disabled]')
->assertHasClass('li:nth-child(5)', 'junk')
->assertSeeIn('li:nth-child(5)', 'Junk')
->assertPresent('li:nth-child(5) [type=checkbox][disabled]')
->assertHasClass('li:nth-child(6)', 'trash')
->assertSeeIn('li:nth-child(6)', 'Trash')
->assertPresent('li:nth-child(6) [type=checkbox][disabled]');
});
});
}
/**
* Test folder creation
*/
public function testFolderCreate()
{
$this->browse(function ($browser) {
$browser->go('settings', 'folders');
if ($browser->isPhone()) {
$browser->assertVisible('.floating-action-buttons a.create:not(.disabled)')
->click('.floating-action-buttons a.create')
->waitFor('#preferences-frame');
}
else {
$browser->clickToolbarMenuItem('create');
}
$browser->withinFrame('#preferences-frame', function($browser) {
$browser->waitFor('form')
->with('form fieldset', function ($browser) {
$browser->assertVisible('input[name=_name]')
->assertValue('input[name=_name]', '')
->assertVisible('select[name=_parent]')
->assertSelected('select[name=_parent]', '');
})
/*
->with('form fieldset:last-child', function ($browser) {
$browser->assertSeeIn('legend', 'Settings')
->assertVisible('select[name=_viewmode]')
->assertSelected('select[name=_viewmode]', '0');
})
*/
->type('input[name=_name]', 'Test');
if (!$browser->isPhone()) {
$browser->click('.formbuttons button.submit');
}
});
if ($browser->isPhone()) {
$browser->assertVisible('#layout-content .header a.back-list-button')
->assertVisible('#layout-content .footer .buttons a.button.submit')
->click('#layout-content .footer .buttons a.button.submit')
->waitFor('#subscription-table');
}
else {
$browser->waitForMessage('confirmation', 'Folder created successfully.');
}
$browser->closeMessage('confirmation');
// Folders list
$browser->with('#subscription-table', function ($browser) {
// Note: li.root is hidden in Elastic
$browser->waitFor('li.mailbox:nth-child(7)')
->assertElementsCount('li', 6)
->assertPresent('li.mailbox:nth-child(7) [type=checkbox]:not([disabled])')
->click('li.mailbox:nth-child(7)');
});
if ($browser->isPhone()) {
$browser->waitFor('#preferences-frame');
}
$browser->withinFrame('#preferences-frame', function($browser) {
$browser->waitFor('form');
// TODO
});
// Test unsubscribe of the newly created folder
if ($browser->isPhone()) {
$browser->click('a.back-list-button')
->waitFor('#subscription-table');
}
$browser->setCheckboxState('#subscription-table li:nth-child(7) input', false)
->waitForMessage('confirmation', 'Folder successfully unsubscribed.');
});
}
}
diff --git a/tests/Browser/Settings/Identities.php b/tests/Browser/Settings/IdentitiesTest.php
similarity index 95%
rename from tests/Browser/Settings/Identities.php
rename to tests/Browser/Settings/IdentitiesTest.php
index a65f5f25a..c07e71008 100644
--- a/tests/Browser/Settings/Identities.php
+++ b/tests/Browser/Settings/IdentitiesTest.php
@@ -1,35 +1,35 @@
<?php
namespace Tests\Browser\Settings;
use Tests\Browser\Components\App;
-class Identities extends \Tests\Browser\TestCase
+class IdentitiesTest extends \Tests\Browser\TestCase
{
public function testIdentities()
{
$this->browse(function ($browser) {
$browser->go('settings', 'identities');
// check task and action
$browser->with(new App(), function ($browser) {
$browser->assertEnv('task', 'settings');
$browser->assertEnv('action', 'identities');
// these objects should be there always
$browser->assertObjects(['identitieslist']);
});
if ($browser->isDesktop()) {
$browser->assertVisible('#settings-menu li.identities.selected');
}
// Identities list
$browser->assertVisible('#identities-table tr:first-child.focused');
$browser->assertSeeIn('#identities-table tr:first-child td.mail', TESTS_USER);
// Toolbar menu
$browser->assertToolbarMenu(['create'], ['delete']);
});
}
}
diff --git a/tests/Browser/Settings/Preferences/General.php b/tests/Browser/Settings/Preferences/GeneralTest.php
similarity index 99%
rename from tests/Browser/Settings/Preferences/General.php
rename to tests/Browser/Settings/Preferences/GeneralTest.php
index 378766322..2c580c5f5 100644
--- a/tests/Browser/Settings/Preferences/General.php
+++ b/tests/Browser/Settings/Preferences/GeneralTest.php
@@ -1,167 +1,167 @@
<?php
namespace Tests\Browser\Settings\Preferences;
use Tests\Browser\Components\App;
-class General extends \Tests\Browser\TestCase
+class GeneralTest extends \Tests\Browser\TestCase
{
protected function tearDown()
{
parent::tearDown();
// Reset user preferences back to defaults
$db = $this->app->get_dbh();
$db->query("UPDATE users SET preferences = '' WHERE username = ?", TESTS_USER);
}
public function testGeneral()
{
$this->browse(function ($browser) {
$browser->go('settings');
if (!$browser->isDesktop()) {
$browser->click('#settings-menu li.preferences');
$browser->waitFor('#sections-table');
}
$browser->assertVisible('#sections-table tr.general.focused');
$browser->click('#sections-table tr.general');
if ($browser->isPhone()) {
$browser->waitFor('#layout-content .footer a.button.submit:not(.disabled)');
$browser->assertVisible('#layout-content .footer a.button.prev.disabled');
$browser->assertVisible('#layout-content .footer a.button.next:not(.disabled)');
}
$browser->withinFrame('#preferences-frame', function ($browser) {
if (!$browser->isPhone()) {
$browser->waitFor('.formbuttons button.submit');
}
// check task and action
$browser->with(new App(), function ($browser) {
$browser->assertEnv('task', 'settings');
$browser->assertEnv('action', 'edit-prefs');
});
// Main Options fieldset
$browser->with('form.propform fieldset.main', function ($browser) {
$browser->assertSeeIn('legend', 'Main Options');
$browser->assertSeeIn('label[for=rcmfd_lang]', 'Language');
$browser->assertVisible('select[name=_language]');
$browser->assertSelected('select[name=_language]', 'en_US');
$browser->assertSeeIn('label[for=rcmfd_timezone]', 'Time zone');
$browser->assertVisible('select[name=_timezone]');
// we don't know what timezone has been autodetected
// $browser->assertSelected('select[name=_timezone]', 'auto');
$browser->assertSeeIn('label[for=rcmfd_time_format]', 'Time format');
$browser->assertVisible('select[name=_time_format]');
$browser->assertSelected('select[name=_time_format]', $this->app->config->get('time_format'));
$browser->assertSeeIn('label[for=rcmfd_date_format]', 'Date format');
$browser->assertVisible('select[name=_date_format]');
$browser->assertSelected('select[name=_date_format]', $this->app->config->get('date_format'));
$browser->assertSeeIn('label[for=rcmfd_prettydate]', 'Pretty dates');
$browser->assertCheckboxState('_pretty_date', $this->app->config->get('prettydate'));
$browser->assertSeeIn('label[for=rcmfd_displaynext]', 'Display next');
$browser->assertCheckboxState('_display_next', $this->app->config->get('display_next'));
$browser->assertSeeIn('label[for=rcmfd_refresh_interval]', 'Refresh');
$browser->assertVisible('select[name=_refresh_interval]');
$browser->assertSelected('select[name=_refresh_interval]', $this->app->config->get('refresh_interval')/60);
});
// Interface Skin fieldset
$browser->with('form.propform fieldset.skin', function ($browser) {
$browser->assertSeeIn('legend', 'Interface skin');
// TODO
});
// Browser Options fieldset
$browser->with('form.propform fieldset.browser', function ($browser) {
$browser->assertSeeIn('legend', 'Browser Options');
$browser->assertSeeIn('label[for=rcmfd_standard_windows]', 'Handle popups');
$browser->assertCheckboxState('_standard_windows', $this->app->config->get('standard_windows'));
});
});
});
}
/**
* Test (all) User Interface preferences change
*
* @depends testGeneral
*/
public function testPreferencesChange()
{
// Values we're changing to
// TODO: Skin or language change causes page reload, we should test this separately
$this->settings = [
'timezone' => 'Pacific/Midway',
'time_format' => 'h:i A',
'date_format' => 'd-m-Y',
'refresh_interval' => 60,
'pretty_date' => !boolval($this->app->config->get('prettydate')),
'display_next' => !boolval($this->app->config->get('display_next')),
'standard_windows' => !boolval($this->app->config->get('standard_windows')),
];
$this->browse(function ($browser) {
// Update preferences
$browser->withinFrame('#preferences-frame', function ($browser) {
$browser->select('_timezone', $this->settings['timezone']);
$browser->select('_time_format', $this->settings['time_format']);
$browser->select('_date_format', $this->settings['date_format']);
$browser->select('_refresh_interval', $this->settings['refresh_interval']);
$browser->setCheckboxState('_pretty_date', $this->settings['pretty_date']);
$browser->setCheckboxState('_display_next', $this->settings['display_next']);
$browser->setCheckboxState('_standard_windows', $this->settings['standard_windows']);
// Submit form
if (!$browser->isPhone()) {
$browser->click('.formbuttons button.submit');
}
});
if ($browser->isPhone()) {
$browser->click('#layout-content .footer a.submit');
}
$browser->waitForMessage('confirmation', 'Successfully saved');
// Verify if every option has been updated
$browser->withinFrame('#preferences-frame', function ($browser) {
$browser->assertSelected('_timezone', $this->settings['timezone']);
$browser->assertSelected('_time_format', $this->settings['time_format']);
$browser->assertSelected('_date_format', $this->settings['date_format']);
$browser->assertSelected('_refresh_interval', $this->settings['refresh_interval']);
$browser->assertCheckboxState('_pretty_date', $this->settings['pretty_date']);
$browser->assertCheckboxState('_display_next', $this->settings['display_next']);
$browser->assertCheckboxState('_standard_windows', $this->settings['standard_windows']);
// Assert the options have been saved in database properly
$prefs = \bootstrap::get_prefs();
$options = array_diff(array_keys($this->settings), ['refresh_interval', 'pretty_date']);
foreach ($options as $option) {
$this->assertEquals($this->settings[$option], $prefs[$option]);
}
$this->assertEquals($this->settings['pretty_date'], $prefs['prettydate']);
$this->assertEquals($this->settings['refresh_interval'], $prefs['refresh_interval']/60);
});
});
}
}
diff --git a/tests/Browser/Settings/Preferences.php b/tests/Browser/Settings/PreferencesTest.php
similarity index 96%
rename from tests/Browser/Settings/Preferences.php
rename to tests/Browser/Settings/PreferencesTest.php
index 692252500..81e3a15e9 100644
--- a/tests/Browser/Settings/Preferences.php
+++ b/tests/Browser/Settings/PreferencesTest.php
@@ -1,39 +1,39 @@
<?php
namespace Tests\Browser\Settings;
use Tests\Browser\Components\App;
-class Preferences extends \Tests\Browser\TestCase
+class PreferencesTest extends \Tests\Browser\TestCase
{
public function testPreferences()
{
$this->browse(function ($browser) {
$browser->go('settings');
$browser->with(new App(), function ($browser) {
$browser->assertObjects(['sectionslist']);
});
$browser->assertVisible('#settings-menu li.preferences.selected');
// On phone/tablet #sections-table is initially hidden
if (!$browser->isDesktop()) {
$browser->assertMissing('#sections-table');
$browser->click('#settings-menu li.preferences');
$browser->waitFor('#sections-table');
}
// Preferences actions
$browser->with('#sections-table', function($browser) {
$browser->assertSeeIn('tr.general', 'User Interface');
$browser->assertSeeIn('tr.mailbox', 'Mailbox View');
$browser->assertSeeIn('tr.mailview', 'Displaying Messages');
$browser->assertSeeIn('tr.compose', 'Composing Messages');
$browser->assertSeeIn('tr.addressbook', 'Contacts');
$browser->assertSeeIn('tr.folders', 'Special Folders');
$browser->assertSeeIn('tr.server', 'Server Settings');
});
});
}
}
diff --git a/tests/Browser/Settings/Responses.php b/tests/Browser/Settings/ResponsesTest.php
similarity index 94%
rename from tests/Browser/Settings/Responses.php
rename to tests/Browser/Settings/ResponsesTest.php
index 844923730..eda38ff29 100644
--- a/tests/Browser/Settings/Responses.php
+++ b/tests/Browser/Settings/ResponsesTest.php
@@ -1,35 +1,35 @@
<?php
namespace Tests\Browser\Settings;
use Tests\Browser\Components\App;
-class Responses extends \Tests\Browser\TestCase
+class ResponsesTest extends \Tests\Browser\TestCase
{
public function testIdentities()
{
$this->browse(function ($browser) {
$browser->go('settings', 'responses');
$browser->with(new App(), function ($browser) {
// check task and action
$browser->assertEnv('task', 'settings');
$browser->assertEnv('action', 'responses');
// these objects should be there always
$browser->assertObjects(['responseslist']);
});
if ($browser->isDesktop()) {
$browser->assertVisible('#settings-menu li.responses.selected');
}
// Responses list
$browser->assertPresent('#responses-table');
$browser->assertMissing('#responses-table tr');
// Toolbar menu
$browser->assertToolbarMenu(['create'], ['delete']);
});
}
}
diff --git a/tests/Browser/Settings/Settings.php b/tests/Browser/Settings/SettingsTest.php
similarity index 94%
rename from tests/Browser/Settings/Settings.php
rename to tests/Browser/Settings/SettingsTest.php
index 2f4e95a38..ad6995be3 100644
--- a/tests/Browser/Settings/Settings.php
+++ b/tests/Browser/Settings/SettingsTest.php
@@ -1,33 +1,33 @@
<?php
namespace Tests\Browser\Settings;
use Tests\Browser\Components\App;
-class Settings extends \Tests\Browser\TestCase
+class SettingsTest extends \Tests\Browser\TestCase
{
public function testSettings()
{
$this->browse(function ($browser) {
$browser->go('settings');
// task should be set to 'settings'
$browser->with(new App(), function ($browser) {
$browser->assertEnv('task', 'settings');
});
$browser->assertSeeIn('#layout-sidebar .header', 'Settings');
// Sidebar menu
$browser->with('#settings-menu', function($browser) {
$browser->assertSeeIn('li.preferences', 'Preferences');
$browser->assertSeeIn('li.folders', 'Folders');
$browser->assertSeeIn('li.identities', 'Identities');
$browser->assertSeeIn('li.responses', 'Responses');
});
// Task menu
$browser->assertTaskMenu('settings');
});
}
}
diff --git a/tests/Browser/phpunit.xml b/tests/Browser/phpunit.xml
index 056eff1a2..2c5cdcf71 100644
--- a/tests/Browser/phpunit.xml
+++ b/tests/Browser/phpunit.xml
@@ -1,34 +1,19 @@
<phpunit backupGlobals="false"
bootstrap="bootstrap.php"
colors="true">
<testsuites>
<testsuite name="Logon">
- <file>Logon/Login.php</file>
- <file>Logon/Logout.php</file>
+ <directory suffix="Test.php">Logon</directory>
</testsuite>
<testsuite name="Contacts">
- <file>Contacts/Contacts.php</file>
- <file>Contacts/Groups.php</file>
- <file>Contacts/Import.php</file>
- <file>Contacts/Export.php</file>
+ <directory suffix="Test.php">Contacts</directory>
</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>
+ <directory suffix="Test.php">Settings</directory>
+ <directory suffix="Test.php">Settings/Preferences</directory>
</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>
+ <directory suffix="Test.php">Mail</directory>
</testsuite>
</testsuites>
</phpunit>

File Metadata

Mime Type
text/x-diff
Expires
Thu, Mar 19, 8:48 AM (18 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
456398
Default Alt Text
(64 KB)

Event Timeline