Webtest Fix 4.5.0
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 11 Sep 2014 14:37:26 +0000 (20:07 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 11 Sep 2014 14:37:26 +0000 (20:07 +0530)
tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/WebTest/Import/AddressParsingTest.php
tests/phpunit/WebTest/Profile/ProfileGroupSubscriptionTest.php
tests/phpunit/WebTest/Profile/SearchTest.php

index 0ed43f0f3f01cabc0af6a3085a899271a14c24a2..65889ae620060995e1fd70cadd1a0db7b2f7f757 100644 (file)
@@ -1907,8 +1907,11 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
     $this->waitForElementPresent('_qf_Group_cancel-bottom');
     $this->type('title', $profileTitle);
     $this->click('_qf_Group_next-bottom');
+    $this->waitForPageToLoad($this->getTimeoutMsec());
 
-    $this->waitForElementPresent('_qf_Field_cancel-bottom');
+    $this->waitForElementPresent("xpath=//a/span[text()='Add Field']");
+    $this->click("xpath=//a/span[text()='Add Field']");
+    $this->waitForElementPresent("field_name[0]");
     //$this->assertTrue($this->isTextPresent("Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."));
 
     foreach ($profileFields as $field) {
@@ -1922,7 +1925,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
       $this->waitForElementPresent('label');
       $this->type("id=label", $field['label']);
       $this->click("id=_qf_Field_next_new-top");
-      $this->waitForPageToLoad($this->getTimeoutMsec());
+      $this->waitForElementPresent("xpath=//select[@id='field_name_1'][@style='display: none;']");
       //$this->assertTrue($this->isTextPresent("Your CiviCRM Profile Field '" . $field['name'] . "' has been saved to '" . $profileTitle . "'. You can add another profile field."));
     }
   }
index 00839d43ae878cbfdec5129a39152dd00e160457..ff9ba23324fa0a419bc7d8c638fa6c0043ecf032 100644 (file)
@@ -79,6 +79,7 @@ class WebTest_Import_AddressParsingTest extends ImportCiviSeleniumTestCase {
       $actualvalue = $this->getValue($key);
       $this->assertEquals($expectedvalue, $actualvalue);
     }
+    $this->clickLink('_qf_Contact_upload_view-top');
 
     //Go to the URL of Address Setting to disable street address parsing option
     $this->openCiviPage("admin/setting/preferences/address", "reset=1");
index 4667ed98723a0cbaecb0969577e235e7164ef13c..0c771d4a203dbbd6b292ee736231fffc88708d8a 100644 (file)
@@ -76,6 +76,8 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase
     $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now.");
 
     //Add email field to profile
+    $this->click("xpath=//a/span[text()='Add Field']");
+    $this->waitForElementPresent("field_name[0]");
     $this->click('field_name[0]');
     $this->select('field_name[0]', 'value=Contact');
     $this->click("//option[@value='Contact']");
@@ -85,7 +87,8 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase
 
     //click on save
     $this->click('_qf_Field_next_new-top');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->waitForText('crm-notification-container', "Your CiviCRM Profile Field 'Email' has been saved to '$profileTitle'.");
+    $this->waitForText('crm-notification-container', 'You can add another profile field.');
 
     //Add email field to profile
     $this->click('field_name[0]');
@@ -98,7 +101,7 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase
     //click on save
     $this->click('_qf_Field_next');
 
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->waitForElementPresent("xpath=//div[@id='field_page']/div/a[4]/span");
 
     //now use profile create mode for group subscription
     $this->click("xpath=//div[@id='field_page']/div/a[4]/span");
