You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
69 lines
2.1 KiB
PHTML
69 lines
2.1 KiB
PHTML
5 years ago
|
<?php
|
||
|
|
||
|
namespace Tests\Browser\Mail;
|
||
|
|
||
5 years ago
|
use Tests\Browser\Components\App;
|
||
|
|
||
5 years ago
|
class ComposeTest extends \Tests\Browser\TestCase
|
||
5 years ago
|
{
|
||
|
public function testCompose()
|
||
|
{
|
||
|
$this->browse(function ($browser) {
|
||
5 years ago
|
$browser->go('mail');
|
||
5 years ago
|
|
||
5 years ago
|
$browser->clickTaskMenuItem('compose');
|
||
5 years ago
|
|
||
|
// check task and action
|
||
5 years ago
|
$browser->with(new App(), function ($browser) {
|
||
|
$browser->assertEnv('task', 'mail');
|
||
|
$browser->assertEnv('action', 'compose');
|
||
5 years ago
|
|
||
5 years ago
|
// these objects should be there always
|
||
|
$browser->assertObjects([
|
||
|
'qsearchbox',
|
||
|
'addressbookslist',
|
||
|
'contactslist',
|
||
|
'messageform',
|
||
|
'attachmentlist',
|
||
|
'filedrop',
|
||
|
'uploadform'
|
||
|
]);
|
||
|
});
|
||
5 years ago
|
|
||
|
// Toolbar menu
|
||
5 years ago
|
$browser->assertToolbarMenu(
|
||
5 years ago
|
['save.draft', 'responses', 'spellcheck'], // active items
|
||
|
['signature'], // inactive items
|
||
|
);
|
||
|
|
||
5 years ago
|
if ($browser->isPhone()) {
|
||
|
$browser->assertToolbarMenu(['options'], []);
|
||
5 years ago
|
}
|
||
|
else {
|
||
5 years ago
|
$browser->assertToolbarMenu(['attach'], []);
|
||
5 years ago
|
$browser->assertMissing('#toolbar-menu a.options');
|
||
|
}
|
||
5 years ago
|
|
||
|
// Task menu
|
||
5 years ago
|
$browser->assertTaskMenu('compose');
|
||
5 years ago
|
|
||
|
// 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');
|
||
5 years ago
|
|
||
5 years ago
|
if ($browser->isPhone()) {
|
||
|
$browser->clickToolbarMenuItem('options');
|
||
5 years ago
|
}
|
||
|
|
||
|
// Compose options
|
||
|
$browser->assertSeeIn('#layout-sidebar .header', 'Options and attachments');
|
||
|
$browser->assertVisible('#compose-attachments');
|
||
5 years ago
|
});
|
||
|
}
|
||
|
}
|