From 621a73fa7a5568038970928cc50689820bd51555 Mon Sep 17 00:00:00 2001 From: Web Access Date: Thu, 26 Nov 2015 19:06:53 +0530 Subject: [PATCH] Webtest fix --- .../WebTest/Campaign/OfflineEventRegistrationTest.php | 6 ++++-- tests/phpunit/WebTest/Mailing/MailingTest.php | 2 ++ tests/phpunit/WebTest/Report/AddTest.php | 7 ++++--- tests/phpunit/WebTest/Report/DonarReportTest.php | 6 +++--- 4 files changed, 13 insertions(+), 8 deletions(-) diff --git a/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php b/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php index 0a10beb591..37675748f2 100644 --- a/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php +++ b/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php @@ -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")); } diff --git a/tests/phpunit/WebTest/Mailing/MailingTest.php b/tests/phpunit/WebTest/Mailing/MailingTest.php index 068d3d94dd..88508254c6 100644 --- a/tests/phpunit/WebTest/Mailing/MailingTest.php +++ b/tests/phpunit/WebTest/Mailing/MailingTest.php @@ -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 diff --git a/tests/phpunit/WebTest/Report/AddTest.php b/tests/phpunit/WebTest/Report/AddTest.php index 20c849c7e9..d371c31f77 100644 --- a/tests/phpunit/WebTest/Report/AddTest.php +++ b/tests/phpunit/WebTest/Report/AddTest.php @@ -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!"); diff --git a/tests/phpunit/WebTest/Report/DonarReportTest.php b/tests/phpunit/WebTest/Report/DonarReportTest.php index 24e42f8018..6391fbdb09 100644 --- a/tests/phpunit/WebTest/Report/DonarReportTest.php +++ b/tests/phpunit/WebTest/Report/DonarReportTest.php @@ -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"); } } -- 2.25.1