@@ -134,8 +137,8 @@ class WebTest_Profile_ProfileGroupSubscriptionTest extends CiviSeleniumTestCase
    * @param $profileTitle
    */
   function _testdeleteProfile($profileTitle) {
-    $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[4]/a[text()='Delete']");
-    $this->click("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[4]/a[text()='Delete']");
+    $this->waitForElementPresent("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[5]/a[text()='Delete']");
+    $this->click("xpath=//div[@id='user-profiles']/div/div/table/tbody//tr/td/span[text() = '$profileTitle']/../../td[7]/span[2][text()='more']/ul/li[5]/a[text()='Delete']");
     $this->waitForElementPresent('_qf_Group_next-bottom');
     $this->click('_qf_Group_next-bottom');
     $this->waitForElementPresent('newCiviCRMProfile-bottom');
index adac5c6d45a7c38eec92bc5ff6631b39d586959a..5fd60341b0cc4e9573bb345eb8236740bdacb0b0 100644 (file)
@@ -58,6 +58,7 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
     //click on save
     $this->click('_qf_Group_next-bottom');
     $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->waitForElementPresent("xpath=//a/span[text()='Add Field']");
 
     //check for  profile create
     $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now.");
@@ -66,6 +67,8 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
     $profileId = $this->urlArg('gid');
 
     // Add Last Name field.
+    $this->click("xpath=//a/span[text()='Add Field']");
+    $this->waitForElementPresent("field_name[0]");
     $this->click('field_name[0]');
     $this->select('field_name[0]', 'value=Individual');
     $this->click('field_name[1]');
@@ -77,7 +80,6 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
     $this->click('in_selector');
     // click on save
     $this->click('_qf_Field_next_new-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
     //check for field add
     $this->waitForText('crm-notification-container', "Your CiviCRM Profile Field 'Last Name' has been saved to '$profileTitle'.");
     $this->waitForText('crm-notification-container', 'You can add another profile field.');
@@ -94,7 +96,6 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
     $this->click('in_selector');
     // click on save
     $this->click('_qf_Field_next_new-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
     //check for field add
     $this->waitForText('crm-notification-container', "Your CiviCRM Profile Field 'Email' has been saved to '$profileTitle'.");
     $this->waitForText('crm-notification-container', 'You can add another profile field.');
@@ -109,7 +110,8 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
     $this->select('visibility', 'value=Public Pages');
     $this->click('is_searchable');
     $this->click('in_selector');
-    $this->clickLink('_qf_Field_next_new-bottom');
+    $this->clickLink('_qf_Field_next_new-bottom', 'field_name[0]', FALSE);
+    $this->waitForElementPresent("xpath=//select[@id='field_name_1'][@style='display: none;']");
 
     // Add state, country and county field
     $this->click('field_name[0]');
@@ -122,7 +124,8 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
     $this->click('is_searchable');
     $this->click('in_selector');
     // click on save and new
-    $this->clickLink('_qf_Field_next_new-bottom');
+    $this->clickLink('_qf_Field_next_new-bottom', 'field_name[0]', FALSE);
+    $this->waitForElementPresent("xpath=//select[@id='field_name_1'][@style='display: none;']");
 
     $this->click('field_name[0]');
     $this->select('field_name[0]', 'value=Contact');
@@ -134,7 +137,8 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
     $this->click('is_searchable');
     $this->click('in_selector');
     // click on save and new
-    $this->clickLink('_qf_Field_next_new-bottom');
+    $this->clickLink('_qf_Field_next_new-bottom', 'field_name[0]', FALSE);
+    $this->waitForElementPresent("xpath=//select[@id='field_name_1'][@style='display: none;']");
 
     $this->click('field_name[0]');
     $this->select('field_name[0]', 'value=Contact');
@@ -147,7 +151,7 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
     $this->click('in_selector');
 
     // click on save
-    $this->clickLink('_qf_Field_next-bottom', "xpath=//div[@id='field_page']/div[1]/a[4]/span[text()='Use (create mode)']");
+    $this->clickLink('_qf_Field_next-bottom', "xpath=//div[@id='field_page']/div[1]/a[4]/span[text()='Use (create mode)']", FALSE);
 
     $uselink = explode('?', $this->getAttribute("xpath=//*[@id='field_page']/div[1]/a[4]@href"));
     $this->openCiviPage('profile/create', "$uselink[1]", '_qf_Edit_cancel');
@@ -198,7 +202,7 @@ class WebTest_Profile_SearchTest extends CiviSeleniumTestCase {
     $this->select('county-Primary', "Alameda");
 
     // Select Custom option
-    $this->click('CIVICRM_QFID_Edu_2');
+    $this->select('custom_1', 'Education');
     $this->click('_qf_Search_refresh');
     $this->waitForPageToLoad($this->getTimeoutMsec());