2018-05-15 11:40:50 +00:00
|
|
|
<?php
|
|
|
|
|
2023-06-01 15:27:04 +00:00
|
|
|
#[\AllowDynamicProperties]
|
2018-05-15 11:40:50 +00:00
|
|
|
class CallsCest
|
|
|
|
{
|
2018-05-18 12:39:27 +00:00
|
|
|
/**
|
|
|
|
* @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();
|
|
|
|
}
|
|
|
|
|
2019-08-05 15:31:26 +00:00
|
|
|
$this->fakeDataSeed = mt_rand(0, 2048);
|
2018-05-18 12:39:27 +00:00
|
|
|
$this->fakeData->seed($this->fakeDataSeed);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param \AcceptanceTester $I
|
|
|
|
* @param \Step\Acceptance\ListView $listView
|
|
|
|
*
|
|
|
|
* As an administrator I want to view the calls module.
|
|
|
|
*/
|
|
|
|
public function testScenarioViewCallsModule(
|
|
|
|
\AcceptanceTester $I,
|
2019-06-28 17:30:37 +00:00
|
|
|
\Step\Acceptance\ListView $listView
|
2018-05-18 12:39:27 +00:00
|
|
|
) {
|
|
|
|
$I->wantTo('View the calls module for testing');
|
|
|
|
|
|
|
|
// Navigate to calls list-view
|
|
|
|
$I->loginAsAdmin();
|
2019-06-26 18:00:31 +00:00
|
|
|
$I->visitPage('Calls', 'index');
|
2018-05-18 12:39:27 +00:00
|
|
|
$listView->waitForListViewVisible();
|
|
|
|
|
|
|
|
$I->see('Calls', '.module-title-text');
|
|
|
|
}
|
|
|
|
|
2018-05-15 11:40:50 +00:00
|
|
|
/**
|
|
|
|
* @param \AcceptanceTester $I
|
2018-05-19 01:23:28 +00:00
|
|
|
* @param \Step\Acceptance\ListView $listView
|
2019-01-03 14:03:25 +00:00
|
|
|
* @param \Step\Acceptance\NavigationBarTester $NavigationBar
|
2018-05-19 01:23:28 +00:00
|
|
|
* @param \Step\Acceptance\Calls $calls
|
2018-05-15 11:40:50 +00:00
|
|
|
* @param \Step\Acceptance\DetailView $detailView
|
|
|
|
*
|
|
|
|
* As an administrator I want to verify the date field of a call
|
|
|
|
*/
|
|
|
|
public function testScenarioCallDate(
|
|
|
|
\AcceptanceTester $I,
|
2018-05-19 01:23:28 +00:00
|
|
|
\Step\Acceptance\ListView $listView,
|
2019-01-03 14:03:25 +00:00
|
|
|
\Step\Acceptance\NavigationBarTester $NavigationBar,
|
2018-05-19 01:23:28 +00:00
|
|
|
\Step\Acceptance\Calls $calls,
|
2019-06-26 17:20:00 +00:00
|
|
|
\Step\Acceptance\DetailView $detailView
|
2018-05-15 11:40:50 +00:00
|
|
|
) {
|
|
|
|
$I->wantTo('Create a call');
|
|
|
|
|
|
|
|
// Navigate to Calls
|
|
|
|
$I->loginAsAdmin();
|
2019-06-26 18:00:31 +00:00
|
|
|
$I->visitPage('Calls', 'index');
|
2018-05-15 11:40:50 +00:00
|
|
|
|
2018-05-19 01:23:28 +00:00
|
|
|
// Create call
|
|
|
|
$this->fakeData->seed($this->fakeDataSeed);
|
|
|
|
$callName = 'Test_'. $this->fakeData->company();
|
|
|
|
$calls->createCall($callName);
|
2018-05-15 11:40:50 +00:00
|
|
|
|
2018-05-19 01:23:28 +00:00
|
|
|
// Delete Record
|
|
|
|
$detailView->clickActionMenuItem('Delete');
|
|
|
|
$detailView->acceptPopup();
|
|
|
|
$listView->waitForListViewVisible();
|
2018-05-15 11:40:50 +00:00
|
|
|
}
|
2018-12-20 13:04:52 +00:00
|
|
|
}
|