webtestLogin(); $this->openCiviPage("admin/setting/preferences/contribute", "reset=1"); $this->waitForElementPresent("_qf_Contribute_next"); // Check hide/show $this->click("deferred_revenue_enabled"); $this->waitForElementPresent("xpath=//tr[@class='crm-preferences-form-block-default_invoice_page'][@style='display: table-row;']"); $this->click("deferred_revenue_enabled"); $this->waitForElementPresent("xpath=//tr[@class='crm-preferences-form-block-default_invoice_page'][@style='display: none;']"); // a random 7-char string and an even number to make this pass unique $hash = substr(sha1(rand()), 0, 7); $rand = 2 * rand(2, 50); $pageTitle = 'Test Contribution Page ' . $hash; // create contribution page with randomized title and default params $pageId = $this->webtestAddContributionPage($hash, $rand, $pageTitle, array('Test Processor' => 'Dummy'), FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, NULL, FALSE, 1, 7, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, 'Donation', TRUE, FALSE); // Input value $this->openCiviPage("admin/setting/preferences/contribute", "reset=1"); $this->waitForElementPresent("_qf_Contribute_next"); $this->click("deferred_revenue_enabled"); $this->waitForElementPresent("xpath=//*[@id='default_invoice_page']"); $this->select('default_invoice_page', "value={$pageId}"); // Check hide/show $this->click("financial_account_bal_enable"); $this->waitForElementPresent("xpath=//tr[@class='crm-preferences-form-block-fiscalYearStart'][@style='display: table-row;']"); $this->click("financial_account_bal_enable"); $this->waitForElementPresent("xpath=//tr[@class='crm-preferences-form-block-fiscalYearStart'][@style='display: none;']"); $this->click("financial_account_bal_enable"); $this->waitForElementPresent("xpath=//*[@id='fiscalYearStart_M']"); $this->select('fiscalYearStart_M', "value=4"); $this->select('fiscalYearStart_d', "value=30"); $this->webtestFillDate('period_closing_date', 'now+2'); $this->click('_qf_Contribute_next'); $this->waitForPageToLoad($this->getTimeoutMsec()); //does data saved. $this->assertTrue($this->isTextPresent('Changes saved.'), "Status message didn't show up after saving!" ); } }