From: Jitendra Purohit Date: Mon, 1 Sep 2014 13:43:04 +0000 (+0530) Subject: WebTest Fixes 4.5 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=aeaa5f5d30aaabb8eb50ffc1832ee0789d3ebc02;p=civicrm-core.git WebTest Fixes 4.5 --- diff --git a/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php b/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php index 3851cb4121..e60da9dae4 100644 --- a/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php +++ b/tests/phpunit/WebTest/Campaign/OfflineContributionTest.php @@ -96,9 +96,7 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase { $this->type("description", "This is a test campaign"); // include groups for the campaign - $this->addSelection("includeGroups-f", "label=$groupName"); - $this->click("//option[@value=4]"); - $this->click("add"); + $this->multiselect2("includeGroups", array("$groupName", "Advisory Board")); // fill the end date for campaign $this->webtestFillDate("end_date", "+1 year"); @@ -112,8 +110,8 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase { $this->waitForText('crm-notification-container', "Campaign $title"); - $this->waitForElementPresent("xpath=//div[@id='campaignList']/div[@id='campaigns_wrapper']/table[@id='campaigns']/tbody//tr/td[text()='$campaignTitle']"); - $url = explode('id=', $this->getAttribute("xpath=//div[@id='campaignList']/div[@id='campaigns_wrapper']/table[@id='campaigns']/tbody//tr/td[text()='$campaignTitle']/../td[13]/span/a[text()='Edit']@href")); + $this->waitForElementPresent("xpath=//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='$campaignTitle']"); + $url = explode('id=', $this->getAttribute("xpath=//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='$campaignTitle']/../td[13]/span/a[text()='Edit']@href")); $campaignId = $url[1]; $this->offlineContributionTest($campaignTitle, $campaignId); @@ -254,9 +252,7 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase { $this->type("description", "This is a test for past campaign"); // include groups for the campaign - $this->addSelection("includeGroups-f", "label=$groupName"); - $this->click("//option[@value=4]"); - $this->click("add"); + $this->multiselect2("includeGroups", array("$groupName", "Advisory Board")); // fill the start date for campaign $this->webtestFillDate("start_date", "1 January 2011"); @@ -278,8 +274,8 @@ class WebTest_Campaign_OfflineContributionTest extends CiviSeleniumTestCase { $this->type("campaign_title", $pastCampaignTitle); $this->click("xpath=//div[@class='crm-accordion-body']/table/tbody/tr[4]/td/a[text()='Search']"); - $this->waitForElementPresent("xpath=//div[@id='campaignList']/div[@id='campaigns_wrapper']/table[@id='campaigns']/tbody//tr/td[text()='$pastCampaignTitle']"); - $url = explode('id=', $this->getAttribute("xpath=//div[@id='campaignList']/div[@id='campaigns_wrapper']/table[@id='campaigns']/tbody//tr/td[text()='$pastCampaignTitle']/../td[13]/span/a[text()='Edit']@href")); + $this->waitForElementPresent("xpath=//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='$pastCampaignTitle']"); + $url = explode('id=', $this->getAttribute("xpath=//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='$pastCampaignTitle']/../td[13]/span/a[text()='Edit']@href")); $campaignId = $url[1]; $this->offlineContributionTest($pastCampaignTitle, $campaignId, TRUE); diff --git a/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php b/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php index 0500b90201..59f256b45f 100644 --- a/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php +++ b/tests/phpunit/WebTest/Campaign/OfflineEventRegistrationTest.php @@ -97,9 +97,7 @@ class WebTest_Campaign_OfflineEventRegistrationTest extends CiviSeleniumTestCase $this->type("description", "This is a test campaign"); // include groups for the campaign - $this->addSelection("includeGroups-f", "label=$groupName"); - $this->click("//option[@value=4]"); - $this->click("add"); + $this->multiselect2("includeGroups", array("$groupName", "Advisory Board")); // fill the end date for campaign $this->webtestFillDate("end_date", "+1 year"); @@ -115,8 +113,8 @@ class WebTest_Campaign_OfflineEventRegistrationTest extends CiviSeleniumTestCase "Status message didn't show up after saving campaign!" ); - $this->waitForElementPresent("//div[@id='campaignList']/div[@id='campaigns_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); - $id = (int) $this->getText("//div[@id='campaignList']/div[@id='campaigns_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); + $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); + $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); $this->offlineParticipantAddTest($campaignTitle, $id); } diff --git a/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php b/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php index af882642a3..66cbc2456c 100644 --- a/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php +++ b/tests/phpunit/WebTest/Campaign/OnlineContributionTest.php @@ -95,9 +95,7 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase { $this->type("description", "This is a test campaign"); // include groups for the campaign - $this->addSelection("includeGroups-f", "label=$groupName"); - $this->click("//option[@value=4]"); - $this->click("add"); + $this->multiselect2("includeGroups", array("$groupName", "Advisory Board")); // fill the end date for campaign $this->webtestFillDate("end_date", "+1 year"); @@ -111,8 +109,8 @@ class WebTest_Campaign_OnlineContributionTest extends CiviSeleniumTestCase { $this->waitForText('crm-notification-container', "Campaign $title"); - $this->waitForElementPresent("//div[@id='campaignList']/div[@id='campaigns_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); - $id = (int) $this->getText("//div[@id='campaignList']/div[@id='campaigns_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); + $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); + $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); $this->onlineContributionAddTest($campaignTitle, $id); } diff --git a/tests/phpunit/WebTest/Campaign/PledgeTest.php b/tests/phpunit/WebTest/Campaign/PledgeTest.php index 7be7258b86..a582a1fc8c 100644 --- a/tests/phpunit/WebTest/Campaign/PledgeTest.php +++ b/tests/phpunit/WebTest/Campaign/PledgeTest.php @@ -96,9 +96,7 @@ class WebTest_Campaign_PledgeTest extends CiviSeleniumTestCase { $this->type("description", "This is a test campaign"); // include groups for the campaign - $this->addSelection("includeGroups-f", "label=$groupName"); - $this->click("//option[@value=4]"); - $this->click("add"); + $this->multiselect2("includeGroups", array("$groupName", "Advisory Board")); // fill the end date for campaign $this->webtestFillDate("end_date", "+1 year"); @@ -114,8 +112,8 @@ class WebTest_Campaign_PledgeTest extends CiviSeleniumTestCase { "Status message didn't show up after saving campaign!" ); - $this->waitForElementPresent("//div[@id='campaignList']/div[@id='campaigns_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); - $id = (int) $this->getText("//div[@id='campaignList']/div[@id='campaigns_wrapper']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); + $this->waitForElementPresent("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); + $id = (int) $this->getText("//div[@id='campaignList']/div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[text()='{$campaignTitle}']/../td[1]"); $this->pledgeAddTest($campaignTitle, $id); } diff --git a/tests/phpunit/WebTest/Contact/GroupAddTest.php b/tests/phpunit/WebTest/Contact/GroupAddTest.php index 4e16677649..8122518bd3 100644 --- a/tests/phpunit/WebTest/Contact/GroupAddTest.php +++ b/tests/phpunit/WebTest/Contact/GroupAddTest.php @@ -74,9 +74,9 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase { $this->openCiviPage('group', 'reset=1'); $this->type('title', $params['name']); $this->click('_qf_Search_refresh'); - $this->waitForElementPresent("xpath=//table[@id='crm-group-selector']/tbody/tr/td[contains(., '{$params['name']}')]"); - $createdBy = $this->getText("xpath=//table[@id='crm-group-selector']/tbody/tr/td[3]/a"); - $this->click("xpath=//table[@id='crm-group-selector']/tbody/tr/td[7]/span/a[2]"); + $this->waitForElementPresent("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td/span[contains(text(), '{$params['name']}')]"); + $createdBy = $this->getText("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td[3]/a"); + $this->click("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td[7]/span/a[2]"); $this->waitForElementPresent("xpath=//form[@id='Edit']/div[2]/div/table[2]/tbody/tr/td[2]/select"); //assert created by in the edit page @@ -91,15 +91,16 @@ class WebTest_Contact_GroupAddTest extends CiviSeleniumTestCase { //show maximum no. of groups on first result set page //as many groups can be created by same creator //and checking is done on first result set page - $this->waitForVisible('crm-group-selector_processing'); - $this->select("xpath=//select[@name='crm-group-selector_length']", '100'); - $this->waitForVisible('crm-group-selector_processing'); + $this->waitForVisible("xpath=//table[@class='crm-group-selector no-footer dataTable']"); + $this->select("xpath=//div[@class='dataTables_length']/label/select", '100'); + $this->waitForVisible("xpath=//table[@class='crm-group-selector no-footer dataTable']"); - $this->waitForElementPresent("xpath=//table[@id='crm-group-selector']/tbody/tr/td[contains(., '{$params['name']}')]"); - $this->assertTrue($this->isElementPresent("xpath=//table[@id='crm-group-selector']/tbody/tr/td[contains(., '{$params['name']}')]/following-sibling::td[2]/a[text()='{$createdBy}']")); + $this->waitForElementPresent("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td/span[contains(text(), '{$params['name']}')]"); + $this->click("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td/span[contains(text(), '{$params['name']}')]/../following-sibling::td[2]/a[text()='{$createdBy}']"); + $this->assertTrue($this->isElementPresent("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody/tr/td/span[contains(text(), '{$params['name']}')]/../following-sibling::td[2]/a[text()='{$createdBy}']")); //check link of the contact who created the group - $this->click("xpath=//table[@id='crm-group-selector']/tbody//tr/td[1][contains(.,'{$params['name']}')]/following-sibling::td[2]/a"); + $this->click("xpath=//table[@class='crm-group-selector no-footer dataTable']/tbody//tr/td[1]/span[contains(text(),'{$params['name']}')]/../following-sibling::td[2]/a"); $this->waitForPageToLoad($this->getTimeoutMsec()); $name = explode(',', $createdBy); $name1 = isset($name[1]) ? trim($name[1]) : NULL; diff --git a/tests/phpunit/WebTest/Event/TellAFriendTest.php b/tests/phpunit/WebTest/Event/TellAFriendTest.php index 92bac87854..7ac922af62 100644 --- a/tests/phpunit/WebTest/Event/TellAFriendTest.php +++ b/tests/phpunit/WebTest/Event/TellAFriendTest.php @@ -211,6 +211,7 @@ class WebTest_Event_TellAFriendTest extends CiviSeleniumTestCase { $this->type("address_1_street_address", $streetAddress); $this->type("address_1_city", "San Francisco"); $this->type("address_1_postal_code", "94117"); + $this->select('address_1_country_id', 'United States'); $this->select("address_1_state_province_id", "value=1004"); $this->type("email_1_email", "info@civicrm.org"); diff --git a/tests/phpunit/WebTest/Export/ContactTest.php b/tests/phpunit/WebTest/Export/ContactTest.php index 98183522d7..5da4c611f3 100644 --- a/tests/phpunit/WebTest/Export/ContactTest.php +++ b/tests/phpunit/WebTest/Export/ContactTest.php @@ -101,7 +101,6 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { // Select the task action to export. $this->click("task"); $this->select("task", "label=Export Contacts"); - $this->click("Go"); $this->waitForPageToLoad($this->getTimeoutMsec()); $csvFile = $this->downloadCSV("_qf_Select_next-bottom"); @@ -222,7 +221,6 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { // Select the task action to export. $this->click("task"); $this->select("task", "label=Export Contacts"); - $this->click("Go"); $this->waitForPageToLoad($this->getTimeoutMsec()); $csvFile = $this->downloadCSV("_qf_Select_next-bottom"); @@ -376,7 +374,6 @@ class WebTest_Export_ContactTest extends ExportCiviSeleniumTestCase { // Select the task action to export. $this->click("task"); $this->select("task", "label=Export Contacts"); - $this->click("Go"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->click("CIVICRM_QFID_2_10"); diff --git a/tests/phpunit/WebTest/Import/SavedMappingTest.php b/tests/phpunit/WebTest/Import/SavedMappingTest.php index 41c226f7d2..314f96825d 100644 --- a/tests/phpunit/WebTest/Import/SavedMappingTest.php +++ b/tests/phpunit/WebTest/Import/SavedMappingTest.php @@ -56,8 +56,8 @@ class WebTest_Import_SavedMappingTest extends ImportCiviSeleniumTestCase { // Map Fields $fieldMapper = array( - 'mapper[0][0]' => 'individual_prefix', - 'mapper[4][0]' => 'individual_suffix', + 'mapper[0][0]' => 'prefix_id', + 'mapper[4][0]' => 'suffix_id', 'mapper[6][0]' => 'phone', 'mapper[6][1]' => '5', 'mapper[7][0]' => 'supplemental_address_1',