0
0
Fork 0
mirror of https://github.com/salesagility/SuiteCRM.git synced 2025-03-17 06:42:43 +00:00
salesagility_SuiteCRM/tests/acceptance/modules/Emails/EmailsCest.php
Connor Shea 3a0209d206 Remove unused webDriverHelper variables
Throughout the acceptance test suite the webDriverHelper was unused
after navigating to the root URL was moved into the login helper.

This cleans all of those up.
2019-06-26 11:20:00 -06:00

80 lines
2 KiB
PHP

<?php
use Faker\Factory;
use Faker\Generator;
use Helper\WebDriverHelper;
use Step\Acceptance\Emails;
use Step\Acceptance\EmailsTester;
use Step\Acceptance\ListView;
class EmailsCest
{
/**
* @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 = rand(0, 2048);
$this->fakeData->seed($this->fakeDataSeed);
}
/**
* @param AcceptanceTester $I
* @param ListView $listView
* @param EmailsTester $emails
*
* As an administrator I want to view the emails module.
*/
public function testScenarioViewEmailsModule(
AcceptanceTester $I,
ListView $listView,
EmailsTester $emails
) {
$I->wantTo('View the emails module for testing');
// Navigate to emails list-view
$I->loginAsAdmin();
$emails->gotoEmails();
$listView->waitForListViewVisible();
$I->see('Emails', '.module-title-text');
}
/**
* @param AcceptanceTester $I
* @param WebDriverHelper $webDriverHelper
*
* As an administrator I want to view an email body and check that it's not cached.
*/
public function testScenarioViewEmailBodyHTML(
AcceptanceTester $I,
WebDriverHelper $webDriverHelper
) {
// TODO: Refactor
$I->wantTo('View the HTML of two emails');
$I->loginAsAdmin();
// Check for HTML caching issue
$I->amOnUrl($webDriverHelper->getInstanceURL() . '/index.php?module=Emails&action=DetailView&record=eae65b87-6852-e43c-4213-5b213b39f2aa');
$I->see('Test Description 1');
$I->amOnUrl($webDriverHelper->getInstanceURL() . '/index.php?module=Emails&action=DetailView&record=eae65b87-6852-e43c-4213-5b213b39f2ab');
$I->see('Test Description 2');
}
}