<commit_before><?php

use Faker\Generator;

class CampaignsCest
{
    /**
     * @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 = rand(0, 2048);
        $this->fakeData->seed($this->fakeDataSeed);
    }

    /**
     * @param \AcceptanceTester $I
     * @param \Step\Acceptance\ListView $listView
     * @param \Step\Acceptance\Campaigns $campaigns
     * @param \Helper\WebDriverHelper $webDriverHelper
     *
     * As an administrator I want to view the campaigns module.
     */
    public function testScenarioViewCampaignsModule(
        \AcceptanceTester $I,
        \Step\Acceptance\ListView $listView,
        \Step\Acceptance\Campaigns $campaigns,
        \Helper\WebDriverHelper $webDriverHelper
    ) {
        $I->wantTo('View the campaigns module for testing');

        $I->amOnUrl(
            $webDriverHelper->getInstanceURL()
        );

        // Navigate to campaigns list-view
        $I->loginAsAdmin();
        $campaigns->gotoCampaigns();
        $listView->waitForListViewVisible();

        $I->see('Campaigns', '.module-title-text');
    }

    /**
     * @param \AcceptanceTester $I
     * @param \Step\Acceptance\DetailView $detailView
     * @param \Step\Acceptance\ListView $listView
     * @param \Step\Acceptance\Campaigns $campaign
     * @param \Helper\WebDriverHelper $webDriverHelper
     *
     * As administrative user I want to create a non-emails campaign so that I can test
     * the standard fields.
     */
    public function testScenarioCreateNonEmailCampaign(
        \AcceptanceTester $I,
        \Step\Acceptance\DetailView $detailView,
        \Step\Acceptance\ListView $listView,
        \Step\Acceptance\Campaigns $campaign,
        \Helper\WebDriverHelper $webDriverHelper
    ) {
        $I->wantTo('Create Non-Email Campaign');

        $I->amOnUrl(
            $webDriverHelper->getInstanceURL()
        );

        // Navigate to campaigns list-view
        $I->loginAsAdmin();
        $campaign->gotoCampaigns();
        $listView->waitForListViewVisible();

        // Create campaign
        $this->fakeData->seed($this->fakeDataSeed);
        $name = 'Test_'. $this->fakeData->company();
        $campaign->createNonEmailCampaign($name);

        // Delete campaign
        $listView->waitForListViewVisible();
        $listView->clickFilterButton();
        $I->fillField('name_basic', $name);
        $I->click('#search_form_submit');
        $listView->waitForListViewVisible();
        $listView->clickNameLink($name);
        $detailView->waitForDetailViewVisible();
        $detailView->clickActionMenuItem('Delete');
        $detailView->acceptPopup();
        $listView->waitForListViewVisible();
        $listView->clearFilterButton();
    }

