From e50514984f87d741fa8884143174f03790e9fe2a Mon Sep 17 00:00:00 2001 From: Pratik Joshi Date: Wed, 13 Mar 2013 19:57:48 +0530 Subject: [PATCH] webtest cleanup --- .../WebTest/Financial/FinancialAccountTypeTest.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php b/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php index df08f45b18..90083be3f3 100644 --- a/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php +++ b/tests/phpunit/WebTest/Financial/FinancialAccountTypeTest.php @@ -109,8 +109,10 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase { $this->click('_qf_FinancialTypeAccount_next_new'); $this->waitForPageToLoad($this->getTimeoutMsec()); $text = 'The financial type Account has been saved.'; + $this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text); $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text); $text = 'You can add another Financial Account Type.'; + $this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text); $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text); $accountRelationship = 'Expense Account is'; $expected[] = array( @@ -123,13 +125,13 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase { $this->click('_qf_FinancialTypeAccount_next'); $this->waitForElementPresent( 'newfinancialTypeAccount'); $text = 'The financial type Account has been saved.'; + $this->assertElementContainsText('crm-notification-container', $text, 'Missing text: ' . $text); $this->assertTrue($this->isTextPresent($text), 'Missing text: ' . $text); foreach ($expected as $value => $label) { $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$label[financial_account]']/../td[2]", preg_quote($label['account_relationship'])); } - $this->open($this->sboxPath . 'civicrm/admin/financial/financialType?reset=1'); - $this->waitForElementPresent('newFinancialType'); + $this->openCiviPage('admin/financial/financialType', 'reset=1', 'newFinancialType'); $this->verifyText("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[3]", $financialAccountTitle. ',Banking Fees'); $this->click("xpath=id('ltype')/div/table/tbody/tr/td[1][text()='$financialType[name]']/../td[7]/span/a[text()='Accounts']"); $this->waitForElementPresent('newfinancialTypeAccount'); @@ -147,7 +149,7 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase { $this->waitForElementPresent('_qf_FinancialTypeAccount_next-botttom'); $this->click('_qf_FinancialTypeAccount_next-botttom'); $this->waitForPageToLoad($this->getTimeoutMsec()); - $this->assertTrue($this->isTextPresent('Selected financial type account has been deleted.'), 'Missing text: ' . 'Selected financial type account has been deleted.' ); + $this->assertElementContainsText('crm-notification-container', 'Selected financial type account has been deleted.', 'Missing text: ' . 'Selected financial type account has been deleted.'); //edit financial type $financialType['oldname'] = $financialType['name']; @@ -158,4 +160,4 @@ class WebTest_Financial_FinancialAccountTypeTest extends CiviSeleniumTestCase { //delete financialtype $this->addeditFinancialType($financialType , 'Delete'); } -} +} \ No newline at end of file -- 2.25.1