You are here

protected function AcquiaLiftWebTestBase::getButton in Acquia Lift Connector 7.2

Same name and namespace in other branches
  1. 7 tests/acquia_lift.test \AcquiaLiftWebTestBase::getButton()

Helper method to move buttons names to one pace to simplify it's maintaining

Kind of Page Objects Patterns

Parameters

$type string:

Return value

string

17 calls to AcquiaLiftWebTestBase::getButton()
AcquiaLiftWebTestAgentAdmin::testCreateAgent in tests/acquia_lift.test
AcquiaLiftWebTestCampaignWizard::testGoals in tests/acquia_lift.test
Test goals form.
AcquiaLiftWebTestCampaignWizardReview::testReviewFormStatus in tests/acquia_lift.test
Tests review form status changes.
AcquiaLiftWebTestCampaignWizardReview::testReviewSubmit in tests/acquia_lift.test
Tests the submission of the review form which results in nested tests being created.
AcquiaLiftWebTestCampaignWizardReview::testReviewSubmitErrors in tests/acquia_lift.test
Tests the behavior of the review form when there are batch sync errors.

... See full list

File

tests/acquia_lift.test, line 344
Integration tests for Acquia Lift module.

Class

AcquiaLiftWebTestBase
@file Integration tests for Acquia Lift module.

Code

protected function getButton($type = '', $context = array()) {
  switch ($type) {
    case 'wizard_next':
      module_load_include('inc', 'personalize', 'personalize.admin.campaign');
      $agent_instance = NULL;
      if (isset($context['agent_name'])) {
        $agent_instance = personalize_agent_load_agent($context['agent_name']);
      }
      $steps = _personalize_campaign_wizard_steps($agent_instance);
      $next_step = _personalize_campaign_wizard_next_step(array(
        'storage' => array(
          'step' => $context['step'],
        ),
      ), $agent_instance);
      $next_info = $steps[$next_step];
      $button_text = 'Next: ' . $next_info['preview_message'];
      return t($button_text);
    case 'wizard_save':
    case 'wizard_done':
      return t('Save');
    case 'wizard_start':
      return t('Start');
    case 'wizard_element_navigate':
      return t('Go');
    case 'create_campaign':
      return t('Create and edit');
    case 'delete':
      return t('Delete');
    case 'config':
      return t('Save configuration');
    default:
      return t('Save');
  }
}