mirror of
https://github.com/salesagility/SuiteCRM.git
synced 2025-02-12 01:08:54 +00:00
![Dillon-Brown](/assets/img/avatar_default.png)
# Conflicts: # .travis.yml # README.md # data/SugarBean.php # include/MVC/View/SugarView.php # include/Smarty/plugins/function.fetch.php # include/SugarFields/Fields/File/SugarFieldFile.php # include/SugarObjects/templates/person/Person.php # include/SugarXHprof/SugarXHprof.php # include/SugarXHprof/xhprof_lib/utils/xhprof_runs.php # include/nusoap/class.nusoap_base.php # include/nusoap/class.soap_transport_http.php # include/nusoap/class.soapclient.php # include/nusoap/class.wsdl.php # include/nusoap/class.wsdlcache.php # include/parsecsv.lib.php # include/social/get_feed_data.php # include/tcpdf/barcodes.php # lib/Robo/Plugin/Commands/CodeCoverageCommands.php # modules/AOD_Index/Lib/Zend/Search/Lucene/Storage/File.php # modules/AOR_Charts/lib/pChart/class/pBarcode128.class.php # modules/AOR_Charts/lib/pChart/class/pBarcode39.class.php # modules/AOR_Charts/lib/pChart/class/pCache.class.php # modules/AOR_Charts/lib/pChart/class/pData.class.php # modules/AOR_Charts/lib/pChart/class/pDraw.class.php # modules/AOR_Charts/lib/pChart/class/pImage.class.php # modules/AOR_Charts/lib/pChart/class/pSpring.class.php # modules/AOS_PDF_Templates/templateParser.php # modules/AOS_Products/AOS_Products.php # modules/AOW_Actions/FormulaCalculator.php # modules/AOW_WorkFlow/aow_utils.php # modules/Trackers/store/DatabaseStore.php # phpcs.xml # service/core/REST/SugarRest.php # service/example/Rest_Proxy.php # suitecrm_version.php # tests/SuiteCRM/Test/SuitePHPUnit_Framework_TestCase.php # tests/unit/phpunit/data/SugarBeanTest.php # tests/unit/phpunit/include/MVC/Controller/SugarControllerTest.php # tests/unit/phpunit/include/MVC/SugarApplicationTest.php # tests/unit/phpunit/include/MVC/View/SugarViewTest.php # tests/unit/phpunit/include/MVC/View/views/view.editTest.php # tests/unit/phpunit/include/utils/securityUtilsTest.php # tests/unit/phpunit/modules/ACLActions/ACLActionTest.php # tests/unit/phpunit/modules/Emails/EmailTest.php # tests/unit/phpunit/modules/ProspectLists/ProspectListTest.php # tests/unit/phpunit/modules/SchedulersJobs/SchedulersJobTest.php # tests/unit/phpunit/modules/UserPreferences/UserPreferenceTest.php # themes/SuiteP/css/Dawn/style.css # themes/SuiteP/css/Day/style.css # themes/SuiteP/css/Dusk/style.css # themes/SuiteP/css/Night/style.css
110 lines
3.5 KiB
PHP
110 lines
3.5 KiB
PHP
<?php
|
|
|
|
use Faker\Factory;
|
|
use Faker\Generator;
|
|
use Step\Acceptance\AccountsTester;
|
|
use Step\Acceptance\DetailView;
|
|
use Step\Acceptance\EditView;
|
|
use Step\Acceptance\ListView;
|
|
use Step\Acceptance\UsersTester;
|
|
|
|
class UsersCest
|
|
{
|
|
/**
|
|
* @var Generator $fakeData
|
|
*/
|
|
protected $fakeData;
|
|
|
|
/**
|
|
* @var integer $fakeDataSeed
|
|
*/
|
|
protected $fakeDataSeed;
|
|
|
|
/**
|
|
* @param AcceptanceTester $I
|
|
*/
|
|
public function _before(AcceptanceTester $I)
|
|
{
|
|
if (!$this->fakeData) {
|
|
$this->fakeData = Factory::create();
|
|
}
|
|
|
|
$this->fakeDataSeed = mt_rand(0, 2048);
|
|
$this->fakeData->seed($this->fakeDataSeed);
|
|
}
|
|
|
|
public function testEmailSettingsMailAccountAdd(AcceptanceTester $I, UsersTester $Users)
|
|
{
|
|
$I->loginAsAdmin();
|
|
$Users->gotoProfile();
|
|
$I->see('User Profile', '.panel-heading');
|
|
$I->click('Settings');
|
|
$I->see('Mail Accounts');
|
|
$I->click('Mail Accounts');
|
|
$I->click('Add');
|
|
$I->executeJS('javascript:SUGAR.email2.accounts.fillInboundGmailDefaults();'); // <-- instead of $I->click('Prefill Gmail™ Defaults');
|
|
$I->fillField('ie_name', 'testuser_acc');
|
|
$I->fillField('email_user', 'testuser_name');
|
|
$I->fillField('email_password', 'testuser_pass');
|
|
$I->click('Test Settings');
|
|
$I->waitForText('Connection completed successfully.');
|
|
$I->see('Connection completed successfully.');
|
|
}
|
|
|
|
public function testShowCollapsedSubpanelHint(
|
|
AcceptanceTester $I,
|
|
DetailView $DetailView,
|
|
UsersTester $Users,
|
|
ListView $listView,
|
|
EditView $EditView,
|
|
AccountsTester $accounts
|
|
) {
|
|
$I->wantTo('View the collapsed subpanel hints on Accounts');
|
|
|
|
// Navigate to Users list-view
|
|
$I->loginAsAdmin();
|
|
|
|
$Users->gotoProfile();
|
|
|
|
$I->see('User Profile', '.panel-heading');
|
|
|
|
$I->click("Layout Options");
|
|
$I->waitForElementVisible('input[name="user_count_collapsed_subpanels"]');
|
|
$I->seeElement('input', ['name' => 'user_count_collapsed_subpanels']);
|
|
$I->checkOption(['name' => 'user_count_collapsed_subpanels']);
|
|
$EditView->clickSaveButton();
|
|
$DetailView->waitForDetailViewVisible();
|
|
|
|
// Create & Navigate to Accounts
|
|
// @TODO - Need to include dummy data to utilise these tests efficiently
|
|
$I->wantTo('Create an Account');
|
|
|
|
// Navigate to accounts list-view
|
|
$I->visitPage('Accounts', 'index');
|
|
$listView->waitForListViewVisible();
|
|
|
|
// Create account
|
|
$this->fakeData->seed($this->fakeDataSeed);
|
|
$accountId = $accounts->createAccount('Test_'. $this->fakeData->company());
|
|
|
|
$I->visitPage('Accounts', 'DetailView', $accountId);
|
|
$DetailView->waitForDetailViewVisible();
|
|
|
|
// View the Subpanels Hint
|
|
$I->see('Leads (0)', '//*[@id="subpanel_title_leads"]/div/div');
|
|
|
|
// Delete account
|
|
$DetailView->clickActionMenuItem('Delete');
|
|
$DetailView->acceptPopup();
|
|
$listView->waitForListViewVisible();
|
|
|
|
// Reset the collapsed subpanels
|
|
$Users->gotoProfile();
|
|
$I->see('User Profile', '.panel-heading');
|
|
$I->click("Layout Options");
|
|
$I->seeElement('input', ['name' => 'user_count_collapsed_subpanels']);
|
|
$I->uncheckOption(['name' => 'user_count_collapsed_subpanels']);
|
|
$EditView->clickSaveButton();
|
|
$DetailView->waitForDetailViewVisible();
|
|
}
|
|
}
|