    /**
     * @param \AcceptanceTester $I
     * @param \Step\Acceptance\DetailView $detailView
     * @param \Step\Acceptance\ListView $listView
     * @param \Step\Acceptance\Campaigns $campaign
     * @param \Step\Acceptance\InboundEmailTester $inboundEmailTester
     * @param \Step\Acceptance\EmailMan $emailMan
     * @param \Helper\WebDriverHelper $webDriverHelper
     *
     * As administrative user I want to create a Newsletter campaign so that I can test
     * the standard fields.
     */
    public function testScenarioCreateNewsletterCampaign(
        \AcceptanceTester $I,
        \Step\Acceptance\DetailView $detailView,
        \Step\Acceptance\ListView $listView,
        \Step\Acceptance\Campaigns $campaign,
        \Step\Acceptance\EmailMan $emailMan,
        \Step\Acceptance\InboundEmailTester $inboundEmailTester,
        \Helper\WebDriverHelper $webDriverHelper
    ) {
        $I->wantTo('Create Newsletter Campaign');

        $I->amOnUrl(
            $webDriverHelper->getInstanceURL()
        );

//        $I->loginAsAdmin();
//
//        // Setup email settings
//        $emailMan->createEmailSettings();
//        $inboundEmailTester->createBounceEmail();
//
//        // Navigate to campaigns list-view
//        $campaign->gotoCampaigns();
//        $listView->waitForListViewVisible();
//
//        // Create Newsletter campaign
//        $this->fakeData->seed($this->fakeDataSeed);
//        $name = 'Test_'. $this->fakeData->firstname();
//        $campaign->createNewletterCampaign($name);
//
//        // Check that campaign is ready to send
//        $campaign->gotoCampaigns();
//        $listView->waitForListViewVisible();
//        $listView->clickFilterButton();
//        $I->click('Quick Filter');
//        $I->wait(3);
//        $I->fillField('name_basic', $name);
//        $I->click('#search_form_submit');
//        $listView->waitForListViewVisible();
//        $listView->clickNameLink($name);
//        $detailView->clickActionMenuItem('Launch Wizard');
//        $I->wait(5);
//        $I->dontSee('You cannot send a marketing email until your subscription list has at least one entry. You can populate your list after finishing.');
//        $campaign->gotoCampaigns();
//        $listView->clearFilterButton();
//
//        // Delete campaign
//        $listView->waitForListViewVisible();
//        $listView->clickFilterButton();
//        $I->click('Quick Filter');
//        $I->wait(3);
//        $I->fillField('name_basic', $name);
//        $I->click('#search_form_submit');
//        $listView->waitForListViewVisible();
//        $listView->clickNameLink($name);
//        $detailView->waitForDetailViewVisible();
//        $detailView->clickActionMenuItem('Delete');
//        $detailView->acceptPopup();
//        $listView->waitForListViewVisible();
//        $listView->clearFilterButton();
    }
}
<commit_msg>Fix reference to missing class<commit_after><?php

use Faker\Generator;

class CampaignsCest
{
    /**
     * @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 = rand(0, 2048);
        $this->fakeData->seed($this->fakeDataSeed);
    }

    /**
     * @param \AcceptanceTester $I
     * @param \Step\Acceptance\ListView $listView
     * @param \Step\Acceptance\Campaigns $campaigns
     * @param \Helper\WebDriverHelper $webDriverHelper
     *
     * As an administrator I want to view the campaigns module.
     */
    public function testScenarioViewCampaignsModule(
        \AcceptanceTester $I,
        \Step\Acceptance\ListView $listView,
        \Step\Acceptance\Campaigns $campaigns,
        \Helper\WebDriverHelper $webDriverHelper
    ) {
        $I->wantTo('View the campaigns module for testing');

        $I->amOnUrl(
            $webDriverHelper->getInstanceURL()
        );

        // Navigate to campaigns list-view
        $I->loginAsAdmin();
        $campaigns->gotoCampaigns();
        $listView->waitForListViewVisible();

        $I->see('Campaigns', '.module-title-text');
    }

    /**
     * @param \AcceptanceTester $I
     * @param \Step\Acceptance\DetailView $detailView
     * @param \Step\Acceptance\ListView $listView
     * @param \Step\Acceptance\Campaigns $campaign
     * @param \Helper\WebDriverHelper $webDriverHelper
     *
     * As administrative user I want to create a non-emails campaign so that I can test
     * the standard fields.
     */
    public function testScenarioCreateNonEmailCampaign(
        \AcceptanceTester $I,
        \Step\Acceptance\DetailView $detailView,
        \Step\Acceptance\ListView $listView,
        \Step\Acceptance\Campaigns $campaign,
        \Helper\WebDriverHelper $webDriverHelper
    ) {
        $I->wantTo('Create Non-Email Campaign');

        $I->amOnUrl(
            $webDriverHelper->getInstanceURL()
        );

        // Navigate to campaigns list-view
        $I->loginAsAdmin();
        $campaign->gotoCampaigns();
        $listView->waitForListViewVisible();

        // Create campaign
        $this->fakeData->seed($this->fakeDataSeed);
        $name = 'Test_'. $this->fakeData->company();
        $campaign->createNonEmailCampaign($name);

        // Delete campaign
        $listView->waitForListViewVisible();
        $listView->clickFilterButton();
        $I->fillField('name_basic', $name);
        $I->click('#search_form_submit');
        $listView->waitForListViewVisible();
        $listView->clickNameLink($name);
        $detailView->waitForDetailViewVisible();
        $detailView->clickActionMenuItem('Delete');
        $detailView->acceptPopup();
        $listView->waitForListViewVisible();
        $listView->clearFilterButton();
    }

