0
0
Fork 0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2025-02-06 23:10:03 +00:00
salesagility_SuiteCRM/tests/acceptance/modules/Activities/ActivitiesCest.php
Craig Panton 73ded274ee Merge remote-tracking branch 'remotes/origin/hotfix-7.10.x' into hotfix
# Conflicts:
#	.codecov.yml
#	.travis.yml
#	composer.lock
#	include/database/DBManager.php
#	include/phpmailer/class.phpmailer.php
#	include/phpmailer/extras/htmlfilter.php
#	include/tcpdf/fonts/utils/makefont.php
#	modules/AOD_Index/Lib/Zend/Search/Exception.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/Analyzer.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/Analyzer/Common.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/Analyzer/Common/Text.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/Analyzer/Common/Text/CaseInsensitive.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/Analyzer/Common/TextNum/CaseInsensitive.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8/CaseInsensitive.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/Analyzer/Common/Utf8Num/CaseInsensitive.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/Token.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/TokenFilter.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/TokenFilter/LowerCase.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/TokenFilter/LowerCaseUtf8.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/TokenFilter/ShortWords.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Analysis/TokenFilter/StopWords.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Document/Docx.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Document/Exception.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Document/OpenXml.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Document/Pptx.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Document/Xlsx.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Exception.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/FSM.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/FSMAction.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Field.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Index/DictionaryLoader.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Index/DocsFilter.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Index/FieldInfo.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Index/Term.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Index/TermInfo.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Index/TermsPriorityQueue.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Interface/MultiSearcher.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/LockManager.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/MultiSearcher.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/PriorityQueue.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/BooleanExpressionRecognizer.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/Highlighter/Default.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/Query.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/Query/Empty.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/Query/Insignificant.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/Query/Preprocessing.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/Query/Range.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/Query/Term.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/Query/Wildcard.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/QueryEntry.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/QueryHit.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/QueryParserContext.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/QueryParserException.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/QueryToken.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/Similarity.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/Weight.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Search/Weight/Empty.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Storage/Directory.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Storage/Directory/Filesystem.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Storage/File/Filesystem.php
#	modules/AOD_Index/Lib/Zend/Search/Lucene/Storage/File/Memory.php
#	modules/Administration/metadata/adminpaneldefs.php
#	modules/Audit/Audit.php
#	modules/Calendar/CalendarDisplay.php
#	modules/Calls/Call.php
#	modules/Contacts/BusinessCard.php
#	modules/UpgradeWizard/language/en_us.lang.php
#	modules/Users/authentication/LDAPAuthenticate/LDAPAuthenticateUser.php
#	service/v3/SugarWebServiceImplv3.php
#	service/v4/SugarWebServiceUtilv4.php
#	tests/unit/phpunit/data/SugarBeanTest.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
2019-10-23 11:10:20 +01:00

111 lines
3.5 KiB
PHP

<?php
use Faker\Generator;
class ActivitiesCest
{
/**
* @var Generator $fakeData
*/
protected $fakeData;
/**
* @var integer $fakeDataSeed
*/
protected $fakeDataSeed;
/**
* @param AcceptanceTester $I
*/
public function _before(AcceptanceTester $I)
{
if (!$this->fakeData) {
$this->fakeData = Faker\Factory::create();
}
$this->fakeDataSeed = mt_rand(0, 2048);
$this->fakeData->seed($this->fakeDataSeed);
}
/**
* @param \AcceptanceTester $I
* @param \Step\Acceptance\ListView $listView
* @param \Step\Acceptance\AccountsTester $accounts
* @param \Step\Acceptance\Calls $calls
* @param \Step\Acceptance\NavigationBarTester $NavigationBar
*
* As a user I want to see the due date on the activities module
*/
public function testSeeDueDateSubpanelView(
\AcceptanceTester $I,
\Step\Acceptance\ListView $listView,
\Step\Acceptance\DetailView $detailView,
\Step\Acceptance\AccountsTester $accounts,
\Step\Acceptance\Calls $calls,
\Step\Acceptance\NavigationBarTester $NavigationBar
) {
$I->wantTo('See the due date field on Account Activities subpanel');
// Navigate to accounts list-view
$I->loginAsAdmin();
$I->visitPage('Accounts', 'index');
$listView->waitForListViewVisible();
// Create account
$this->fakeData->seed($this->fakeDataSeed);
$account_name = 'Test_'. $this->fakeData->company();
$accounts->createAccount($account_name);
// Create a Call and relate to an Account
$NavigationBar->clickAllMenuItem('Calls');
// Create call
$this->fakeData->seed($this->fakeDataSeed);
$callName = 'Test_'. $this->fakeData->company();
$calls->createCallRelateModule($callName, $account_name, "Account");
// Navigate to the Account's Detail View and confirm the due date contains data
$I->visitPage('Accounts', 'index');
$listView->waitForListViewVisible();
// Select record from list view
$listView->clickFilterButton();
$listView->click('Quick Filter');
$listView->fillField('#name_basic', $account_name);
$listView->click('Search', '.submitButtons');
$listView->waitForListViewVisible();
$listView->clickNameLink($account_name);
//Click on Activites subpanel
$I->waitForElementVisible(['id'=>'subpanel_title_activities']);
$I->click(['id'=>'subpanel_title_activities']);
$I->waitForElementVisible('#Activities_createtask_button');
$I->expect('the due date is visible');
$I->seeInSource('01/19/2038');
// Delete the Account
$detailView->clickActionMenuItem('Delete');
$detailView->acceptPopup();
$listView->waitForListViewVisible();
// Delete the Call
$NavigationBar->clickAllMenuItem('Calls');
$listView->waitForListViewVisible();
// Select record from list view
$I->wait(3);
$listView->clickFilterButton();
$listView->click('Quick Filter');
$listView->fillField('#name_basic', $callName);
$listView->click('Search', '.submitButtons');
$listView->waitForListViewVisible();
$listView->clickNameLink($callName);
// Delete record from detail view
$detailView->waitForDetailViewVisible();
$detailView->clickActionMenuItem('Delete');
$detailView->acceptPopup();
$listView->waitForListViewVisible();
}
}