X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=tests%2Fphpunit%2FWebTest%2FContact%2FRelationshipAddTest.php;h=d40a74e595ec169aa15afb6b1d1306fa9d5654c5;hb=5a4f674292060ff1f07ec653e2ec4bf915f6f6ef;hp=a9d0a6191479e8a28610f93942f094e4ad4fa622;hpb=fc39f196c427ec3f13f2a240967bd36f426e9609;p=civicrm-core.git diff --git a/tests/phpunit/WebTest/Contact/RelationshipAddTest.php b/tests/phpunit/WebTest/Contact/RelationshipAddTest.php index a9d0a61914..d40a74e595 100644 --- a/tests/phpunit/WebTest/Contact/RelationshipAddTest.php +++ b/tests/phpunit/WebTest/Contact/RelationshipAddTest.php @@ -1,7 +1,7 @@ webtestLogin(); //create a relationship type between different contact types @@ -79,7 +79,6 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { //fill in the individual $this->select2('related_contact_id', $sortName, TRUE); - //fill in the relationship start date $this->webtestFillDate('start_date', '-2 year'); $this->webtestFillDate('end_date', '+1 year'); @@ -90,13 +89,12 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { //save the relationship //$this->click("_qf_Relationship_upload"); $this->click('_qf_Relationship_upload-bottom'); - $this->waitForElementPresent("crm-contact-relationship-selector-current_wrapper"); //check the status message $this->waitForText('crm-notification-container', 'Relationship created.'); - $this->waitForElementPresent("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); - $this->click("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]/span/a[1][text()='View']"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]/span/a[1][text()='View']"); $this->webtestVerifyTabularData( array( @@ -165,7 +163,6 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { //fill in the individual $this->select2('related_contact_id', $sortName, TRUE); - //fill in the relationship start date $this->webtestFillDate('start_date', '-2 year'); $this->webtestFillDate('end_date', '+1 year'); @@ -175,10 +172,9 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { //save the relationship $this->click('_qf_Relationship_upload-bottom'); - $this->waitForElementPresent("crm-contact-relationship-selector-current_wrapper"); - $this->waitForElementPresent("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); - $this->click("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]/span/a[1][text()='View']"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]/span/a[1][text()='View']"); $this->webtestVerifyTabularData( array( @@ -191,7 +187,7 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { //test for individual contact and household subtype contact //relationship - $typeb = "Household__". $householdSubtypeName; + $typeb = "Household__" . $householdSubtypeName; //create a relationship type between different contact types $params = array( @@ -268,10 +264,9 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { //save the relationship $this->click('_qf_Relationship_upload-bottom'); - $this->waitForElementPresent("crm-contact-relationship-selector-current_wrapper"); - $this->waitForElementPresent("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); - $this->click("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]/span/a[1][text()='View']"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]/span/a[1][text()='View']"); $this->webtestVerifyTabularData( array( @@ -283,7 +278,7 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent($params['label_b_a'])); } - function testRelationshipAddNewIndividualTest() { + public function testRelationshipAddNewIndividualTest() { $this->webtestLogin(); //create a relationship type between different contact types @@ -326,7 +321,7 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { $this->type('organization_name', $orgName); $this->type('email-Primary', "info@" . $orgName . ".com"); $this->click('_qf_Edit_next'); - $this->waitForText("xpath=//div[@id='s2id_related_contact_id']","$orgName"); + $this->waitForText("xpath=//div[@id='s2id_related_contact_id']", "$orgName"); //fill in the relationship start date $this->webtestFillDate('start_date', '-2 year'); @@ -338,13 +333,12 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { //save the relationship //$this->click("_qf_Relationship_upload"); $this->click("_qf_Relationship_upload-bottom"); - $this->waitForElementPresent("crm-contact-relationship-selector-current_wrapper"); //check the status message $this->waitForText('crm-notification-container', 'Relationship created.'); - $this->waitForElementPresent("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); - $this->click("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//table[@id='DataTables_Table_2']/tbody/tr/td[9]/span/a[1][text()='View']"); + $this->click("xpath=//table[@id='DataTables_Table_2']/tbody/tr[1]/td[9]/span/a[1][text()='View']"); $this->webtestVerifyTabularData( array( @@ -355,7 +349,7 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { $this->assertTrue($this->isTextPresent($params['label_a_b'])); } - function testAjaxCustomGroupLoad() { + public function testAjaxCustomGroupLoad() { $this->webtestLogin(); //create a New Individual @@ -366,14 +360,14 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { $triggerElement = array('name' => 'relationship_type_id', 'type' => 'select'); $customSets = array( array('entity' => 'Relationship', 'subEntity' => 'Partner of', 'triggerElement' => $triggerElement), - array('entity' => 'Relationship', 'subEntity' => 'Spouse of', 'triggerElement' => $triggerElement) + array('entity' => 'Relationship', 'subEntity' => 'Spouse of', 'triggerElement' => $triggerElement), ); $pageUrl = array('url' => 'contact/view/rel', 'args' => "cid={$contactId[1]}&action=add&reset=1"); $this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl); } - function testRelationshipAddCurrentEmployerTest() { + public function testRelationshipAddCurrentEmployerTest() { $this->webtestLogin(); //create a New Individual @@ -405,7 +399,7 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { $this->type('organization_name', $orgName); $this->type('email-Primary', "info@" . $orgName . ".com"); $this->click('_qf_Edit_next'); - $this->waitForText("xpath=//div[@id='s2id_related_contact_id']","$orgName"); + $this->waitForText("xpath=//div[@id='s2id_related_contact_id']", "$orgName"); //fill in the relationship start date $this->webtestFillDate('start_date', '-2 year'); @@ -414,17 +408,15 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { $description = "Current employee test."; $this->type("description", $description); - //save the relationship //$this->click("_qf_Relationship_upload"); $this->click('_qf_Relationship_upload-bottom'); - $this->waitForElementPresent("crm-contact-relationship-selector-current_wrapper"); //check the status message $this->waitForText('crm-notification-container', 'Relationship created.'); - $this->waitForElementPresent("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); - $this->click("xpath=//div[@id='crm-contact-relationship-selector-current_wrapper']//table/tbody//tr/td[9]/span/a[text()='View']"); + $this->waitForElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]/span/a[1][text()='View']"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[9]/span/a[1][text()='View']"); $this->webtestVerifyTabularData( array( @@ -433,6 +425,6 @@ class WebTest_Contact_RelationshipAddTest extends CiviSeleniumTestCase { 'Status' => 'Enabled', ) ); - $this->assertTrue($this->isTextPresent("Employee of"),"Employee of relationship type not visible on View Relationship page."); + $this->assertTrue($this->isTextPresent("Employee of"), "Employee of relationship type not visible on View Relationship page."); } }