Webtests Fix
authorRohan Katkar <rohan.katkar@webaccessglobal.com>
Thu, 11 Sep 2014 14:43:41 +0000 (20:13 +0530)
committerRohan Katkar <rohan.katkar@webaccessglobal.com>
Thu, 11 Sep 2014 14:43:41 +0000 (20:13 +0530)
tests/phpunit/WebTest/Activity/StandaloneAddTest.php
tests/phpunit/WebTest/Contact/ContactReferenceFieldTest.php
tests/phpunit/WebTest/Mailing/AddMessageTemplateTest.php

index f98ea761f39a7bba046bad9e4e7fb26be0455fff..38f5e06af08b5d1706ce6e60ea2648b828848075 100644 (file)
@@ -136,10 +136,10 @@ class WebTest_Activity_StandaloneAddTest extends CiviSeleniumTestCase {
 
     $this->type("sort_name", $firstName1);
     $this->click("_qf_Search_refresh");
-    $this->waitForElementPresent("Go");
 
-    $this->click("xpath=id('Search')/div[3]/div/div[2]/table/tbody/tr[3]/td[9]/span/a[text()='View']");
-    $this->waitForElementPresent("_qf_Activity_cancel-bottom");
+    $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']/tbody//tr/td[6]/a[text()='Summerson, $firstName2']/../../td[9]/span/a[text()='View']");
+    $this->click("xpath=//table[@class='selector row-highlight']/tbody//tr/td[6]/a[text()='Summerson, $firstName2']/../../td[9]/span/a[text()='View']");
+    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button[3]/span[2]");
 
     $this->VerifyTabularData(
       array(
index a08d882d9a81ff0be01add534350928f8ecdd60e..bcd368c2ababafed66084c65fee5b71389951c3a 100644 (file)
@@ -92,33 +92,39 @@ class WebTest_Contact_ContactReferenceFieldTest extends CiviSeleniumTestCase {
     $this->select("extends[0]", "value=Contact");
     $this->click("//option[@value='Contact']");
     $this->click("_qf_Group_next-bottom");
-    $this->waitForElementPresent("_qf_Field_cancel-bottom");
+    $this->waitForElementPresent("newCustomField");
 
     //Is custom group created?
+    $this->click("newCustomField");
     $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now.");
 
     $customGroupId = $this->urlArg('gid');
 
     // Add contact reference fields
     $contactRefFieldLabel1 = 'contact_ref_' . substr(sha1(rand()), 0, 4);
+    $this->waitForElementPresent("label");
     $this->click("label");
+    $this->waitForElementPresent("label");
     $this->type("label", $contactRefFieldLabel1);
+    $this->waitForElementPresent("data_type[0]");
     $this->select("data_type[0]", "label=Contact Reference");
 
     $this->waitForElementPresent("group_id");
     $this->select("group_id", $groupName);
 
     //clicking save
-    $this->click("_qf_Field_next_new-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->click("xpath=//div[@class='ui-dialog-buttonset']/button[2]/span[2]/");
 
     //Is custom field created?
     $this->waitForText('crm-notification-container', "Custom field '$contactRefFieldLabel1' has been saved.");
-
+    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button[3]/span[2]/");
     //add custom field - alphanumeric checkbox
     $contactRefFieldLabel2 = 'contact_ref_' . substr(sha1(rand()), 0, 4);
+
     $this->click("label");
+    $this->waitForElementPresent("label");
     $this->type("label", $contactRefFieldLabel2);
+    $this->waitForElementPresent("data_type[0]");
     $this->select("data_type[0]", "label=Contact Reference");
 
     $this->waitForElementPresent("group_id");
@@ -128,8 +134,7 @@ class WebTest_Contact_ContactReferenceFieldTest extends CiviSeleniumTestCase {
     $this->type("filter", "action=get&contact_type=Organization");
 
     //clicking save
-    $this->click("_qf_Field_next-bottom");
-    $this->waitForPageToLoad($this->getTimeoutMsec());
+    $this->click("xpath=//div[@class='ui-dialog-buttonset']/button[1]/span[2]/");
 
     //Is custom field created?
     $this->waitForText('crm-notification-container', "Custom field '$contactRefFieldLabel2' has been saved.");
index 3848b7b6ce10a0d42682f300ee13ebe0d7dbb594..b8501c4590354193490dc270350eef5e97c99414 100644 (file)
@@ -113,8 +113,7 @@ class WebTest_Mailing_AddMessageTemplateTest extends CiviSeleniumTestCase {
     $this->type("name", "Mailing $mailingName Webtest");
 
     // Add the test mailing group
-    $this->select("includeGroups-f", "$groupName");
-    $this->click("add");
+    $this->select("includeGroups", "$groupName");
 
     // click next
     $this->click("_qf_Group_next");
@@ -176,10 +175,9 @@ class WebTest_Mailing_AddMessageTemplateTest extends CiviSeleniumTestCase {
     $this->type("sort_name", $firstName);
     $this->click("activity_type_id[19]");
     $this->click("_qf_Search_refresh");
-    $this->waitForElementPresent("_qf_Search_next_print");
-
-    $this->click("xpath=id('Search')/div[3]/div/div[2]/table/tbody/tr[2]/td[9]/span/a[text()='View']");
-    $this->waitForElementPresent("_qf_ActivityView_next");
+    $this->waitForElementPresent("xpath=//form[@id='Search']/div[3]/div/div[2]/table[@class='selector row-highlight']/tbody/tr[2]/td[9]/span/a[1][text()='View']");
+    $this->click("xpath=//form[@id='Search']/div[3]/div/div[2]/table[@class='selector row-highlight']/tbody/tr[2]/td[9]/span/a[1][text()='View']");
+    $this->waitForElementPresent("xpath=//div[@class='ui-dialog-buttonset']/button/span[2]");
     $this->assertElementContainsText('help', "Bulk Email Sent.", "Status message didn't show up after saving!");
   }
 }