webtest fixes
authorjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 12 Mar 2015 13:06:36 +0000 (18:36 +0530)
committerjitendrapurohit <jitendra.purohit@webaccessglobal.com>
Thu, 12 Mar 2015 13:06:36 +0000 (18:36 +0530)
tests/phpunit/WebTest/Contribute/OnlineContributionTest.php
tests/phpunit/WebTest/Contribute/OnlineRecurContributionTest.php
tests/phpunit/WebTest/Event/PricesetMaxCountTest.php

index 037d6cd4109cf22e7c4c5ef7d5e1590b51f68af2..52b56a96f8cc051d5db146b5b9beb2f96d838aaa 100644 (file)
@@ -259,7 +259,7 @@ class WebTest_Contribute_OnlineContributionTest extends CiviSeleniumTestCase {
     //logout
     $this->webtestLogout();
     $amountLabel = 'Total Amount';
-    $amountValue = '1.00';
+    $amountValue = '0.00';
     //Open Live Contribution Page
     $this->openCiviPage("contribute/transact", "reset=1&id=$pageId", "_qf_Main_upload-bottom");
 
index e9e2827dfbff639f0effaf3abbb9ec4f6f04d96d..23ca9642fd9f83606c7f9f0620147da35d954d82 100644 (file)
@@ -112,7 +112,7 @@ class WebTest_Contribute_OnlineRecurContributionTest extends CiviSeleniumTestCas
 
     // Confirmation page
     $this->waitForElementPresent("_qf_Confirm_next-bottom");
-    $text = 'I want to contribute this amount every 1 month(s) for 12 installments.';
+    $text = 'I want to contribute this amount every month for 12 installments.';
     $this->assertTrue($this->isTextPresent($text), 'Missing recurring contribution text (confirmation): ' . $text);
     $text = $rand;
     $this->assertTrue($this->isTextPresent($contributionAmount), 'Missing contribution amount (confirmation): ' . $contributionAmount);
index decb54feec1838dfd02499f83fe62632516e88a7..512e3de4ce7e2854934b3dce623bee4bd4d26036 100644 (file)
@@ -211,11 +211,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // select sold option for select field, check for form rule
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
-    $this->click('_qf_Register_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp1}']", "(Sold out)");
 
     // fill correct available option for select field
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
@@ -410,12 +406,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for sold option for select field
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
-
-    $this->click('_qf_Register_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp1}']", "(Sold out)");
 
     // check for sold option for select field
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
@@ -620,12 +611,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for select
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
-
-    $this->click('_qf_Participant_2_next-Array');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, currently only 2 seats are available for this option.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp2}']", "(Sold out)");
 
     // Skip participant3 and register
     $this->click('_qf_Participant_2_next_skip-Array');
@@ -664,12 +650,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for select field
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
-
-    $this->click('_qf_Register_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp2}']", "(Sold out)");
 
     // fill available value for select
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
@@ -695,12 +676,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for select field
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
-
-    $this->click('_qf_Participant_1_next-Array');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp2}']", "(Sold out)");
 
     // fill available value for select
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
@@ -912,12 +888,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for select
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
-
-    $this->click('_qf_Participant_2_next-Array');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp2}']", "(Sold out)");
 
     // Skip participant3 and register
     $this->click('_qf_Participant_2_next_skip-Array');
@@ -956,12 +927,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for select field
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
-
-    $this->click('_qf_Register_upload-bottom');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp2}']", "(Sold out)");
 
     // fill available value for select
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");
@@ -987,12 +953,7 @@ class WebTest_Event_PricesetMaxCountTest extends CiviSeleniumTestCase {
     $this->type("xpath=//input[@id='price_{$textFieldId}']", '1');
 
     // check for select field
-    $this->select("price_{$selectFieldId}", "value={$selectFieldOp2}");
-
-    $this->click('_qf_Participant_1_next-Array');
-    $this->waitForPageToLoad($this->getTimeoutMsec());
-
-    $this->assertStringsPresent(array('Sorry, this option is currently sold out.'));
+    $this->assertElementContainsText("xpath=//select[@id='price_{$selectFieldId}']//option[@value='crm_disabled_opt-{$selectFieldOp2}']", "(Sold out)");
 
     // fill available value for select
     $this->select("price_{$selectFieldId}", "value={$selectFieldOp1}");