Webtest Fix 4.5.0
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Wed, 17 Sep 2014 07:21:53 +0000 (12:51 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Wed, 17 Sep 2014 07:21:53 +0000 (12:51 +0530)
15 files changed:
tests/phpunit/CiviTest/CiviSeleniumTestCase.php
tests/phpunit/WebTest/Case/ActivityToCaseTest.php
tests/phpunit/WebTest/Contact/AddTest.php
tests/phpunit/WebTest/Contact/AddViaProfileTest.php
tests/phpunit/WebTest/Contact/CustomDataAddTest.php
tests/phpunit/WebTest/Contribute/AddPricesetTest.php
tests/phpunit/WebTest/Event/AddParticipationTest.php
tests/phpunit/WebTest/Event/AddPricesetTest.php
tests/phpunit/WebTest/Event/PricesetMaxCountTest.php
tests/phpunit/WebTest/Grant/CustomFieldsetTest.php
tests/phpunit/WebTest/Import/AddressImportTest.php
tests/phpunit/WebTest/Import/ContactCustomDataTest.php
tests/phpunit/WebTest/Import/CustomDataTest.php
tests/phpunit/WebTest/Member/DefaultMembershipPricesetTest.php
tests/phpunit/WebTest/Profile/ProfileAddTest.php

index e9fadeb82ed440e0cb3b11eaf5486b8e71848e08..33c9a60022322e70ed4e65f118e063800fb84f06 100644 (file)
@@ -1917,7 +1917,7 @@ class CiviSeleniumTestCase extends PHPUnit_Extensions_SeleniumTestCase {
 
     $this->clickLink('link=Add Profile', '_qf_Group_cancel-bottom');
     $this->type('title', $profileTitle);
-    $this->clickLink('_qf_Group_next-bottom', "xpath=//a/span[text()='Add Field']");
+    $this->clickLink('_qf_Group_next-bottom');
 
     $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now.");
 
index fe83fcc48e505515861a078d69d30cb53035069d..1776f0295f5939b4660df9ae59cf9cdecdb42888 100644 (file)
@@ -354,9 +354,7 @@ class WebTest_Case_ActivityToCaseTest extends CiviSeleniumTestCase {
     $this->click("extends[0]");
     $this->select("extends[0]", "value=Activity");
     $this->click("//option[@value='Activity']");
-    $this->click('_qf_Group_next-bottom');
-    $this->waitForElementPresent('newCustomField');
-    $this->click('newCustomField');
+    $this->clickLink('_qf_Group_next-bottom');
     $this->waitForElementPresent('_qf_Field_cancel-bottom');
 
     //Is custom group created?
index da8e5926f3d1bd716862cdc9ff5a4f9766d89fb0..a0bd13c8123b9bdaf005d2b6412719f0e5587ad5 100644 (file)
@@ -104,7 +104,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase {
     $this->click("address_1_country_id");
     $this->select("address_1_country_id", "value=" . $this->webtestGetValidCountryID());
 
-    if ($this->assertElementContainsText('address_1', "Latitude")) {
+    if ($this->assertElementContainsText('address_table_1', "Latitude")) {
       $this->type("address_1_geo_code_1", "1234");
       $this->type("address_1_geo_code_2", "5678");
     }
@@ -119,7 +119,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase {
     $this->click("address_2_country_id");
     $this->select("address_2_country_id", "value=" . $this->webtestGetValidCountryID());
 
-    if ($this->assertElementContainsText('address_2', "Latitude")) {
+    if ($this->assertElementContainsText('address_table_2', "Latitude")) {
       $this->type("address_2_geo_code_1", "1234");
       $this->type("address_2_geo_code_2", "5678");
     }
@@ -235,7 +235,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase {
     $this->click("address_1_country_id");
     $this->select("address_1_country_id", "value=" . $this->webtestGetValidCountryID());
 
-    if ($this->assertElementContainsText('address_1', "Latitude")) {
+    if ($this->assertElementContainsText('address_table_1', "Latitude")) {
       $this->type("address_1_geo_code_1", "1234");
       $this->type("address_1_geo_code_2", "5678");
     }
@@ -344,7 +344,7 @@ class WebTest_Contact_AddTest extends CiviSeleniumTestCase {
     $this->click("address_1_country_id");
     $this->select("address_1_country_id", "value=" . $this->webtestGetValidCountryID());
 
-    if ($this->assertElementContainsText('address_1', "Latitude")) {
+    if ($this->assertElementContainsText('address_table_1', "Latitude")) {
       $this->type("address_1_geo_code_1", "1234");
       $this->type("address_1_geo_code_2", "5678");
     }
index f9664bef5ad6363e5210928724e99f28173e4f6c..9aad1c54e7c2fcd6457f6951fbe72d7d30840598 100644 (file)
@@ -38,7 +38,7 @@ class WebTest_Contact_AddViaProfileTest extends CiviSeleniumTestCase {
   function testAddViaCreateProfile() {
     $this->webtestLogin();
 
-    $this->openCiviPage('profile/create', 'reset=1&gid=1', '_qf_Edit_cancel');
+    $this->openCiviPage('profile/create', 'reset=1&gid=1', '_qf_Edit_next');
 
     $firstName = 'Jo' . substr(sha1(rand()), 0, 4);
     $lastName = 'Ad' . substr(sha1(rand()), 0, 7);
index 81cc43e5ee82889703f1cbafdf2ca0734dc1da14..edc04efed08238e2a14ec4a3ae0d382ca063e746 100644 (file)
@@ -49,12 +49,10 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase {
     $this->click("extends[0]");
     $this->select("extends[0]", "value=Contact");
     $this->click("//option[@value='Contact']");
-    $this->click("_qf_Group_next-bottom");
-    $this->waitForElementPresent('newCustomField');
+    $this->clickLink("_qf_Group_next-bottom");
 
     //Is custom group created?
     $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
-    $this->click('newCustomField');
     $this->waitForElementPresent("_qf_Field_cancel-bottom");
 
     //add custom field - alphanumeric checkbox
@@ -173,12 +171,10 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase {
     $this->click("extends[0]");
     $this->select("extends[0]", "value=Contact");
     $this->click("//option[@value='Contact']");
-    $this->click("_qf_Group_next-bottom");
-    $this->waitForElementPresent('newCustomField');
+    $this->clickLink("_qf_Group_next-bottom");
 
     //Is custom group created?
     $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
-    $this->click('newCustomField');
     $this->waitForElementPresent("_qf_Field_cancel-bottom");
 
     //add custom field - money text
@@ -259,10 +255,8 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase {
     $this->type("id=title", $customFieldSet);
     $this->select("id=extends_0", "label=Individual");
     $this->click("id=collapse_display");
-    $this->click("id=_qf_Group_next-bottom");
-    $this->waitForElementPresent('newCustomField');
+    $this->clickLink("id=_qf_Group_next-bottom");
     $this->waitForText('crm-notification-container', "Your custom field set '$customFieldSet' has been added.");
-    $this->click('newCustomField');
     $this->waitForElementPresent('_qf_Field_done-bottom');
 
     // Add field to fieldset
@@ -308,7 +302,7 @@ class WebTest_Contact_CustomDataAddTest extends CiviSeleniumTestCase {
     $this->click("address_1_country_id");
     $this->select("address_1_country_id", "value=1228");
 
-    if ($this->assertElementContainsText("address_1", "Latitude")) {
+    if ($this->assertElementContainsText("address_table_1", "Latitude")) {
       $this->type("address_1_geo_code_1", "1234");
       $this->type("address_1_geo_code_2", "5678");
     }
index f8fd446d0a6245b01f7d7b5371077c9182ab29fe..49aa5a23b583fbc15c9388effde7c0d3dea076ee 100644 (file)
@@ -92,7 +92,7 @@ class WebTest_Contribute_AddPricesetTest extends CiviSeleniumTestCase {
     $this->type('help_pre', $setHelp);
 
     $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
-    $this->clickLink('_qf_Set_next-bottom', 'newPriceField');
+    $this->clickLink('_qf_Set_next-bottom');
   }
 
   /**
index 0ec39e516bcdb64e0c0479eea92318cd9045aa26..1e919e1528a9e074de75b92b44a8cc658f027b5b 100644 (file)
@@ -161,8 +161,7 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
     $this->select('extends[1][]', 'value=2');
 
     $this->click("//option[@value='Contact']");
-    $this->click('_qf_Group_next');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->clickLink('_qf_Group_next', 'label');
 
     //Is custom group created?
     $this->waitForText('crm-notification-container', "Your custom field set '$customGroupTitle' has been added. You can add custom fields now.");
@@ -198,14 +197,13 @@ class WebTest_Event_AddParticipationTest extends CiviSeleniumTestCase {
     $this->click('is_searchable');
 
     //clicking save
-    $this->click('_qf_Field_done-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->clickLink('_qf_Field_done-bottom', 'newCustomField', FALSE);
 
     //Is custom field created?
     $this->waitForText('crm-notification-container', "Custom field '$checkboxFieldLabel' has been saved.");
 
     //create another custom field - Integer Radio
-    $this->clickLink("//a[@id='newCustomField']/span", '_qf_Field_cancel', FALSE);
+    $this->clickLink('newCustomField', '_qf_Field_cancel', FALSE);
     $this->click('data_type[0]');
     $this->select('data_type[0]', 'value=1');
     $this->click("//option[@value='1']");
index 4a43b68b6d98852e49acc539f00afb63875e5be1..6f680e628e0b3820d13e3ae231448ac97724288c 100644 (file)
@@ -88,7 +88,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->type('help_pre', $setHelp);
 
     $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
-    $this->clickLink('_qf_Set_next-bottom', 'newPriceField');
+    $this->clickLink('_qf_Set_next-bottom');
   }
 
   /**
@@ -97,7 +97,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
    * @param bool $dateSpecificFields
    */
   function _testAddPriceFields(&$fields, &$validateStrings, $dateSpecificFields = FALSE) {
-    $this->clickLink('newPriceField', '_qf_Field_cancel-bottom', FALSE);
+    $this->waitForElementPresent('_qf_Field_cancel-bottom');
     foreach ($fields as $label => $type) {
       $validateStrings[] = $label;
 
@@ -618,7 +618,7 @@ class WebTest_Event_AddPricesetTest extends CiviSeleniumTestCase {
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // Is status message correct?
-    $this->assertElementContainsText("css=#crm-notification-container", "Event registration for $displayName has been added", "Status message didn't show up after saving!");
+    $this->waitForText("crm-notification-container", "Event registration for $displayName has been added");
 
     $this->waitForElementPresent("xpath=//form[@id='Search']//table//tbody/tr[1]/td[8]/span/a[text()='View']");
     //click through to the participant view screen
index 5d7845cfa11ff0755db44178d38fea468f0d3eb4..db7aec4c8bc3a41b2a8d756407b9834808b43d22 100644 (file)
@@ -1049,7 +1049,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type('help_pre', 'This is test priceset.');
 
     $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
-    $this->clickLink('_qf_Set_next-bottom', 'newPriceField');
+    $this->clickLink('_qf_Set_next-bottom');
   }
 
   /**
@@ -1058,7 +1058,6 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
   function _testAddPriceFields($fields) {
     $fieldCount = count($fields);
     $count = 1;
-    $this->click('newPriceField');
     $this->waitForElementPresent('label');
     foreach ($fields as $label => $field) {
       $this->type('label', $label);
index d76c5f3a19217044c77c514af55582bc438c5863..e722ef3c4284f16503b50cd528dad03d58b9bd5a 100644 (file)
@@ -70,10 +70,8 @@ class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase {
     $this->select('id=extends_0', 'label=Grants');
     $this->addSelection('id=extends_1', "label=$grantType");
     $this->click('id=collapse_display');
-    $this->click('id=_qf_Group_next-bottom');
-    $this->waitForElementPresent('newCustomField');
+    $this->clickLink('id=_qf_Group_next-bottom');
     $this->waitForText('crm-notification-container', "Your custom field set '$grantFieldSet' has been added.");
-    $this->click('newCustomField');
     $this->waitForElementPresent('_qf_Field_done-bottom');
 
     // Add field to fieldset
index 099a608f85f4864cadb12b4729fb7443f3be214a..0f76fb87ebaec8a2e1b2ff754563a2339e696ce0 100644 (file)
@@ -127,13 +127,11 @@ class WebTest_Import_AddressImportTest extends ImportCiviSeleniumTestCase {
     $this->click('extends[0]');
     $this->select('extends[0]', "value=Address");
     $this->click("//option[@value='Address']");
-    $this->click('_qf_Group_next-bottom');
-    $this->waitForElementPresent('newCustomField');
+    $this->clickLink('_qf_Group_next-bottom');
 
     //Is custom group created?
     $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
     $gid = $this->urlArg('gid');
-    $this->click('newCustomField');
     $this->waitForElementPresent('_qf_Field_cancel-bottom');
 
     // create custom field "alphanumeric text"
index 0010dd2dc5cd6421a9b77d2cc351362136fd5181..ec4ccdc2e4f40ffd06d3c0f2f25cde64212318d6 100644 (file)
@@ -161,12 +161,10 @@ class WebTest_Import_ContactCustomDataTest extends ImportCiviSeleniumTestCase {
     $this->click('extends[0]');
     $this->select('extends[0]', "value=Contact");
     $this->click("//option[@value='Contact']");
-    $this->click('_qf_Group_next-bottom');
-    $this->waitForElementPresent('newCustomField');
+    $this->clickLink('_qf_Group_next-bottom');
 
     //Is custom group created?
     $this->waitForText('crm-notification-container', $customGroupTitle);
-    $this->click('newCustomField');
     $this->waitForElementPresent('_qf_Field_cancel-bottom');
     $gid = $this->urlArg('gid');
 
index 2e5f2859dfd24bfbbe967f2890490cb6819a3f1e..cd603ba4b27c52fcd1865d8e38c62b4d6c90ed9e 100644 (file)
@@ -172,12 +172,10 @@ class WebTest_Import_CustomDataTest extends ImportCiviSeleniumTestCase {
     $this->click("extends[0]");
     $this->select("extends[0]", "value=Contact");
     $this->click("//option[@value='Contact']");
-    $this->click('_qf_Group_next-bottom');
-    $this->waitForElementPresent('newCustomField');
+    $this->clickLink('_qf_Group_next-bottom');
 
     //Is custom group created?
     $this->assertTrue($this->isTextPresent("Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."));
-    $this->click('newCustomField');
     $this->waitForElementPresent('_qf_Field_cancel-bottom');
     $url = explode('gid=', $this->getLocation());
     $gid = $url[1];
index d9a9cea3e5b1d463a43c5a9ebd17329ac3ff706a..d33aa0fd72ad9b5c286aed75b642fb5a14bba06c 100755 (executable)
@@ -190,7 +190,7 @@ class WebTest_Member_DefaultMembershipPricesetTest extends CiviSeleniumTestCase
     $this->type('help_pre', $setHelp);
 
     $this->assertChecked('is_active', 'Verify that Is Active checkbox is set.');
-    $this->clickLink('_qf_Set_next-bottom', 'newPriceField');
+    $this->clickLink('_qf_Set_next-bottom');
     $this->assertTrue($this->isTextPresent("Your Set '{$setTitle}' has been added. You can add fields to this set now."));
   }
 
index 3e72157b3aed270a9972a2abd3860af0029fefb2..2874fc83776cf73ed8c6cc5d7e2a89ebfc331675 100644 (file)
@@ -105,7 +105,6 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase {
 
 
     //Add 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');
@@ -276,12 +275,9 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase {
     // Wait for "saved" status msg
     $this->waitForText('crm-notification-container', 'Profile Added');
 
-    $this->waitForElementPresent("xpath=//a/span[text()='Add Field']");
-    $this->click("xpath=//a/span[text()='Add Field']");
     $this->waitForElementPresent("field_name_0");
 
     // select field(s) to be added in profile
-
     $this->select("field_name_0", "value=Contact");
     $this->select("field_name_1", "value=email");
     $this->select("field_name_2", "value=2");
@@ -292,7 +288,6 @@ class WebTest_Profile_ProfileAddTest extends CiviSeleniumTestCase {
     // Wait for "saved" status msg
     $this->waitForText('crm-notification-container', "Profile Field Saved");
 
-
     $this->waitForElementPresent("xpath=//div[@id='field_page']/table/tbody/tr[1]/td[9]/span/a[text()='Edit']");
     // extract profile Id
     $id = explode("gid=", $this->getAttribute("xpath=//div[@id='field_page']/table/tbody/tr/td[9]/span/a[text()='Edit']/@href"));