0
0
Fork 0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2025-01-12 20:38:31 +00:00
salesagility_SuiteCRM/tests/acceptance/modules/Calls/CallsCest.php

82 lines
2.1 KiB
PHP
Raw Normal View History

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,
\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();
$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
* @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,
\Step\Acceptance\NavigationBarTester $NavigationBar,
2018-05-19 01:23:28 +00:00
\Step\Acceptance\Calls $calls,
\Step\Acceptance\DetailView $detailView
2018-05-15 11:40:50 +00:00
) {
$I->wantTo('Create a call');
// Navigate to Calls
$I->loginAsAdmin();
$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
}