Webtests Fixes - Master
authorWeb Access <rohan.katkar@webaccessglobal.com>
Mon, 9 Nov 2015 13:20:29 +0000 (18:50 +0530)
committerWeb Access <rohan.katkar@webaccessglobal.com>
Mon, 9 Nov 2015 13:20:29 +0000 (18:50 +0530)
tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/WebTest/Activity/ContactContextAddTest.php
tests/phpunit/WebTest/Campaign/SurveyUsageScenarioTest.php
tests/phpunit/WebTest/Case/AddCaseTypeTest.php
tests/phpunit/WebTest/Contact/MergeContactsTest.php
tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php
tests/phpunit/WebTest/Report/AddTest.php

index 11926a3ebe1bc6143c13be356567dfe9125450ca..c72bc9fded2ae15587168249ece198835c9af904 100644 (file)
@@ -2522,7 +2522,9 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     $this->type("last_name", $lastName);
 
     //address section
+    $this->waitForElementPresent('street_address-1');
     $this->type("street_address-1", "902C El Camino Way SW");
+    $this->waitForElementPresent('city-1');
     $this->type("city-1", "Dumfries");
     $this->type("postal_code-1", "1234");
     $this->assertSelected('country-1', "UNITED STATES");
index 6faf6bfa9a6b55fd85d6659424770865f46fe35e..af0c8011538d7efebc843c3289aa725399c1f014 100644 (file)
@@ -44,7 +44,6 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase {
     $this->webtestAddContact($firstName1, "Summerson", $firstName1 . "@summerson.name");
     $firstName2 = substr(sha1(rand()), 0, 7);
     $this->webtestAddContact($firstName2, "Anderson", $firstName2 . "@anderson.name");
-
     $this->click("css=li#tab_activity a");
 
     // waiting for the activity dropdown to show up
@@ -116,11 +115,10 @@ class WebTest_Activity_ContactContextAddTest extends CiviSeleniumTestCase {
 
     // Is status message correct?
     $this->waitForText('crm-notification-container', $subject);
-
-    $this->waitForElementPresent("xpath=//div[@class='crm-activity-selector-activity']/div[2]/table/tbody/tr[2]/td[8]/span[1]/a[1][text()='View']");
+    $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[8]/span[1]/a[1][text()='View']");
 
     // click through to the Activity view screen
-    $this->click("xpath=//div[@class='crm-activity-selector-activity']/div[2]/table/tbody/tr[2]/td[8]/span[1]/a[1][text()='View']");
+    $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[8]/span[1]/a[1][text()='View']");
     $this->waitForElementPresent('_qf_Activity_cancel-bottom');
 
     // verify Activity created
index 69f98883320773b9cf7121309137422ed430b93d..734aef7def216cf9fceb2c8f86be5d4a8614af9c 100644 (file)
@@ -233,10 +233,10 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
     $this->select('task', "Record Survey Responses");
     $this->waitForElementPresent("_qf_Interview_cancel_interview");
     $this->select("xpath=//table[@class='display crm-copy-fields dataTable no-footer']/tbody/tr[1]/td[@class='result']/select", "value=Label $title 1");
-    $this->click("xpath=//table[@class='display crm-copy-fields dataTable no-footer']/tbody/tr[1]/td[8]/a");
+    $this->click("xpath=//table[@class='display crm-copy-fields dataTable no-footer']/tbody/tr[1]/td[9]/a[1]");
 
     $this->select("xpath=//table[@class='display crm-copy-fields dataTable no-footer']/tbody/tr[2]/td[@class='result']/select", "value=Label $title 2");
-    $this->click("xpath=//table[@class='display crm-copy-fields dataTable no-footer']/tbody/tr[2]/td[8]/a");
+    $this->click("xpath=//table[@class='display crm-copy-fields dataTable no-footer']/tbody/tr[2]/td[9]/a[1]");
     $this->click("_qf_Interview_cancel_interview");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
@@ -603,8 +603,6 @@ class WebTest_Campaign_SurveyUsageScenarioTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent('activity_survey_id');
     $this->select('activity_survey_id', "label=$surveyTitle");
     $this->click('_qf_Search_refresh');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
     $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']");
     $this->verifyText("xpath=//table[@class='selector row-highlight']/tbody//tr/td[5]/a[text()='Smith, $firstName1']/../../td[3]",
       preg_quote("$surveyTitle - Respondent Interview")
index 4de0a8f0a2e18dc4afed792ed714ab97576b9e5b..8a435badbb6d52ba7ecdefeb81b5d655458c1626 100644 (file)
@@ -91,7 +91,7 @@ class WebTest_Case_AddCaseTypeTest extends CiviSeleniumTestCase {
     $this->fillRichTextField("activity_details", $details, 'CKEditor');
     $this->type("activity_subject", $subject);
     $this->waitForElementPresent('case_type_id');
-    $this->select("case_type_id", "label={$caseTypeLabel}");
+    $this->select("case_type_id", "label=$caseTypeLabel");
     $this->waitForElementPresent('status_id');
     $this->select("status_id", "label={$caseStatusLabel}");
 
@@ -109,6 +109,7 @@ class WebTest_Case_AddCaseTypeTest extends CiviSeleniumTestCase {
     }
 
     $this->click("xpath=//div[contains(text(), 'Roles')]");
+    $this->waitForAjaxContent();
 
     // check that expected roles are listed in the Case Roles pane
     foreach ($caseRoles as $key => $role) {
@@ -133,7 +134,7 @@ class WebTest_Case_AddCaseTypeTest extends CiviSeleniumTestCase {
     $this->type('title', $editCaseTypeLabel);
 
     $this->select2("xpath=//div[@id='crm-main-content-wrapper']/div/div/form/div/div[4]/table/tfoot/tr/td/span/div/a", 'Sibling of', FALSE, TRUE);
-    $this->click("xpath=//*[@id='crm-main-content-wrapper']/div/div/form/div/div[4]/table/tbody/tr[4]/td[2]/input[@type='checkbox']");
+    $this->click("xpath=//form[@name='editCaseTypeForm']/div/div[4]/table/tbody/tr[4]/td[2]/input[@type='checkbox']");
 
     $this->click("xpath=//a[text()='Standard Timeline']");
     $this->select2("xpath=//tr[@class='addRow']/td/span[@placeholder='Add activity']/div/a", 'SMS', FALSE, TRUE);
index 417c986962067b1ea6c5f07ce16fa1a34a8afac8..228ea1973dd2999cba4b6992492dc8c0eeacb37f 100644 (file)
@@ -384,7 +384,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent('dupePairs_length');
     $this->select("name=dupePairs_length", "value=100");
     $this->waitForElementPresent("xpath=//a[text()='$firstName $lastName']");
-    $this->click("xpath=//a[text()='$firstName $lastName']/../../td[4]/a[text()='merge']");
+    $this->click("xpath=//a[text()='$firstName $lastName']/../../td[8]/a[text()='merge']");
     $this->waitForElementPresent('_qf_Merge_cancel-bottom');
     $this->clickLink("css=div.crm-contact-merge-form-block div.action-link a", "xpath=//form[@id='Merge']/div[2]/table/tbody/tr[3]/td[4]/span[text()='(overwrite)']", FALSE);
     $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[5]/td[4]/span[text()='(add)']");
@@ -473,8 +473,8 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     // Select the contacts to be merged
     $this->waitForElementPresent('dupePairs_length');
     $this->select("name=dupePairs_length", "value=100");
-    $this->waitForElementPresent("xpath=//table[@class='pagerDisplay dataTable no-footer']/tbody//tr/td[1]/a[text()='$firstName1 $lastName1']/../../td[2]/a[text()='$firstName1 $lastName1']");
-    $this->click("xpath=//table[@class='pagerDisplay dataTable no-footer']/tbody//tr/td[1]/a[text()='$firstName1 $lastName1']/../../td[2]/a[text()='$firstName1 $lastName1']/../../td[4]/a[text()='merge']");
+    $this->waitForElementPresent("xpath=//table[@id='pagerDisplay dataTable no-footer']/tbody//tr/td[1]/a[text()='$firstName1 $lastName1']/../../td[2]/a[text()='$firstName1 $lastName1']");
+    $this->click("xpath=//table[@class='pagerDisplay dataTable no-footer']/tbody//tr/td[1]/a[text()='$firstName1 $lastName1']/../../td[2]/a[text()='$firstName1 $lastName1']/../../td[8]/a[text()='merge']");
     $this->waitForElementPresent('_qf_Merge_cancel-bottom');
     $this->clickLink("css=div.crm-contact-merge-form-block div.action-link a", "xpath=//form[@id='Merge']/div[2]/table/tbody/tr[4]/td[4]/span[text()='(overwrite)']");
     $this->waitForElementPresent("xpath=//form[@id='Merge']/div[2]/table/tbody/tr[3]/td[4]/span[text()='(add)']");
@@ -857,9 +857,9 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase {
     $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->waitForElementPresent("xpath=//a[text()='$sortName']");
+    $this->waitForAjaxContent();
     $this->click("xpath=//a[text()='$sortName']");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->waitForAjaxContent();
 
     // Check if Membership for the individual is created
     $this->waitForElementPresent("xpath=//li[@id='tab_member']/a/em");
index a97f2b6b36c7e7a07839c9e2d45b241b053171ad..b2ca872a224dc9e3f7240b55eb64743d2de443d3 100644 (file)
@@ -64,7 +64,7 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase {
     );
 
     $this->waitForElementPresent('newFinancialType');
-    $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1]/div[text()='$financialType[name]']/../../td[7]/span/a[text()='Accounts']");
+    $this->click("xpath=id('ltype')/div/table/tbody//tr/td[1]/div[text()='$financialType[name]']/../../td[7]/span/a[text()='Accounts']");
     $this->waitForElementPresent('newfinancialTypeAccount');
 
     foreach ($expected as $value => $label) {
@@ -72,10 +72,10 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase {
     }
 
     $this->openCiviPage('admin/financial/financialType', 'reset=1', 'newFinancialType');
-    $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[1]/div[text()='$financialType[name]']/../../td[3]", 'Accounts Receivable,Banking Fees,Premiums,' . $financialType['name']);
-    $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1]/div[text()='$financialType[name]']/../../td[7]/span/a[text()='Accounts']");
+    $this->verifyText("xpath=id('ltype')/div/table/tbody//tr/td[1]/div[text()='$financialType[name]']/../../td[3]", 'Accounts Receivable,Banking Fees,Premiums,' . $financialType['name']);
+    $this->click("xpath=id('ltype')/div/table/tbody//tr/td[1]/div[text()='$financialType[name]']/../../td[7]/span/a[text()='Accounts']");
     $this->waitForElementPresent('newfinancialTypeAccount');
-    $this->click("xpath=//div[@id='ltype']/div/table/tbody/tr/td[2][text()='Banking Fees']/../td[7]/span/a[text()='Edit']");
+    $this->click("xpath=//div[@id='ltype']/div/table/tbody//tr/td[2][text()='Banking Fees']/../td[7]/span/a[text()='Edit']");
     $this->waitForElementPresent('_qf_FinancialTypeAccount_next');
     $this->select('account_relationship', "value=select");
     $this->waitForElementPresent("xpath=//select[@id='account_relationship']/option[text()='- Select Financial Account Relationship -']");
@@ -83,9 +83,9 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("xpath=//select[@id='financial_account_id']/option[3][text()='Deposit Bank Account']");
     $this->select('financial_account_id', "label=Premiums inventory");
     $this->click('_qf_FinancialTypeAccount_next');
-    $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody/tr/td[2][text()='Premiums inventory']/../td[7]/span/a[text()='Edit']");
-    $this->verifyText("xpath=//div[@id='ltype']/div/table/tbody/tr/td[2][text()='Premiums inventory']/../td[1]", preg_quote('Premiums Inventory Account is'));
-    $this->clickLink("xpath=//div[@id='ltype']/div/table/tbody/tr/td[2][text()='Premiums inventory']/../td[7]/span/a[text()='Delete']", '_qf_FinancialTypeAccount_next-botttom', FALSE);
+    $this->waitForElementPresent("xpath=//div[@id='ltype']/div/table/tbody//tr/td[2][text()='Premiums inventory']/../td[7]/span/a[text()='Edit']");
+    $this->verifyText("xpath=//div[@id='ltype']/div/table/tbody//tr/td[2][text()='Premiums inventory']/../td[1]", preg_quote('Premiums Inventory Account is'));
+    $this->clickLink("xpath=//div[@id='ltype']/div/table/tbody//tr/td[2][text()='Premiums inventory']/../td[7]/span/a[text()='Delete']", '_qf_FinancialTypeAccount_next-botttom', FALSE);
     $this->click('_qf_FinancialTypeAccount_next-botttom');
     $this->waitForText('crm-notification-container', 'Selected financial type account has been deleted.');
 
index cb52bb823d78892560da7b9733231b9f3d92114e..8e7852a2a9d24245fc8eb4e3acb3ee2c80788674 100644 (file)
@@ -70,7 +70,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase {
     $this->assertElementContainsText('css=td.crm-report-civicrm_email_email', $emailId, "Email did not found!");
 
     // check criteria
-    $this->click("xpath=//div[@id='mainTabContainer']/ul/li[3]/a");
+    $this->click("xpath=//div[@id='mainTabContainer']/ul//li/a[text()='Filters']");
     $this->waitForElementPresent("xpath=//div[@class='crm-submit-buttons']");
 
     // Is Contact Name filter?
@@ -88,7 +88,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase {
     $reportDescription = "New Contact Summary Report";
     $emaiSubject = "Contact Summary Report";
     $emailCC = "tesmail@example.org";
-    $this->click("xpath=//div[@id='mainTabContainer']/ul/li[4]/a");
+    $this->click("xpath=//div[@id='mainTabContainer']/ul//li/a[text()='Developer']");
     $this->waitForElementPresent("xpath=//div[@class='crm-submit-buttons']");
     $this->click("_qf_Summary_submit_save");
 
@@ -103,7 +103,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent('_qf_Summary_submit_save');
 
     // Fill Email Subject
-    $this->click("xpath=//div[@id='mainTabContainer']/ul/li[5]/a");
+    $this->click("xpath=//div[@id='mainTabContainer']/ul//li/a[text()='Title and Format']");
     $this->waitForAjaxContent();
     $this->type("email_subject", $emaiSubject);
 
@@ -116,7 +116,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase {
     $this->type("email_cc", $emailCC);
 
     // We want navigation menu
-    $this->click("xpath=//div[@id='mainTabContainer']/ul/li[6]/a");
+    $this->click("xpath=//div[@id='mainTabContainer']/ul//li/a[text()='Email Delivery']");
     $this->click("is_navigation");
 
     // Navigation menu under Reports section