From 8cc4f1abcfb9798f08921d720a343247a046224a Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Tue, 13 May 2014 19:37:26 +0530 Subject: [PATCH] WebFixes 4.5alpha1 --- .../WebTest/Contact/TagSetSearchTest.php | 68 +++++++------------ .../WebTest/Grant/CustomFieldsetTest.php | 2 +- .../Pledge/StandaloneAddDeleteTest.php | 4 +- tests/phpunit/WebTest/Report/AddTest.php | 2 +- .../WebTest/Report/DonarReportTest.php | 2 +- 5 files changed, 29 insertions(+), 49 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/TagSetSearchTest.php b/tests/phpunit/WebTest/Contact/TagSetSearchTest.php index b57b71ac27..0974896406 100644 --- a/tests/phpunit/WebTest/Contact/TagSetSearchTest.php +++ b/tests/phpunit/WebTest/Contact/TagSetSearchTest.php @@ -42,30 +42,30 @@ class WebTest_Contact_TagSetSearchTest extends CiviSeleniumTestCase { $this->webtestAddContact($contact1, "Anderson", "{$contact1}@example.com"); $this->click('css=li#tab_tag a'); - $this->waitForElementPresent("token-input-contact_taglist_{$tagSet1}"); + $this->waitForElementPresent("xpath=//*[@id='contact_taglist_{$tagSet1}']/../div/ul/li[1]/input"); // Add tag1 for Individual 1 $tag1 = substr(sha1(rand()), 0, 5); - $this->click("css=input#token-input-contact_taglist_{$tagSet1}"); - $this->type("css=input#token-input-contact_taglist_{$tagSet1}", $tag1); - $this->typeKeys("css=input#token-input-contact_taglist_{$tagSet1}", $tag1); + $this->click("xpath=//*[@id='contact_taglist_{$tagSet1}']/../div/ul/li[1]/input"); + $this->keyDown("xpath=//*[@id='contact_taglist_{$tagSet1}']/../div/ul/li[1]/input", " "); + $this->type("xpath=//*[@id='contact_taglist_{$tagSet1}']/../div/ul/li[1]/input", $tag1); + $this->typeKeys("xpath=//*[@id='contact_taglist_{$tagSet1}']/../div/ul/li[1]/input", $tag1); // ...waiting for drop down with results to show up... - $this->waitForElementPresent("css=div.token-input-dropdown-facebook"); - $this->waitForElementPresent("css=li.token-input-dropdown-item2-facebook"); + $this->waitForElementPresent("xpath=//div[@class='select2-result-label']"); // ...need to use mouseDownAt on first result (which is a li element), click does not work - $this->mouseDownAt("css=li.token-input-dropdown-item2-facebook"); + $this->clickAt("xpath=//div[@class='select2-result-label']"); $this->waitForTextPresent($tag1); // Add tag2 for Individual 1 $tag2 = substr(sha1(rand()), 0, 5); - $this->click("css=input#token-input-contact_taglist_{$tagSet2}"); - $this->type("css=input#token-input-contact_taglist_{$tagSet2}", $tag2); - $this->typeKeys("css=input#token-input-contact_taglist_{$tagSet2}", $tag2); + $this->click("xpath=//*[@id='contact_taglist_{$tagSet2}']/../div/ul/li[1]/input"); + $this->keyDown("xpath=//*[@id='contact_taglist_{$tagSet2}']/../div/ul/li[1]/input", " "); + $this->type("xpath=//*[@id='contact_taglist_{$tagSet2}']/../div/ul/li[1]/input", $tag2); + $this->typeKeys("xpath=//*[@id='contact_taglist_{$tagSet2}']/../div/ul/li[1]/input", $tag2); // ...waiting for drop down with results to show up... - $this->waitForElementPresent("css=div.token-input-dropdown-facebook"); - $this->waitForElementPresent("css=li.token-input-dropdown-item2-facebook"); + $this->waitForElementPresent("xpath=//div[@class='select2-result-label']"); // ...need to use mouseDownAt on first result (which is a li element), click does not work - $this->mouseDownAt("css=li.token-input-dropdown-item2-facebook"); + $this->clickAt("xpath=//div[@class='select2-result-label']"); $this->waitForTextPresent($tag2); // Individual 2 @@ -73,51 +73,31 @@ class WebTest_Contact_TagSetSearchTest extends CiviSeleniumTestCase { $this->webtestAddContact($contact2, "Anderson", "{$contact2}@example.com"); $this->click('css=li#tab_tag a'); - $this->waitForElementPresent("token-input-contact_taglist_{$tagSet1}"); + $this->waitForElementPresent("xpath=//*[@id='contact_taglist_{$tagSet1}']/../div/ul/li[1]/input"); // Add tag1 for Individual 2 - $this->click("css=input#token-input-contact_taglist_{$tagSet1}"); - $this->type("css=input#token-input-contact_taglist_{$tagSet1}", $tag1); - $this->typeKeys("css=input#token-input-contact_taglist_{$tagSet1}", $tag1); + $this->click("xpath=//*[@id='contact_taglist_{$tagSet1}']/../div/ul/li[1]/input"); + $this->keyDown("xpath=//*[@id='contact_taglist_{$tagSet1}']/../div/ul/li[1]/input", " "); + $this->type("xpath=//*[@id='contact_taglist_{$tagSet1}']/../div/ul/li[1]/input", $tag1); + $this->typeKeys("xpath=//*[@id='contact_taglist_{$tagSet1}']/../div/ul/li[1]/input", $tag1); // ...waiting for drop down with results to show up... - $this->waitForElementPresent("css=div.token-input-dropdown-facebook"); - $this->waitForElementPresent("css=li.token-input-dropdown-item2-facebook"); + $this->waitForElementPresent("xpath=//div[@class='select2-result-label']"); // ...need to use mouseDownAt on first result (which is a li element), click does not work - $this->mouseDownAt("css=li.token-input-dropdown-item2-facebook"); + $this->clickAt("xpath=//div[@class='select2-result-label']"); $this->waitForTextPresent($tag1); // Go to Advance search. $this->openCiviPage('contact/search/advanced', 'reset=1'); // Check both the tagset. - $this->assertTrue($this->isElementPresent("token-input-contact_taglist_{$tagSet1}")); - $this->assertTrue($this->isElementPresent("token-input-contact_taglist_{$tagSet2}")); + $this->assertTrue($this->isElementPresent("contact_taglist_{$tagSet1}")); + $this->assertTrue($this->isElementPresent("contact_taglist_{$tagSet2}")); // Search contact using tags. - $this->click("css=input#token-input-contact_taglist_{$tagSet1}"); - $this->type("css=input#token-input-contact_taglist_{$tagSet1}", $tag1); - $this->typeKeys("css=input#token-input-contact_taglist_{$tagSet1}", $tag1); - - // ...waiting for drop down with results to show up... - $this->waitForElementPresent("css=div.token-input-dropdown-facebook"); - $this->waitForElementPresent("css=li.token-input-dropdown-item2-facebook"); - - // ...need to use mouseDownAt on first result (which is a li element), click does not work - $this->mouseDownAt("css=li.token-input-dropdown-item2-facebook"); + $this->select2("contact_taglist_{$tagSet1}", $tag1, TRUE); $this->waitForTextPresent($tag1); - $this->click("css=input#token-input-contact_taglist_{$tagSet2}"); - $this->type("css=input#token-input-contact_taglist_{$tagSet2}", $tag2); - $this->click("css=input#token-input-contact_taglist_{$tagSet2}"); - $this->type("css=input#token-input-contact_taglist_{$tagSet2}", $tag2); - $this->typeKeys("css=input#token-input-contact_taglist_{$tagSet2}", $tag2); - - // ...waiting for drop down with results to show up... - $this->waitForElementPresent("css=div.token-input-dropdown-facebook"); - $this->waitForElementPresent("css=li.token-input-dropdown-item2-facebook"); - - // ...need to use mouseDownAt on first result (which is a li element), click does not work - $this->mouseDownAt("css=li.token-input-dropdown-item2-facebook"); + $this->select2("contact_taglist_{$tagSet2}", $tag2, TRUE); $this->waitForTextPresent($tag2); diff --git a/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php b/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php index fb46ed3160..832843f04f 100644 --- a/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php +++ b/tests/phpunit/WebTest/Grant/CustomFieldsetTest.php @@ -83,7 +83,7 @@ class WebTest_Grant_CustomFieldsetTest extends CiviSeleniumTestCase { $firstName = 'First' . $rand; $lastName = 'Last' . $rand; $this->webtestNewDialogContact($firstName, $lastName); - $this->select('id=status_id', 'label=Approved'); + $this->select('id=status_id', 'label=Approved for Payment'); $this->select('id=grant_type_id', "label=$grantType"); $this->waitForTextPresent($grantField); $this->assertElementContainsText("xpath=//div[@id='customData']/div[@class='custom-group custom-group-$grantFieldSet crm-accordion-wrapper ']", $grantField); diff --git a/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php b/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php index 1d29b36e52..3a25468ecb 100644 --- a/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php +++ b/tests/phpunit/WebTest/Pledge/StandaloneAddDeleteTest.php @@ -115,8 +115,8 @@ class WebTest_Pledge_StandaloneAddDeleteTest extends CiviSeleniumTestCase { $this->click("xpath=//form[@id='ContributionView']//div[2]/div/div/a[2]/span[text()='Delete']"); $this->waitForElementPresent("xpath=//form[@id='Contribution']/div[2]/div[2]/span/input[@value='Delete']"); $this->click("xpath=//form[@id='Contribution']/div[2]/div[2]/span/input[@value='Delete']"); - $this->waitForElementPresent("ui-id-24"); - $this->click("ui-id-24"); + $this->waitForElementPresent("xpath=//li[@id='tab_pledge']/a"); + $this->click("xpath=//li[@id='tab_pledge']/a"); $this->waitForElementPresent("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[10]/span/a[text()='View']"); $this->click("xpath=//div[@class='view-content']//table[@class='selector row-highlight']//tbody/tr[1]/td[1]/span/a"); $this->waitForElementPresent("xpath=//div[@class='view-content']//table/tbody/tr[2]/td[2]/table/tbody/tr[3]/td[7]"); diff --git a/tests/phpunit/WebTest/Report/AddTest.php b/tests/phpunit/WebTest/Report/AddTest.php index 049ed9026a..abf354e786 100644 --- a/tests/phpunit/WebTest/Report/AddTest.php +++ b/tests/phpunit/WebTest/Report/AddTest.php @@ -123,7 +123,7 @@ class WebTest_Report_AddTest extends CiviSeleniumTestCase { $this->assertElementContainsText('css=table.report-layout', $reportName); // Visit report - $this->click("link=$reportName"); + $this->click("xpath=//div[@id='Contact']//table/tbody//tr/td/a/strong[text() = '$reportName']"); $this->waitForPageToLoad($this->getTimeoutMsec()); // Is filter statistics present? diff --git a/tests/phpunit/WebTest/Report/DonarReportTest.php b/tests/phpunit/WebTest/Report/DonarReportTest.php index b15b676341..f813feb1e5 100644 --- a/tests/phpunit/WebTest/Report/DonarReportTest.php +++ b/tests/phpunit/WebTest/Report/DonarReportTest.php @@ -75,7 +75,7 @@ class WebTest_Report_DonarReportTest extends CiviSeleniumTestCase { $this->assertElementContainsText('css=div#Contribute > table.report-layout', $reportName); // Visit report - $this->click("link=$reportName"); + $this->click("xpath=//div[@id='Contribute']//table/tbody//tr/td/a/strong[text() = '$reportName']"); $this->waitForPageToLoad($this->getTimeoutMsec()); //now select the criteria -- 2.25.1