    /**
     * @param \AcceptanceTester $I
     * @param \Step\Acceptance\DetailView $detailView
     * @param \Step\Acceptance\ListView $listView
     * @param \Step\Acceptance\Campaigns $campaign
     * @param \Step\Acceptance\InboundEmailTester $inboundEmailTester
     * @param \Step\Acceptance\EmailMan $EmailManTester,
     * @param \Helper\WebDriverHelper $webDriverHelper
     *
     * As administrative user I want to create a Newsletter campaign so that I can test
     * the standard fields.
     */
    public function testScenarioCreateNewsletterCampaign(
        \AcceptanceTester $I,
        \Step\Acceptance\DetailView $detailView,
        \Step\Acceptance\ListView $listView,
        \Step\Acceptance\Campaigns $campaign,
        \Step\Acceptance\EmailManTester $EmailManTester,
        \Step\Acceptance\InboundEmailTester $inboundEmailTester,
        \Helper\WebDriverHelper $webDriverHelper
    ) {
        $I->wantTo('Create Newsletter Campaign');

        $I->amOnUrl(
            $webDriverHelper->getInstanceURL()
        );

//        $I->loginAsAdmin();
//
//        // Setup email settings
//        $emailMan->createEmailSettings();
//        $inboundEmailTester->createBounceEmail();
//
//        // Navigate to campaigns list-view
//        $campaign->gotoCampaigns();
//        $listView->waitForListViewVisible();
//
//        // Create Newsletter campaign
//        $this->fakeData->seed($this->fakeDataSeed);
//        $name = 'Test_'. $this->fakeData->firstname();
//        $campaign->createNewletterCampaign($name);
//
//        // Check that campaign is ready to send
//        $campaign->gotoCampaigns();
//        $listView->waitForListViewVisible();
//        $listView->clickFilterButton();
//        $I->click('Quick Filter');
//        $I->wait(3);
//        $I->fillField('name_basic', $name);
//        $I->click('#search_form_submit');
//        $listView->waitForListViewVisible();
//        $listView->clickNameLink($name);
//        $detailView->clickActionMenuItem('Launch Wizard');
//        $I->wait(5);
//        $I->dontSee('You cannot send a marketing email until your subscription list has at least one entry. You can populate your list after finishing.');
//        $campaign->gotoCampaigns();
//        $listView->clearFilterButton();
//
//        // Delete campaign
//        $listView->waitForListViewVisible();
//        $listView->clickFilterButton();
//        $I->click('Quick Filter');
//        $I->wait(3);
//        $I->fillField('name_basic', $name);
//        $I->click('#search_form_submit');
//        $listView->waitForListViewVisible();
//        $listView->clickNameLink($name);
//        $detailView->waitForDetailViewVisible();
//        $detailView->clickActionMenuItem('Delete');
//        $detailView->acceptPopup();
//        $listView->waitForListViewVisible();
//        $listView->clearFilterButton();
    }
}

{'fraction_non_alphanumeric': 0.14308546433378197, 'fraction_numerical': 0.0013458950201884253, 'mean_word_length': 2.4291895010095184, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 157, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3430203', 'n_tokens_mistral': 3490, 'n_tokens_neox': 3399, 'n_words': 610}