From 151d147766e0ca647b9378c460ad60e13cb24f52 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Mon, 15 Sep 2014 19:11:13 +0530 Subject: [PATCH] Webtest Fix 4.5.0 --- .../WebTest/Contact/MergeContactsTest.php | 6 +- .../Contribute/ContactContextAddTest.php | 12 +- .../Contribute/OfflineContributionTest.php | 3 +- .../WebTest/Profile/BatchUpdateTest.php | 153 +++++++++--------- 4 files changed, 85 insertions(+), 89 deletions(-) diff --git a/tests/phpunit/WebTest/Contact/MergeContactsTest.php b/tests/phpunit/WebTest/Contact/MergeContactsTest.php index 096d39e089..38df43a806 100644 --- a/tests/phpunit/WebTest/Contact/MergeContactsTest.php +++ b/tests/phpunit/WebTest/Contact/MergeContactsTest.php @@ -138,7 +138,7 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { $this->select("name=option51_length", "value=100"); $this->waitForElementPresent("xpath=//a[text()='$firstName $lastName']/../../td[4]/a[text()='merge']"); - $this->click("xpath=//a[text()='$firstName $lastName']/../../td[4]/a[text()='merge']"); + $this->clickLink("xpath=//a[text()='$firstName $lastName']/../../td[4]/a[text()='merge']"); $this->waitForElementPresent('_qf_Merge_cancel-bottom'); $this->clickLink("css=div.crm-contact-merge-form-block div.action-link a", '_qf_Merge_cancel-bottom'); @@ -180,8 +180,8 @@ class WebTest_Contact_MergeContactsTest extends CiviSeleniumTestCase { // Verify activity merged $this->click("css=li#tab_activity a"); - $this->waitForElementPresent("xpath=//table[@id='contact-activity-selector-activity']/tbody/tr"); - $this->verifyText("xpath=//table[@id='contact-activity-selector-activity']/tbody/tr/td[5]/a", + $this->waitForElementPresent("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr"); + $this->verifyText("xpath=//table[@class='contact-activity-selector-activity dataTable no-footer']/tbody/tr/td[5]/a", preg_quote("$lastName, $firstName") ); diff --git a/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php b/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php index dce676e521..7aa50a0521 100644 --- a/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php +++ b/tests/phpunit/WebTest/Contribute/ContactContextAddTest.php @@ -137,11 +137,14 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase { $this->webtestFillDate('fulfilled_date'); // Clicking save. - $this->clickLink("_qf_Contribution_upload-bottom", 'civicrm-footer'); + $this->clickLink("_qf_Contribution_upload-bottom", 'civicrm-footer', FALSE); // Is status message correct? $this->waitForText('crm-notification-container', "The contribution record has been saved"); $this->waitForElementPresent("xpath=//div[@class='view-content']/table[2]/tbody/tr/td[8]/span/a[text()='View']"); + $viewUrl = $this->parseURL($this->getAttribute("xpath=//div[@class='view-content']/table[2]/tbody/tr/td[8]/span/a[text()='View']@href")); + $id = $viewUrl['queryString']['id']; + $this->assertType('numeric', $id); // click through to the Contribution view screen $this->click("xpath=//div[@class='view-content']/table[2]/tbody/tr/td[8]/span/a[text()='View']"); @@ -164,9 +167,6 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase { } // check values of contribution record in the DB - $viewUrl = $this->parseURL(); - $id = $viewUrl['queryString']['id']; - $this->assertType('numeric', $id); $searchParams = array('id' => $id); $compareParams = array( @@ -176,7 +176,7 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase { $this->assertDBCompareValues('CRM_Contribute_DAO_Contribution', $searchParams, $compareParams); // go to soft creditor contact view page - $this->click("css=table.crm-soft-credit-listing tbody tr td a"); + $this->clickLink("css=table.crm-soft-credit-listing tbody tr td a"); // go to contribution tab $this->waitForElementPresent("css=li#tab_contribute a"); @@ -191,7 +191,7 @@ class WebTest_Contribute_ContactContextAddTest extends CiviSeleniumTestCase { 1 => "{$firstName} Anderson", ); foreach ($expected as $value => $label) { - $this->verifyText("xpath=id('Search')/div[2]/table[2]/tbody/tr[2]/td[$value]", preg_quote($label)); + $this->verifyText("xpath=id('Search')/div[2]/table[2]/tbody//tr/td[$value]", preg_quote($label)); } } } diff --git a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php index c0f6e65500..b8ade41317 100644 --- a/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php +++ b/tests/phpunit/WebTest/Contribute/OfflineContributionTest.php @@ -46,7 +46,7 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { //financial account for check $this->openCiviPage("admin/options/payment_instrument", "reset=1"); - $financialAccount = $this->getText("xpath=//div[@id='payment_instrument']/div/table/tbody//tr/td[1][text()='Check']/../td[3]"); + $financialAccount = $this->getText("xpath=//div[@id='payment_instrument']/table/tbody//tr/td[1][text()='Check']/../td[3]"); // Add new Financial Account $orgName = 'Alberta ' . substr(sha1(rand()), 0, 7); @@ -322,7 +322,6 @@ class WebTest_Contribute_OfflineContributionTest extends CiviSeleniumTestCase { $this->waitForElementPresent("css=li#tab_contribute a"); $this->click("css=li#tab_contribute a"); $this->waitForElementPresent("link=Submit Credit Card Contribution"); - $this->clickLink("link=Submit Credit Card Contribution", "_qf_Contribution_cancel-bottom", FALSE); // since we don't have live credentials we will switch to test mode $url = $this->getAttribute("xpath=//*[@id='Search']/div[2]/div[2]/a[2]@href"); diff --git a/tests/phpunit/WebTest/Profile/BatchUpdateTest.php b/tests/phpunit/WebTest/Profile/BatchUpdateTest.php index 7fbee3e4d8..c9a82d62d7 100644 --- a/tests/phpunit/WebTest/Profile/BatchUpdateTest.php +++ b/tests/phpunit/WebTest/Profile/BatchUpdateTest.php @@ -72,14 +72,12 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh'); $this->type('sort_name', "Smiths_x"); $this->click('_qf_Basic_refresh'); - $this->waitForElementPresent('Go'); // Batch Update Via Profile $this->waitForElementPresent('CIVICRM_QFID_ts_all_4'); $this->click('CIVICRM_QFID_ts_all_4'); $this->select('task', "label=Batch Update via Profile"); - $this->click('Go'); $this->waitForElementPresent('_qf_PickProfile_next'); $this->waitForElementPresent('uf_group_id'); $this->select('uf_group_id', "label={$profileTitle}"); @@ -158,14 +156,12 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh'); $this->type('sort_name', $lastName); $this->click('_qf_Basic_refresh'); - $this->waitForElementPresent('Go'); // Batch Update Via Profile $this->waitForElementPresent('CIVICRM_QFID_ts_all_4'); $this->click('CIVICRM_QFID_ts_all_4'); $this->select('task', "label=Batch Update via Profile"); - $this->click('Go'); $this->waitForElementPresent('_qf_PickProfile_next'); $this->select('uf_group_id', "label={$profileTitle}"); @@ -339,14 +335,12 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->openCiviPage('contact/search', 'reset=1', '_qf_Basic_refresh'); $this->type('sort_name', $lastName); $this->click('_qf_Basic_refresh'); - $this->waitForElementPresent('Go'); // Batch Update Via Profile $this->waitForElementPresent('CIVICRM_QFID_ts_all_4'); $this->click('CIVICRM_QFID_ts_all_4'); $this->select('task', "label=Batch Update via Profile"); - $this->click('Go'); $this->waitForElementPresent('_qf_PickProfile_next'); $this->select('uf_group_id', "label={$profileTitle}"); @@ -403,47 +397,46 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { //Reserve and interview respondents $this->openCiviPage('campaign', 'reset=1&subPage=survey'); - $this->waitForElementPresent("xpath=//table[@id='surveys']/tbody//tr/td[2]/a[text()='{$surveyTitle}']/../following-sibling::td[@class=' crm-campaign-voterLinks']/span/ul/li/a"); - $this->click("xpath=//table[@id='surveys']/tbody//tr/td[2]/a[text()='{$surveyTitle}']/../following-sibling::td[@class=' crm-campaign-voterLinks']/span/ul/li/a"); + $this->waitForElementPresent("xpath=//table[@class='surveys dataTable no-footer']/tbody//tr/td[2]/a[text()='{$surveyTitle}']/../following-sibling::td[@class=' crm-campaign-voterLinks']/span/ul/li/a"); + $this->click("xpath=//table[@class='surveys dataTable no-footer']/tbody//tr/td[2]/a[text()='{$surveyTitle}']/../following-sibling::td[@class=' crm-campaign-voterLinks']/span/ul/li/a"); $this->waitForPageToLoad($this->getTimeoutMsec()); $this->click("xpath=//div[@id='search_form_reserve']/div"); $this->waitForElementPresent('sort_name'); $this->type('sort_name', $lastName); $this->waitForElementPresent('_qf_Search_refresh'); - $this->clickLink('_qf_Search_refresh', 'Go'); + $this->clickLink('_qf_Search_refresh', 'toggleSelect'); $this->click('toggleSelect'); $this->select('task', "value=2"); - $this->click('Go'); $this->waitForElementPresent('_qf_Reserve_next_reserveToInterview-top'); $this->clickLink('_qf_Reserve_next_reserveToInterview-top', '_qf_Interview_cancel_interview'); - $this->isElementPresent("xpath=//table[@id='voterRecords']/tbody//tr/td[text()='{$Name2}']"); - $this->isElementPresent("xpath=//table[@id='voterRecords']/tbody//tr/td[text()='{$Name1}']"); + $this->isElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='{$Name2}']"); + $this->isElementPresent("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody//tr/td[text()='{$Name1}']"); //edition to be done here // selecting first check of profile - $this->click("xpath=//table[@id='voterRecords']/tbody/tr/td[3]/input[2]"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[3]/input[2]"); // selecting second check of profile - $this->click("xpath=//table[@id='voterRecords']/tbody/tr/td[4]/input[2]"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/input[2]"); // clicking copy values to rows of first check and verifying // if other check Profile Field check box are affected - $this->click("xpath=//table[@id='voterRecords']/thead/tr/th[3]/div/img"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/thead/tr/th[3]/div/img"); // Because it tends to cause problems, all uses of sleep() must be justified in comments // Sleep should never be used for wait for anything to load from the server // Justification for this instance: FIXME sleep(5); - if ($this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr/td[4]/input[2]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr/td[4]/input[4]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr/td[4]/input[6]") && + if ($this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/input[2]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/input[4]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/input[6]") && //verification for second field first row - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[4]/input[2]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[4]/input[4]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[4]/input[6]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[4]/input[2]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[4]/input[4]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[4]/input[6]") && //verification for first field second row - $this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[3]/input[2]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[3]/input[4]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[3]/input[6]") + $this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[3]/input[2]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[3]/input[4]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[3]/input[6]") ) { $assertCheck = TRUE; } @@ -453,22 +446,22 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->assertTrue($assertCheck, 'copy rows for field one failed for inteview (campaign)'); - $this->click("xpath=//table[@id='voterRecords']/thead/tr/th[4]/div/img"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/thead/tr/th[4]/div/img"); // Because it tends to cause problems, all uses of sleep() must be justified in comments // Sleep should never be used for wait for anything to load from the server // Justification for this instance: FIXME sleep(5); - if ($this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr/td[4]/input[2]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr/td[4]/input[4]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr/td[4]/input[6]") && + if ($this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/input[2]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/input[4]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[4]/input[6]") && //verification for second field first row - $this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[4]/input[2]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[4]/input[4]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[4]/input[6]") && + $this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[4]/input[2]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[4]/input[4]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[4]/input[6]") && //verification for first field second row - $this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[3]/input[2]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[3]/input[4]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[3]/input[6]") + $this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[3]/input[2]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[3]/input[4]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[3]/input[6]") ) { $assertCheck = TRUE; } @@ -478,11 +471,11 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->assertTrue($assertCheck, 'copy rows for field two failed for inteview (campaign)'); - $dateElementIdFirstRow = $this->getAttribute("xpath=//table[@id='voterRecords']/tbody/tr/td[5]/input/@id"); - $dateElementIdSecondRow = $this->getAttribute("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[5]/input/@id"); + $dateElementIdFirstRow = $this->getAttribute("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[5]/input/@id"); + $dateElementIdSecondRow = $this->getAttribute("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[5]/input/@id"); $this->webtestFillDateTime($dateElementIdFirstRow, "+1 week"); - $this->click("xpath=//table[@id='voterRecords']/thead/tr/th[5]/div/img"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/thead/tr/th[5]/div/img"); // Because it tends to cause problems, all uses of sleep() must be justified in comments // Sleep should never be used for wait for anything to load from the server // Justification for this instance: FIXME @@ -497,14 +490,14 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->assertTrue($assertCheck, 'date / time coping failed for inteview (campaign)'); - $this->type("xpath=//table[@id='voterRecords']/tbody/tr/td[@class='note']/input", 'This is Test Introductory Message'); - $this->click("xpath=//table[@id='voterRecords']/thead/tr/th[8]/div/img"); + $this->type("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[@class='note']/input", 'This is Test Introductory Message'); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/thead/tr/th[8]/div/img"); // Because it tends to cause problems, all uses of sleep() must be justified in comments // Sleep should never be used for wait for anything to load from the server // Justification for this instance: FIXME sleep(5); - if ($this->getValue("xpath=//table[@id='voterRecords']/tbody/tr/td[@class='note']/input") == $this->getValue("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[@class='note']/input")) { + if ($this->getValue("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[@class='note']/input") == $this->getValue("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[@class='note']/input")) { $assertCheck = TRUE; } else { @@ -513,28 +506,28 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->assertTrue($assertCheck, 'Note Custom field coping failed'); - $this->click("xpath=//table[@id='voterRecords']/tbody/tr/td[6]/input"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[6]/input"); // selecting second check of profile - $this->click("xpath=//table[@id='voterRecords']/tbody/tr/td[7]/input"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[7]/input"); // clicking copy values to rows of first check and verifying // if other radio Profile Field radio buttons are affected - $this->click("xpath=//table[@id='voterRecords']/thead/tr/th[6]/div/img"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/thead/tr/th[6]/div/img"); // Because it tends to cause problems, all uses of sleep() must be justified in comments // Sleep should never be used for wait for anything to load from the server // Justification for this instance: FIXME sleep(5); - if ($this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr/td[7]/input") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr/td[7]/input[2]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr/td[7]/input[3]") && + if ($this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[7]/input") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[7]/input[2]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[7]/input[3]") && //verification for second field first row - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[7]/input") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[7]/input[2]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[7]/input[3]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[7]/input") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[7]/input[2]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[7]/input[3]") && //verification for first field second row - $this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[6]/input") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[6]/input[2]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[6]/input[3]") + $this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[6]/input") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[6]/input[2]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[6]/input[3]") ) { $assertCheck = TRUE; } @@ -544,22 +537,22 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->assertTrue($assertCheck, 'copy rows for field one failed for inteview (campaign)[radio button]'); - $this->click("xpath=//table[@id='voterRecords']/thead/tr/th[7]/div/img"); + $this->click("xpath=//div[@class='dataTables_wrapper no-footer']/table/thead/tr/th[7]/div/img"); // Because it tends to cause problems, all uses of sleep() must be justified in comments // Sleep should never be used for wait for anything to load from the server // Justification for this instance: FIXME sleep(5); - if ($this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr/td[7]/input") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr/td[7]/input[2]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr/td[7]/input[3]") && + if ($this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[7]/input") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[7]/input[2]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr/td[7]/input[3]") && //verification for second field first row - $this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[7]/input") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[7]/input[2]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[7]/input[3]") && + $this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[7]/input") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[7]/input[2]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[7]/input[3]") && //verification for first field second row - $this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[6]/input") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[6]/input[2]") && - !$this->isChecked("xpath=//table[@id='voterRecords']/tbody/tr[2]/td[6]/input[3]") + $this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[6]/input") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[6]/input[2]") && + !$this->isChecked("xpath=//div[@class='dataTables_wrapper no-footer']/table/tbody/tr[2]/td[6]/input[3]") ) { $assertCheck = TRUE; } @@ -568,6 +561,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { } $this->assertTrue($assertCheck, 'copy rows for field two failed for inteview (campaign)[radio button]'); + $this->clickLink("_qf_Interview_cancel_interview"); //change the editor back to ckeditor $this->openCiviPage('admin/setting/preferences/display', 'reset=1', '_qf_Display_next-bottom'); @@ -592,9 +586,11 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->type('title', $profileTitle); $this->click('_qf_Group_next-bottom'); - $this->waitForElementPresent('_qf_Field_cancel-bottom'); + $this->waitForElementPresent("xpath=//a/span[text()='Add Field']"); $this->waitForText('crm-notification-container', "Your CiviCRM Profile '{$profileTitle}' has been added. You can add fields to this profile now."); + $this->click("xpath=//a/span[text()='Add Field']"); + $this->waitForElementPresent("field_name[0]"); foreach ($customDataArr as $key => $customDataParams) { $this->select('field_name[0]', "label={$profileFor}"); $this->select('field_name[1]', "label={$customDataParams[1]} :: {$customDataParams[0]}"); @@ -603,7 +599,6 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { // Clicking save and new $this->click('_qf_Field_next_new-bottom'); - $this->waitForPageToLoad($this->getTimeoutMsec()); $this->waitForText('crm-notification-container', "Your CiviCRM Profile Field '{$customDataParams[1]}' has been saved to '{$profileTitle}'."); } } @@ -635,12 +630,14 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { } $this->click('_qf_Group_next-bottom'); - $this->waitForElementPresent('_qf_Field_cancel-bottom'); + $this->waitForElementPresent("newCustomField"); //Is custom group created? $this->waitForText('crm-notification-container', "Your custom field set '{$customGroupTitle}' has been added. You can add custom fields now."); //for checkbox 1 + $this->click("newCustomField"); + $this->waitForElementPresent("label"); $checkLabel1 = 'Custom Check One Text_' . substr(sha1(rand()), 0, 4); $this->type('label', $checkLabel1); $this->click('data_type[0]'); @@ -663,16 +660,16 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->type("options_per_line", 2); //clicking save - $this->click('_qf_Field_next'); - $this->waitForPageToLoad($this->getTimeoutMsec()); + $this->click('_qf_Field_done'); + $this->waitForElementPresent("newCustomField"); //Is custom field created $this->waitForText('crm-notification-container', "Custom field '$checkLabel1' has been saved."); $returnArray[1] = array($customGroupTitle, $checkLabel1); - $this->waitForElementPresent("xpath=//*[@id='newCustomField']/span"); + $this->waitForElementPresent('newCustomField'); // create another custom field - Integer Radio - $this->clickLink("xpath=//*[@id='newCustomField']/span", "_qf_Field_cancel-bottom", FALSE); + $this->clickLink('newCustomField', "_qf_Field_cancel-bottom", FALSE); //for checkbox 2 $checkLabel2 = 'Custom Check Two Text_' . substr(sha1(rand()), 0, 4); @@ -694,14 +691,14 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->type('option_value_3', 3); //clicking save - $this->clickLink('_qf_Field_next', "xpath=//*[@id='newCustomField']", FALSE); + $this->clickLink('_qf_Field_done', 'newCustomField', FALSE); //Is custom field created $this->waitForText('crm-notification-container', "Custom field '$checkLabel2' has been saved."); $returnArray[2] = array($customGroupTitle, $checkLabel2); // create another custom field - Integer Radio - $this->clickLink("xpath=//*[@id='newCustomField']/span", "_qf_Field_cancel-bottom", FALSE); + $this->clickLink('newCustomField', "_qf_Field_cancel-bottom", FALSE); // create another custom field - Date $dateFieldLabel = 'Custom Date Field' . substr(sha1(rand()), 0, 4); @@ -721,14 +718,14 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->select('time_format', "value=2"); //clicking save - $this->clickLink('_qf_Field_next', "xpath=//*[@id='newCustomField']", FALSE); + $this->clickLink('_qf_Field_done', 'newCustomField', FALSE); //Is custom field created $this->waitForText('crm-notification-container', "Custom field '$dateFieldLabel' has been saved."); $returnArray[3] = array($customGroupTitle, $dateFieldLabel); // create another custom field - Integer Radio - $this->clickLink("xpath=//*[@id='newCustomField']/span", "_qf_Field_cancel-bottom", FALSE); + $this->clickLink('newCustomField', "_qf_Field_cancel-bottom", FALSE); //create rich text editor field $richTextField = 'Custom Rich TextField_' . substr(sha1(rand()), 0, 4); @@ -738,14 +735,14 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->select('data_type[1]', "label=RichTextEditor"); //clicking save - $this->clickLink('_qf_Field_next', "xpath=//*[@id='newCustomField']", FALSE); + $this->clickLink('_qf_Field_done', 'newCustomField', FALSE); //Is custom field created $this->waitForText('crm-notification-container', "Custom field '$richTextField' has been saved."); $returnArray[4] = array($customGroupTitle, $richTextField); // create another custom field - Integer Radio - $this->clickLink("xpath=//*[@id='newCustomField']/span", "_qf_Field_cancel-bottom", FALSE); + $this->clickLink('newCustomField', "_qf_Field_cancel-bottom", FALSE); //create radio button field //for radio 1 @@ -768,14 +765,14 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->type('option_value_3', 3); //clicking save - $this->clickLink('_qf_Field_next', "xpath=//*[@id='newCustomField']", FALSE); + $this->clickLink('_qf_Field_done', 'newCustomField', FALSE); //Is custom field created $this->waitForText('crm-notification-container', "Custom field '$radioLabel1' has been saved."); $returnArray[5] = array($customGroupTitle, $radioLabel1); // create another custom field - Integer Radio - $this->clickLink("xpath=//*[@id='newCustomField']/span", "_qf_Field_cancel-bottom", FALSE); + $this->clickLink('newCustomField', "_qf_Field_cancel-bottom", FALSE); //for radio 2 $radioLabel2 = 'Custom Radio Two Text_' . substr(sha1(rand()), 0, 4); @@ -797,7 +794,7 @@ class WebTest_Profile_BatchUpdateTest extends CiviSeleniumTestCase { $this->type('option_value_3', 3); //clicking save - $this->clickLink('_qf_Field_next', "xpath=//*[@id='newCustomField']", FALSE); + $this->clickLink('_qf_Field_done', 'newCustomField', FALSE); //Is custom field created $this->waitForText('crm-notification-container', "Custom field '$radioLabel2' has been saved."); -- 2.25.1