diff --git a/tests/Browser/Login.php b/tests/Browser/Login.php index dcc20ad3c..ea2321f9d 100644 --- a/tests/Browser/Login.php +++ b/tests/Browser/Login.php @@ -14,7 +14,7 @@ class Login extends DuskTestCase public function testLogin() { - // first test, we're already on the login page + // First test, we're already on the logon page $this->browse(function ($browser) { $browser->visit('/'); @@ -23,8 +23,19 @@ class Login extends DuskTestCase // task should be set to 'login' $this->assertEnvEquals('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 $this->go('mail'); diff --git a/tests/Browser/Settings/About.php b/tests/Browser/Settings/About.php index f687a9d1e..73c7df56a 100644 --- a/tests/Browser/Settings/About.php +++ b/tests/Browser/Settings/About.php @@ -7,13 +7,21 @@ class About extends \Tests\Browser\DuskTestCase public function testAbout() { $this->browse(function ($browser) { - $this->go('settings', 'about'); + $this->go('settings'); - // check task and action - $this->assertEnvEquals('task', 'settings'); - $this->assertEnvEquals('action', 'about'); + $browser->click('#taskmenu a.about'); - $browser->assertVisible('#pluginlist'); + $browser->assertSeeIn('.ui-dialog-title', 'About'); + $browser->assertVisible('.ui-dialog #aboutframe'); + + $browser->withinFrame('#aboutframe', function ($browser) { + // check task and action + $this->assertEnvEquals('task', 'settings'); + $this->assertEnvEquals('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/Folders.php index 82c0b7d2e..549922460 100644 --- a/tests/Browser/Settings/Folders.php +++ b/tests/Browser/Settings/Folders.php @@ -18,6 +18,16 @@ class Folders extends \Tests\Browser\DuskTestCase // these objects should be there always $this->assertContains('quotadisplay', $objects); $this->assertContains('subscriptionlist', $objects); + + $browser->assertVisible('#settings-menu li.folders.selected'); + + // Folders list + $browser->assertVisible('#subscription-table li.mailbox.inbox'); + + // Toolbar menu + $browser->assertVisible('#toolbar-menu a.create:not(.disabled)'); + $browser->assertVisible('#toolbar-menu a.delete.disabled'); + $browser->assertVisible('#toolbar-menu a.purge.disabled'); }); } } diff --git a/tests/Browser/Settings/Identities.php b/tests/Browser/Settings/Identities.php index d885f9edb..f3e3fd701 100644 --- a/tests/Browser/Settings/Identities.php +++ b/tests/Browser/Settings/Identities.php @@ -17,6 +17,16 @@ class Identities extends \Tests\Browser\DuskTestCase // these objects should be there always $this->assertContains('identitieslist', $objects); + + $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->assertVisible('#toolbar-menu a.create:not(.disabled)'); + $browser->assertVisible('#toolbar-menu a.delete.disabled'); }); } } diff --git a/tests/Browser/Settings/Preferences.php b/tests/Browser/Settings/Preferences.php new file mode 100644 index 000000000..c0998311f --- /dev/null +++ b/tests/Browser/Settings/Preferences.php @@ -0,0 +1,29 @@ +browse(function ($browser) { + $this->go('settings'); + + $objects = $this->getObjects(); + + $this->assertContains('sectionslist', $objects); + + $browser->assertVisible('#settings-menu li.preferences.selected'); + + // Preferences actions + $browser->assertVisible('#sections-table'); + $browser->assertSeeIn('#sections-table tr.general', 'User Interface'); + $browser->assertSeeIn('#sections-table tr.mailbox', 'Mailbox View'); + $browser->assertSeeIn('#sections-table tr.mailview', 'Displaying Messages'); + $browser->assertSeeIn('#sections-table tr.compose', 'Composing Messages'); + $browser->assertSeeIn('#sections-table tr.addressbook', 'Contacts'); + $browser->assertSeeIn('#sections-table tr.folders', 'Special Folders'); + $browser->assertSeeIn('#sections-table tr.server', 'Server Settings'); + }); + } +} diff --git a/tests/Browser/Settings/Responses.php b/tests/Browser/Settings/Responses.php new file mode 100644 index 000000000..9de267aef --- /dev/null +++ b/tests/Browser/Settings/Responses.php @@ -0,0 +1,32 @@ +browse(function ($browser) { + $this->go('settings', 'responses'); + + // check task and action + $this->assertEnvEquals('task', 'settings'); + $this->assertEnvEquals('action', 'responses'); + + $objects = $this->getObjects(); + + // these objects should be there always + $this->assertContains('responseslist', $objects); + + $browser->assertVisible('#settings-menu li.responses.selected'); + + // Responses list + $browser->assertPresent('#responses-table'); + $browser->assertMissing('#responses-table tr'); + + // Toolbar menu + $browser->assertVisible('#toolbar-menu a.create:not(.disabled)'); + $browser->assertVisible('#toolbar-menu a.delete.disabled'); + }); + } +} diff --git a/tests/Browser/Settings/Settings.php b/tests/Browser/Settings/Settings.php index cfef01ceb..76b9ad148 100644 --- a/tests/Browser/Settings/Settings.php +++ b/tests/Browser/Settings/Settings.php @@ -12,9 +12,14 @@ class Settings extends \Tests\Browser\DuskTestCase // task should be set to 'settings' $this->assertEnvEquals('task', 'settings'); - $objects = $this->getObjects(); + $browser->assertSeeIn('#layout-sidebar .header', 'Settings'); - $this->assertContains('sectionslist', $objects); + // Sidebar menu + $browser->assertVisible('#settings-menu'); + $browser->assertSeeIn('#settings-menu li.preferences', 'Preferences'); + $browser->assertSeeIn('#settings-menu li.folders', 'Folders'); + $browser->assertSeeIn('#settings-menu li.identities', 'Identities'); + $browser->assertSeeIn('#settings-menu li.responses', 'Responses'); }); } } diff --git a/tests/Browser/phpunit.xml b/tests/Browser/phpunit.xml index eb6ea316c..b9605ba59 100644 --- a/tests/Browser/phpunit.xml +++ b/tests/Browser/phpunit.xml @@ -11,10 +11,12 @@ Addressbook/Import.php - Settings/About.php + Settings/Settings.php + Settings/Preferences.php Settings/Folders.php Settings/Identities.php - Settings/Settings.php + Settings/Responses.php + Settings/About.php Mail/Mail.php