Webtest Fix- Master
authorWeb Access <rohan.katkar@webaccessglobal.com>
Tue, 27 Oct 2015 13:01:38 +0000 (18:31 +0530)
committerWeb Access <rohan.katkar@webaccessglobal.com>
Tue, 27 Oct 2015 13:01:38 +0000 (18:31 +0530)
tests/phpunit/WebTest/Admin/CustomAddTestSameField.php
tests/phpunit/WebTest/Admin/Form/ScheduleReminderTest.php
tests/phpunit/WebTest/Admin/Form/Setting/LocalizationTest.php
tests/phpunit/WebTest/Case/ActivityToCaseTest.php
tests/phpunit/WebTest/Contact/AddressParsingTest.php
tests/phpunit/WebTest/Contact/AdvanceSearchPaneTest.php
tests/phpunit/WebTest/Contact/AdvancedSearchedRelatedContactTest.php
tests/phpunit/WebTest/Contact/ContactTagTest.php
tests/phpunit/WebTest/Contact/GroupAddTest.php
tests/phpunit/WebTest/Contact/TagAddTest.php

index 0908a883612c91c672c43c89c5c1cc8e642b97ee..02cb0b82768b150abb201f5f2e4cc49c0d71ecbf 100644 (file)
@@ -69,6 +69,7 @@ class WebTest_Admin_CustomAddTestSameField extends CiviSeleniumTestCase {
     $this->openCiviPage('admin/custom/group/field/add', "reset=1&action=add&gid=$gid");
     $textFieldLabel = 'test_text_field';
     $this->click("header");
+    $this->waitForElementPresent('label');
     $this->type("label", $textFieldLabel);
     $this->click("_qf_Field_next_new-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
@@ -80,6 +81,7 @@ class WebTest_Admin_CustomAddTestSameField extends CiviSeleniumTestCase {
     $this->click("//option[@value='CheckBox']");
 
     $checkboxFieldLabel = 'test_checkbox';
+    $this->waitForElementPresent('label');
     $this->type("label", $checkboxFieldLabel);
     $checkboxOptionLabel1 = 'check1';
     $this->type("option_label_1", $checkboxOptionLabel1);
@@ -117,6 +119,7 @@ class WebTest_Admin_CustomAddTestSameField extends CiviSeleniumTestCase {
     //add custom field - alphanumeric text
     $textFieldLabel = 'test_text_field';
     $this->click("header");
+    $this->waitForElementPresent('label');
     $this->type("label", $textFieldLabel);
     $this->clickLink("_qf_Field_next_new-bottom");
 
@@ -139,6 +142,7 @@ class WebTest_Admin_CustomAddTestSameField extends CiviSeleniumTestCase {
     $this->click("//option[@value='Radio']");
 
     $radioFieldLabel = 'test_radio';
+    $this->waitForElementPresent('label');
     $this->type("label", $radioFieldLabel);
     $radioOptionLabel1 = 'radio1';
     $this->type("option_label_1", $radioOptionLabel1);
index ee1c011e0b416b60cc36bdb894f0e1e552e4d252..f7af4aa024b35683e04818d73222ae7b750063ae 100644 (file)
@@ -63,8 +63,7 @@ class WebTest_Admin_Form_ScheduleReminderTest extends CiviSeleniumTestCase {
 
     //click on save
     $this->click('_qf_ScheduleReminders_next-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
+    $this->waitForElementPresent("xpath=//div[@id='reminder']/div/table/tbody//tr/td[1]/div[text()='{$title}']/../../td[7]/span/a[text()='Edit']");
     $this->click("xpath=//div[@id='reminder']/div/table/tbody//tr/td[1]/div[text()='{$title}']/../../td[7]/span/a[text()='Edit']");
     $this->waitForElementPresent('_qf_ScheduleReminders_cancel-bottom');
 
index 33001a824085225cd2153ef603bd45909535edae..0e9d046a4303f9a9e52780bb5bc75c1461ecc96f 100644 (file)
@@ -38,17 +38,17 @@ class WebTest_Admin_Form_Setting_LocalizationTest extends CiviSeleniumTestCase {
   public function testDefaultCountryIsEnabled() {
     $this->webtestLogin();
     $this->openCiviPage("admin/setting/localization", "reset=1");
-    $this->addSelection("countryLimit-t", "label=UNITED STATES");
-    $this->click("//select[@id='countryLimit-t']/option");
-    $this->click("//input[@name='remove' and @value='<< Remove' and @type='button' and @onclick=\"QFAMS.moveSelection('countryLimit', this.form.elements['countryLimit-f[]'], this.form.elements['countryLimit-t[]'], this.form.elements['countryLimit[]'], 'remove', 'none'); return false;\"]");
-    $this->addSelection("countryLimit-f", "label=AFGHANISTAN");
-    $this->removeSelection("countryLimit-f", "label=AFGHANISTAN");
-    $this->addSelection("countryLimit-f", "label=CAMBODIA");
-    $this->removeSelection("countryLimit-f", "label=CAMBODIA");
-    $this->addSelection("countryLimit-f", "label=CAMEROON");
-    $this->removeSelection("countryLimit-f", "label=CAMEROON");
-    $this->addSelection("countryLimit-f", "label=CANADA");
-    $this->click("//input[@name='add' and @value='Add >>' and @type='button' and @onclick=\"QFAMS.moveSelection('countryLimit', this.form.elements['countryLimit-f[]'], this.form.elements['countryLimit-t[]'], this.form.elements['countryLimit[]'], 'add', 'none'); return false;\"]");
+    $this->addSelection("countryLimit", "label=UNITED STATES");
+    $this->click("//select[@id='countryLimit']/option");
+    $this->click("//input[@name='remove']");
+    $this->addSelection("countryLimit", "label=AFGHANISTAN");
+    $this->removeSelection("countryLimit", "label=AFGHANISTAN");
+    $this->addSelection("countryLimit", "label=CAMBODIA");
+    $this->removeSelection("countryLimit", "label=CAMBODIA");
+    $this->addSelection("countryLimit", "label=CAMEROON");
+    $this->removeSelection("countryLimit", "label=CAMEROON");
+    $this->addSelection("countryLimit", "label=CANADA");
+    $this->click("//input[@name='add']");
     $this->click("_qf_Localization_next-bottom");
     $this->waitForPageToLoad($this->getTimeoutMsec());
     try {
index 90db9394510fad78829049a55ea9d15d016a8b41..65aeb606da9cb17761d83229b310ae46a47d6116 100644 (file)
@@ -312,27 +312,27 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase {
     $id = $this->urlArg('id');
     $this->waitForElementPresent("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody/tr[1]/td[2]");
 
-    $this->click("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody/tr[1]/td[2]//a[text()='{$subject}']");
+    $this->click("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody/tr[1]/td[2]/div[text()='{$subject}']/../../td[8]/a[1]");
 
     $this->waitForElementPresent('ActivityView');
     $this->waitForElementPresent("css=table#crm-activity-view-table tr.crm-case-activityview-form-block-groupTitle");
     $this->assertElementContainsText('crm-activity-view-table', "$textField");
-    $this->click("xpath=//span[@class='ui-button-icon-primary ui-icon ui-icon-closethick']");
+    $this->click("xpath=//span[@class='ui-button-icon-primary ui-icon fa-times']");
     $this->waitForElementPresent("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody/tr[1]/td[2]");
 
-    $this->click("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/a[text()='{$subject}']/../../td[6]/div[text()='Scheduled']");
+    $this->click("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/div[text()='{$subject}']/../../td[7]/div[text()='Scheduled']");
 
-    $this->waitForElementPresent("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/a[text()='{$subject}']/../../td[6]/div/form/select");
+    $this->waitForElementPresent("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/div[text()='{$subject}']/../../td[7]/div/form/select");
 
     // change activity status
-    $this->select("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/a[text()='{$subject}']/../../td[6]/div/form/select", 'value=2');
-    $this->click("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/a[text()='{$subject}']/../../td[6]/div/form/button[@type='submit']");
+    $this->select("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/div[text()='{$subject}']/../../td[7]/div/form/select", 'value=2');
+    $this->click("xpath=//div[@id='activities']//table[@id='case_id_" . $id . "']/tbody//tr/td[2]/div[text()='{$subject}']/../../td[7]/div/form/button[@type='submit']");
     $this->openCiviPage('case', 'reset=1');
     $this->click("xpath=//table[@class='caseSelector']/tbody//tr/td[2]/a[text()='{$contactName}']/../../td[9]/span/a[text()='Manage']");
     $this->waitForElementPresent('_qf_CaseView_cancel-bottom');
     $id2 = $this->urlArg('id');
     $this->waitForElementPresent("xpath=//div[@id='activities']//table[@id='case_id_" . $id2 . "']/tbody/tr[1]/td[2]");
-    $this->click("xpath=//div[@id='activities']//table[@id='case_id_" . $id2 . "']//a[text()='{$subject}']");
+    $this->click("xpath=//div[@id='activities']//table[@id='case_id_" . $id2 . "']/tbody//tr/td[2]/div[text()='{$subject}']/../../td[8]/a[1]");
     $this->waitForElementPresent('ActivityView');
     $this->waitForElementPresent("css=table#crm-activity-view-table tr.crm-case-activityview-form-block-groupTitle");
   }
index 999bd9f0cbefcae5efe8130f93e141d4ac458fc1..bdf7b0b0af2079d39c8a1b33473991b03d69d9dc 100644 (file)
@@ -76,6 +76,7 @@ class WebTest_Contact_AddressParsingTest extends CiviSeleniumTestCase {
     $this->click("//div[@id='addMoreAddress1']/a/span");
     $this->waitForElementPresent("address_2_street_address");
     $this->type("address_2_street_address", "121 Sherman Street #15");
+    $this->waitForElementPresent("address_2_city");
     $this->type("address_2_city", "Birmingham");
     $this->type("address_2_postal_code", "3456");
     $this->select("address_2_state_province_id", "value=1002");
@@ -94,6 +95,7 @@ class WebTest_Contact_AddressParsingTest extends CiviSeleniumTestCase {
     $this->click("//div[@id='addMoreAddress3']/a/span");
     $this->waitForElementPresent("address_4_street_address");
     $this->type("address_4_street_address", "121 SW Sherman Way Suite 15");
+    $this->waitForElementPresent("address_4_city");
     $this->type("address_4_city", "Birmingham");
     $this->type("address_4_postal_code", "5491");
     $this->assertSelected('address_4_country_id', "UNITED STATES");
index ba76908d72b7ee61dea97ec87979e93daa00c624..f51b74f2e16a52432d310a7a992bf06468d3bb91 100644 (file)
@@ -327,7 +327,7 @@ class WebTest_Contact_AdvanceSearchPaneTest extends CiviSeleniumTestCase {
           'title' => 'Memberships',
           'fields' => array(
             'Membership Type' => array(
-              'type' => 'multiselect2',
+              'type' => 'select2',
               'locator' => 'membership_type_id',
               'values' => array(array('General', 'Student')),
             ),
index af517e9bbc69ee4ed885f4d61cf3561ae551a67f..ca80dee5b7a98b2e11ce77a1513a2165bd9004e5 100644 (file)
@@ -329,6 +329,7 @@ class WebTest_Contact_AdvancedSearchedRelatedContactTest extends CiviSeleniumTes
     $this->waitForPageToLoad($this->getTimeoutMsec());
     $this->assertTrue(TRUE, 'greater than or equal to "{$Pdate}" AND less than or equal to "{$Ndate}"');
     $value = "$lastNameSoft, $firstNameSoft";
+    $this->waitForElementPresent("xpath= id('rowid{$cid}')/td[3]/a");
     $this->verifyText("xpath= id('rowid{$cid}')/td[3]/a", preg_quote($value));
 
   }
index 72485bac45adb1dbe7bc90ddda9c5ed931d7dfc7..ada9094fc6bc91c8db2525beed100437ef898b8b 100644 (file)
@@ -123,8 +123,7 @@ class WebTest_Contact_ContactTagTest extends CiviSeleniumTestCase {
 
     // ...need to use mouseDownAt on first result (which is a li element), click does not work
     $this->clickAt("xpath=//div[@class='select2-result-label']");
-    sleep(2);
-    $this->waitForElementPresent("//div[@id='Tag']/div[2]/div/div/ul/li/div[text()='tagset1']");
+    $this->waitForElementPresent("//div[@id='Tag']/div[2]/div/div/ul/li[1]/div[text()='tagset1']");
     $this->click("xpath=//div[@id='Tag']/div[2]/div/div/ul/li[2]/input");
     $this->keyDown("xpath=//div[@id='Tag']/div[2]/div/div/ul/li[2]/input", " ");
     $this->type("xpath=//div[@id='Tag']/div[2]/div/div/ul/li[2]/input", 'tagset2');
index 442c73b719168e6fa4e0ba3fc3c5552f77781371..36852c317256caa855bbf833eb18c6c50aa17a2a 100644 (file)
@@ -77,7 +77,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
     $this->waitForElementPresent("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td/span[contains(text(), '{$params['name']}')]");
     $createdBy = $this->getText("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td[3]/a");
     $this->click("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td[7]/span/a[2]");
-    $this->waitForElementPresent("xpath=//form[@id='Edit']/div[2]/div/table/tbody/tr[2]/td[contains(text(), '{$createdBy}')]");
+    $this->waitForElementPresent("xpath=//form[@id='Edit']/div[2]/div/table[1]/tbody/tr[2]/td[contains(text(), '{$createdBy}')]");
     $this->openCiviPage('group', 'reset=1');
 
     //search groups using created by
@@ -252,7 +252,7 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase {
     $this->waitForText('crm-notification-container', "Contact Saved");
 
     $this->openCiviPage('group', 'reset=1');
-    $this->waitForElementPresent("xpath=//a/span[text()='Add Group']");
+    $this->waitForElementPresent("xpath=//div[@id='crm-main-content-wrapper']/div[@class='crm-submit-buttons']/a/span[text()=' Add Group']");
     $this->waitForElementPresent("xpath=//table[@id='DataTables_Table_0']/tbody//tr/td[1]/span[contains(text(), '{$group}')]");
     $this->click("xpath=//table[@id='DataTables_Table_0']/tbody//tr/td[1]/span[text()='{$group}']/../../td[7]/span[1]/a[1]");
     $this->waitForPageToLoad($this->getTimeoutMsec());
index ee45db82d9fb583b65b93a272eb99ee4385ab0c7..ca1687f2e3a191795b6d1243ff4047a9d4b2ef73 100644 (file)
@@ -101,7 +101,7 @@ class WebTest_Contact_TagAddTest extends CiviSeleniumTestCase {
     $this->assertTrue($this->isTextPresent("The tag '$tagSetName' has been saved."));
 
     // sort by ID desc
-    $this->click("xpath=//div[@id='cat']/div/table/thead/tr/th[2]/div[text()='ID']");
+    $this->click("xpath=//table[@class='display dataTable no-footer']/thead/tr/th[2]/div[text()='ID']");
     $this->waitForElementPresent("css=table.display tbody tr td");
 
     // verify text