From 33c81040c04409f97c2a0b1d3a2f6adf132b107a Mon Sep 17 00:00:00 2001 From: Web Access Date: Wed, 25 Nov 2015 18:46:06 +0530 Subject: [PATCH] Tests Fixes --- .../Contact/AdvancedSearchedRelatedContactTest.php | 4 ++-- .../phpunit/WebTest/Contribute/StandaloneAddTest.php | 12 +++++++----- tests/phpunit/WebTest/Event/ParticipantCountTest.php | 2 +- tests/phpunit/WebTest/Member/EditMembershipTest.php | 7 ++++--- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index 7936a0c903..b4aaf4c3f2 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -95,7 +95,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->clickLink("_qf_Basic_refresh", "xpath=//form[@id='Basic']//div/div//div/table/tbody/tr/", FALSE); // click through to the Relationship view screen - $this->click("xpath=//div[@class='crm-search-results']/table[@class='selector row-highlight']/tbody//tr/td[11]/span/a[text()='View']"); + $this->click("xpath=//table[@class='selector row-highlight']/tbody//tr/td[11]/span/a[text()='View']"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->click("css=li#tab_participant a"); @@ -240,7 +240,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh'); $this->type("sort_name", $ContactName); $this->select("contact_type", "value=Individual"); - $this->clickLink("_qf_Basic_refresh", "xpath=//form[@id='Basic']/div[3]/div/div[2]/table/tbody/tr/"); + $this->clickLink("_qf_Basic_refresh", "xpath=//form[@id='Basic']/div[3]/div/div[2]/table/tbody/tr/", FALSE); // click through to the Contribution view screen $this->click("xpath=//form[@id='Basic']/div[3]/div/div[2]/table/tbody/tr/td[11]/span/a[text()='View']"); diff --git a/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php b/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php index 5e6aa10ed2..698d42df4f 100644 --- a/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php @@ -78,13 +78,14 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { // Assign the created Financial Account $financialAccountTitle to $financialType $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1]/div[text()='$financialType[name]']/../../td[7]/span/a[text()='Accounts']"); - $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()=' Assign Account']"); - $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()=' Assign Account']"); + $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']//button/span[contains(text(), 'Assign Account')]"); + $this->click("xpath=//div[@class='ui-dialog-buttonset']//button/span[contains(text(), 'Assign Account')]"); $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Save']"); $this->select('account_relationship', "label=Sales Tax Account is"); + $this->waitForAjaxContent(); $this->select('financial_account_id', "label=" . $financialAccountTitle); $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Save']"); - $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()=' Assign Account']"); + $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']//button/span[contains(text(), 'Assign Account')]"); $this->openCiviPage("contribute/add", "reset=1&context=standalone", "_qf_Contribution_upload"); @@ -104,7 +105,9 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { $this->type("total_amount", "100"); // select payment instrument type = Check and enter chk number - $this->select("payment_instrument_id", "label=Cash"); + $this->select("payment_instrument_id", "value=4"); + $this->waitForElementPresent("check_number"); + $this->type("check_number", "check #1041"); $this->click("is_email_receipt"); $this->assertTrue($this->isChecked("is_email_receipt"), 'Send Receipt checkbox should be checked.'); $this->type("trxn_id", "P20901X1" . rand(100, 10000)); @@ -154,7 +157,6 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { 'Contribution Status' => 'Completed', 'Payment Method' => 'Check', 'Check Number' => 'check #1041', - 'Paid By' => 'Cash', ); foreach ($expected as $label => $value) { diff --git a/tests/phpunit/WebTest/Event/ParticipantCountTest.php b/tests/phpunit/WebTest/Event/ParticipantCountTest.php index cdbda49209..3b9a17de1e 100644 --- a/tests/phpunit/WebTest/Event/ParticipantCountTest.php +++ b/tests/phpunit/WebTest/Event/ParticipantCountTest.php @@ -391,7 +391,7 @@ class WebTest_Event_ParticipantCountTest extends CiviSeleniumTestCase { $this->assertChecked('is_online_registration'); $this->click('intro_text'); - $this->fillRichTextField('intro_text', 'Fill in all the fields below and click Continue.'); + $this->fillRichTextField('intro_text', 'Fill in all the fields below and click Continue.', 'CKEditor', TRUE); // enable confirmation email $this->click('CIVICRM_QFID_1_is_email_confirm'); diff --git a/tests/phpunit/WebTest/Member/EditMembershipTest.php b/tests/phpunit/WebTest/Member/EditMembershipTest.php index 0c18242eb7..44c6609532 100644 --- a/tests/phpunit/WebTest/Member/EditMembershipTest.php +++ b/tests/phpunit/WebTest/Member/EditMembershipTest.php @@ -78,13 +78,14 @@ class WebTest_Member_EditMembershipTest extends CiviSeleniumTestCase { // Assign the created Financial Account $financialAccountTitle to $financialType $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1]/div[text()='$financialType[name]']/../../td[7]/span/a[text()='Accounts']"); - $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()=' Assign Account']"); - $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()=' Assign Account']"); + $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']//button/span[contains(text(), 'Assign Account')]"); + $this->click("xpath=//div[@class='ui-dialog-buttonset']//button/span[contains(text(), 'Assign Account')]"); $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Save']"); $this->select('account_relationship', "label=Sales Tax Account is"); + $this->waitForAjaxContent(); $this->select('financial_account_id', "label=" . $financialAccountTitle); $this->click("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()='Save']"); - $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[text()=' Assign Account']"); + $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']//button/span[contains(text(), 'Assign Account')]"); // add membership type $membershipTypes = $this->webtestAddMembershipType('rolling', 1, 'year', 'no', 100, $financialType['name']); -- 2.25.1