From e3fcfdf52de8afd8ed7c4caacb94c80ac578bc14 Mon Sep 17 00:00:00 2001 From: Web Access Date: Fri, 22 Apr 2016 18:34:37 +0530 Subject: [PATCH] CRM-18050: Webtest --- .../Member/OfflineAutoRenewMembershipTest.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/tests/phpunit/WebTest/Member/OfflineAutoRenewMembershipTest.php b/tests/phpunit/WebTest/Member/OfflineAutoRenewMembershipTest.php index d8db639079..5ce0bd8267 100644 --- a/tests/phpunit/WebTest/Member/OfflineAutoRenewMembershipTest.php +++ b/tests/phpunit/WebTest/Member/OfflineAutoRenewMembershipTest.php @@ -112,4 +112,38 @@ class WebTest_Member_OfflineAutoRenewMembershipTest extends CiviSeleniumTestCase } } + /** + * CRM-18050: create price set with auto-renewing memberships. + */ + public function testCreatePriceSetWithAutoRenewMembershipType() { + $this->webtestLogin(); + + // Create a membership type to use for this test + $periodType = 'rolling'; + $duration_interval = 1; + $duration_unit = 'year'; + $auto_renew = "required"; + $priceSetTitle = 'Membership PriceSet' . substr(sha1(rand()), 0, 7); + $memTypeParams = $this->webtestAddMembershipType($periodType, $duration_interval, $duration_unit, $auto_renew); + + // Create a price set with membership type. + $this->openCiviPage("admin/price", "reset=1&action=add", '_qf_Set_cancel-bottom'); + $this->type('title', $priceSetTitle); + $this->click("xpath=//table[@class='form-layout']/tbody//tr/td[2]/label[text()='Membership']"); + $this->select('financial_type_id', "value=2"); + $this->click("_qf_Set_next-bottom"); + $this->waitForAjaxContent(); + $this->waitForElementPresent('is_active'); + $fieldLablel = 'Field Label' . substr(sha1(rand()), 0, 7); + $this->type('label', $fieldLablel); + $this->select('html_type', "value=Radio"); + $this->waitForAjaxContent(); + $this->waitForElementPresent('membership_type_id[1]'); + $this->select('membership_type_id[1]', "label={$memTypeParams['membership_type']}"); + $this->waitForAjaxContent(); + $this->click("xpath=//div[@class='ui-dialog-buttonset']//button//span[text()='Save']"); + $this->waitForElementPresent('field_page'); + $this->assertElementContainsText("xpath=//div[@id='crm-main-content-wrapper']/div[@id='field_page']/table/tbody/tr/td[1]/div", "{$fieldLablel}"); + } + } -- 2.25.1