From: Web Access Date: Tue, 26 Apr 2016 13:25:43 +0000 (+0530) Subject: Webtests fix: CRM-18454 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=1fd662d26577dd1454934472fe5745bb24080fbf;p=civicrm-core.git Webtests fix: CRM-18454 --- diff --git a/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php b/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php index ab1be6e741..7fbede4277 100644 --- a/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php +++ b/tests/phpunit/WebTest/Case/CaseCustomFieldsTest.php @@ -78,7 +78,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { $testUserLastName = "Testuserlast"; $this->type("first_name", $testUserFirstName); $this->type("last_name", $testUserLastName); - $this->clickLink("_qf_Edit_next", "profilewrap4"); + $this->clickLink("_qf_Edit_next", "profilewrap4", FALSE); $this->openCiviPage('case/add', 'reset=1&action=add&atype=13&context=standalone', '_qf_Case_upload-bottom'); @@ -114,11 +114,11 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { $this->type("{$cusId_1}", $custFname); $this->type("{$cusId_2}", $custMname); $this->type("{$cusId_3}", $custLname); - $this->clickLink("_qf_Case_upload-bottom", "_qf_CaseView_cancel-bottom"); + $this->clickLink("_qf_Case_upload-bottom", "_qf_CaseView_cancel-bottom", FALSE); // Is status message correct? $this->checkCRMAlert("Case opened successfully."); - $this->clickLink("_qf_CaseView_cancel-bottom"); + $this->click("_qf_CaseView_cancel-bottom"); $this->openCiviPage('case', 'reset=1', "xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$client['sort_name']}']/../../td[8]/a[text()='Open Case']"); $this->clickPopupLink("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$client['sort_name']}']/../../td[8]/a[text()='Open Case']"); @@ -135,6 +135,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { "Priority" => "Normal", ); $this->webtestVerifyTabularData($openCaseData); + $this->waitForElementPresent("xpath=//span[@class='ui-button-icon-primary ui-icon fa-times']"); $this->click("xpath=//span[@class='ui-button-icon-primary ui-icon fa-times']"); // verify if custom data is present @@ -325,7 +326,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { $testUserLastName = "Testuserlast"; $this->type("first_name", $testUserFirstName); $this->type("last_name", $testUserLastName); - $this->clickLink("_qf_Edit_next", "profilewrap4"); + $this->clickLink("_qf_Edit_next", "profilewrap4", FALSE); $this->openCiviPage('case/add', 'reset=1&action=add&atype=13&context=standalone', '_qf_Case_upload-bottom'); @@ -358,11 +359,11 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { $this->type("duration", "20"); $this->type("{$cusId_1}", $custFname); $this->type("{$cusId_2}", $custLname); - $this->clickLink("_qf_Case_upload-bottom", "_qf_CaseView_cancel-bottom"); + $this->clickLink("_qf_Case_upload-bottom", "_qf_CaseView_cancel-bottom", FALSE); // Is status message correct? $this->checkCRMAlert("Case opened successfully."); - $this->clickLink("_qf_CaseView_cancel-bottom"); + $this->click("_qf_CaseView_cancel-bottom"); $this->openCiviPage('case', 'reset=1'); $this->waitForElementPresent("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$client['sort_name']}']/../../td[8]/a[text()='Open Case']"); @@ -389,7 +390,7 @@ class WebTest_Case_CaseCustomFieldsTest extends CiviSeleniumTestCase { // verify if custom data is present $this->openCiviPage('case', 'reset=1'); - $this->clickLink("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$client['sort_name']}']/../../td[9]/span/a[text()='Manage']", "css=#{$customGrp1} .crm-accordion-header"); + $this->clickLink("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$client['sort_name']}']/../../td[9]/span/a[text()='Manage']", "css=#{$customGrp1} .crm-accordion-header", FALSE); $this->click("css=#{$customGrp1} .crm-accordion-header"); diff --git a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php index d5147de305..0321ac540f 100644 --- a/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php +++ b/tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php @@ -277,8 +277,8 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes //check the status message $this->waitForText('crm-notification-container', "Relationship created."); - $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']//table/tbody//tr/td[9]/span/a[text()='View']"); - $this->click("xpath=//div[@class='dataTables_wrapper no-footer']//table/tbody//tr/td[9]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//div[@class='crm-contact-relationship-current']//div[@class='dataTables_wrapper no-footer']//table/tbody//tr/td[9]/span/a[text()='View']"); + $this->click("xpath=//div[@class='crm-contact-relationship-current']//div[@class='dataTables_wrapper no-footer']//table/tbody//tr/td[9]/span/a[text()='View']"); $this->waitForElementPresent("xpath=//table[@class='crm-info-panel']"); $this->webtestVerifyTabularData( diff --git a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php index 4ec3d6318f..c2723e417c 100644 --- a/tests/phpunit/WebTest/Contact/SearchBuilderTest.php +++ b/tests/phpunit/WebTest/Contact/SearchBuilderTest.php @@ -459,6 +459,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { $this->webtestFillAutocomplete($firstName1); // fill in Membership Organization + $this->waitForElementPresent("membership_type_id[0]"); $this->select("membership_type_id[0]", "label={$membershipTypes['member_of_contact']}"); // select membership type @@ -471,7 +472,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { $this->webtestFillDate('start_date'); // Clicking save. - $this->clickLink("_qf_Membership_upload"); + $this->click("_qf_Membership_upload"); // page was loaded $this->waitForTextPresent("Membership StandaloneAddTest Webtest"); @@ -498,15 +499,18 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { $this->enterValues(1, 1, 'Membership', 'Membership Type', NULL, '=', array($membershipTypes['membership_type'])); $this->clickLink('_qf_Builder_refresh'); + $this->waitForAjaxContent(); $this->waitForText('search-status', "2 Contacts"); $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']"); $this->enterValues(1, 2, 'Membership', 'Membership Status', NULL, '=', array('New')); $this->clickLink('_qf_Builder_refresh'); + $this->waitForAjaxContent(); $this->waitForText('search-status', "1 Contact"); $this->enterValues(1, 2, 'Membership', 'Membership Status', NULL, '=', array('Grace')); $this->clickLink('_qf_Builder_refresh'); + $this->waitForAjaxContent(); $this->waitForText('search-status', "1 Contact"); $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']"); @@ -514,6 +518,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { $this->click("xpath=//div[@id='map-field']/div[1]/table/tbody/tr[2]/td/a"); $this->enterValues(1, 2, 'Membership', 'Membership Status', NULL, 'IN', array('New', 'Grace')); $this->clickLink('_qf_Builder_refresh'); + $this->waitForAjaxContent(); $this->waitForText('search-status', "2 Contacts"); $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']"); @@ -532,6 +537,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { $this->click("xpath=//div[@class='crm-accordion-header crm-master-accordion-header']"); $this->multiselect2("membership_status_id", array("New", "Grace")); $this->clickLink('_qf_Search_refresh'); + $this->waitForAjaxContent(); $this->waitForText('search-status', "2 Results"); $this->openCiviPage("member/search", "reset=1", "_qf_Search_refresh"); @@ -540,6 +546,7 @@ class WebTest_Contact_SearchBuilderTest extends CiviSeleniumTestCase { $this->select2('membership_type_id', $membershipTypes['membership_type'], TRUE); $this->multiselect2("membership_status_id", array("New")); $this->click('_qf_Search_refresh'); + $this->waitForAjaxContent(); $this->waitForText('search-status', "1 Result"); } diff --git a/tests/phpunit/WebTest/Contact/SignatureTest.php b/tests/phpunit/WebTest/Contact/SignatureTest.php index 6c7498cb46..4b49fac917 100644 --- a/tests/phpunit/WebTest/Contact/SignatureTest.php +++ b/tests/phpunit/WebTest/Contact/SignatureTest.php @@ -117,7 +117,7 @@ class WebTest_Contact_SignatureTest extends CiviSeleniumTestCase { $this->selectFrame("xpath=//iframe[@id='{$fieldName}_ifr']"); } - $this->verifyText('//html/body', preg_quote("{$signature}")); + $this->assertElementContainsText("//html/body", "$signature"); $this->selectFrame('relative=top'); } diff --git a/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php b/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php index 5b67c6c1c0..e74b70d8d7 100644 --- a/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php +++ b/tests/phpunit/WebTest/Contribute/StandaloneAddTest.php @@ -77,6 +77,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { $this->addeditFinancialType($financialType); // Assign the created Financial Account $financialAccountTitle to $financialType + $this->waitForElementPresent("xpath=id('ltype')"); $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[contains(text(), 'Assign Account')]"); $this->click("xpath=//div[@class='ui-dialog-buttonset']//button//span[contains(text(), 'Assign Account')]"); @@ -160,7 +161,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { ); foreach ($expected as $label => $value) { - $this->verifyText("xpath=id('ContributionView')/div[2]/table[1]/tbody//tr/td[1][text()='$label']/../td[2]", preg_quote($value)); + $this->assertElementContainsText("xpath=id('ContributionView')/div[2]/table[1]/tbody//tr/td[1][text()='$label']/../td[2]", $value); } // verify if soft credit was created successfully @@ -170,7 +171,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { ); foreach ($expected as $value) { - $this->verifyText("css=table.crm-soft-credit-listing", preg_quote($value)); + $this->assertElementContainsText("css=table.crm-soft-credit-listing", $value); } // go to first soft creditor contact view page @@ -180,7 +181,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { $this->waitForElementPresent("css=li#tab_contribute a"); $this->click("css=li#tab_contribute a"); $this->waitForElementPresent("link=Record Contribution (Check, Cash, EFT ...)"); - $this->verifyText("xpath=id('Search')/div[2]/table[2]/tbody/tr[2]/td[1]/a", preg_quote($contact['display_name'])); + $this->assertElementContainsText("xpath=id('Search')/div[2]/table[2]/tbody/tr[2]/td[1]/a", $contact['display_name']); // verify soft credit details $expected = array( 4 => $financialType['name'], @@ -188,7 +189,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { 6 => 'Completed', ); foreach ($expected as $value => $label) { - $this->verifyText("xpath=id('Search')/div[2]/table[2]/tbody/tr[2]/td[$value]", preg_quote($label)); + $this->assertElementContainsText("xpath=id('Search')/div[2]/table[2]/tbody/tr[2]/td[$value]", $label); } // CRM-17418 fix: Now cancel the contribution @@ -300,7 +301,7 @@ class WebTest_Contribute_StandaloneAddTest extends CiviSeleniumTestCase { ); foreach ($expected as $label => $value) { - $this->verifyText("xpath=id('ContributionView')/div[2]/table[1]/tbody//tr/td[1][text()='$label']/../td[2]", preg_quote($value)); + $this->assertElementContainsText("xpath=id('ContributionView')/div[2]/table[1]/tbody//tr/td[1][text()='$label']/../td[2]", $value); } }