Webtest fix
authorWeb Access <rohan.katkar@webaccessglobal.com>
Thu, 26 Nov 2015 13:36:53 +0000 (19:06 +0530)
committerWeb Access <rohan.katkar@webaccessglobal.com>
Thu, 26 Nov 2015 13:36:53 +0000 (19:06 +0530)
tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php
tests/phpunit/WebTest/Mailing/MailingTest.php
tests/phpunit/WebTest/Report/AddTest.php
tests/phpunit/WebTest/Report/DonarReportTest.php

index 0a10beb591860b0c3bd4c07016977d70a48e7bcc..37675748f2ca3574b76a91c37e84251825e96b45 100644 (file)
@@ -97,6 +97,7 @@ class WebTest_Campaign_OfflineEventRegistrationTest extends CiviSeleniumTestCase
     $this->type("description", "This is a test campaign");
 
     // include groups for the campaign
+    $this->waitForAjaxContent();
     $this->multiselect2("includeGroups", array("$groupName", "Advisory Board"));
 
     // fill the end date for campaign
@@ -153,6 +154,7 @@ class WebTest_Campaign_OfflineEventRegistrationTest extends CiviSeleniumTestCase
     $this->select2("event_id", $eventName);
 
     // Select role
+    $this->waitForAjaxContent();
     $this->multiselect2("role_id", array('Volunteer'));
 
     // Choose Registration Date.
@@ -215,8 +217,8 @@ class WebTest_Campaign_OfflineEventRegistrationTest extends CiviSeleniumTestCase
 
     $this->type('sort_name', $firstName);
     $this->click("_qf_Search_refresh");
-    $this->waitForElementPresent("xpath=//div[@id='participantSearch']");
-    $this->click("xpath=//div[@id='participantSearch']/table/tbody/tr/td[11]/span/a[text()='Edit']");
+    $this->waitForElementPresent("xpath=//table[@class='selector row-highlight']");
+    $this->click("xpath=//table[@class='selector row-highlight']/tbody/tr/td[11]/span/a[text()='Edit']");
     $this->waitForElementPresent("_qf_Participant_cancel-bottom");
     $this->assertTrue($this->isTextPresent("$campaignTitle"));
   }
index 068d3d94dd940a0d9c63452106305cb17980a6ee..88508254c6339aa2a1919bdc82cab9172124ea7d 100644 (file)
@@ -326,6 +326,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
 
     // configure default mail-box
     $this->openCiviPage("admin/mailSettings", "action=update&id=1&reset=1", '_qf_MailSettings_cancel-bottom');
+    $this->waitForElementPresent('name');
     $this->type('name', 'Test Domain');
     $this->type('domain', 'example.com');
     $this->select('protocol', 'value=1');
@@ -348,6 +349,7 @@ class WebTest_Mailing_MailingTest extends CiviSeleniumTestCase {
     $this->waitForTextPresent("~1 recipient");
 
     // fill subject for mailing
+    $this->waitForElementPresent("xpath=//input[@name='subject']");
     $this->type("xpath=//input[@name='subject']", "Test subject {$mailingName} for Webtest");
 
     // HTML format message
index 20c849c7e95d37204444df11117d492c5b2ebf6d..d371c31f770038441d0c9c72ab80d0a6b71090c9 100644 (file)
@@ -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/a[text()='Title and Format']");
+    $this->click("xpath=//div[@id='mainTabContainer']/ul//li/a[text()='Email Delivery']");
     $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/a[text()='Email Delivery']");
+    $this->click("xpath=//div[@id='mainTabContainer']/ul//li/a[text()='Access']");
     $this->click("is_navigation");
 
     // Navigation menu under Reports section
@@ -140,7 +140,8 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase {
     // Visit report
     $this->click("xpath=//div[@id='Contact']//table/tbody//tr/td/a/strong[text() = '$reportName']");
     $this->waitForPageToLoad($this->getTimeoutMsec());
-
+    $this->click("_qf_Summary_submit");
+    $this->waitForAjaxContent();
     // Is filter statistics present?
     $this->assertElementContainsText("xpath=//tr/th[@class='statistics'][text()='Contact Name']/../td", "Contains $firstName", "Statistics did not found!");
 
index 24e42f801860697be372bbfacdbb21225f7c9b85..6391fbdb09842b30a441c6b7b13e9388e35aacfc 100644 (file)
@@ -105,14 +105,14 @@ class WebTest_Report_DonarReportTest extends CiviSeleniumTestCase {
 
     //Is greater than or equal to 100
     //check for criteria
-    $this->assertElementContainsText('css=table.statistics-table', "Is greater than or equal to 10", "Criteria is not selected");
+    $this->verifyText("xpath=//table[@class='report-layout statistics-table']/tbody/tr[3]/td", "Is greater than or equal to 10");
 
     //click on next link
-    $this->click("_qf_Detail_submit_save");
+    $this->click("_qf_Detail_submit");
     $this->waitForPageToLoad($this->getTimeoutMsec());
 
     // check if criteria still exits
-    $this->assertElementContainsText('css=table.statistics-table', "Is greater than or equal to 10", "Criteria is not selected");
+    $this->verifyText("xpath=//table[@class='report-layout statistics-table']/tbody/tr[3]/td", "Is greater than or equal to 10");
   }
 
 }