Skip to content

Instantly share code, notes, and snippets.

@patelc75
Created February 25, 2010 00:46
Show Gist options
  • Save patelc75/314087 to your computer and use it in GitHub Desktop.
Save patelc75/314087 to your computer and use it in GitHub Desktop.
Feature: Online (D)irect (T)o (C)ustomer store
In order sell Halo products online to direct customer
As an administrator
I want to provide a public online store to direct customers
Background: # features/online_dtc_store.feature:8
/Users/patelc75/Documents/code/haloror/app/controllers/sessions_controller.rb:47: warning: Object#id will be deprecated; use Object#object_id
Given I am guest # features/step_definitions/general_steps.rb:23
When I go to the online store # features/step_definitions/web_steps.rb:18
Scenario: Same as shipping copies shipping data to billing # features/online_dtc_store.feature:15
When I fill the shipping details # features/step_definitions/store_steps.rb:4
And I fill the credit card details # features/step_definitions/store_steps.rb:4
And I check "Same as shipping" # features/step_definitions/web_steps.rb:110
And I press "Continue" # features/step_definitions/web_steps.rb:22
And I press "Place Order" # features/step_definitions/web_steps.rb:22
Then page content should have "Thank you" # features/step_definitions/general_steps.rb:132
expected the following element's content to include "Thank you":
Halo Monitoring
No response from server. Please refresh this page to try again.
No response from server. Please click this link to restart installation.
Loading... This will take a few seconds
Pick a product
myHalo Complete ($59/mo)
//<![CDATA[
new Form.Element.Observer('product_complete', 1, function(element, value) {toggleProductDetails();})
//]]>
myHalo Clip ($49/mo)
//<![CDATA[
new Form.Element.Observer('product_clip', 1, function(element, value) {toggleProductDetails();})
//]]>
      What's the difference?
Shopping cart itemsPriceDeposit$249.003 months advance ($59 x 3)$177.00Shipping$15.00Total*
$439.00
*Note: Recurring monthly charge of $59.00/mo will begin Monday, May 24, 2010
Shopping cart itemsPriceDeposit$249.003 months advance ($49 x 3)$147.00Shipping$15.00Total*
$409.00
*Note: Recurring monthly charge of $49.00/mo will begin Monday, May 24, 2010
Billing and Shipping
Shipping address
Billing address
Payment method
Also myHalo user
Same as shipping
//<![CDATA[
new Form.Element.EventObserver('order_bill_address_same', function(element, value) {if (document.getElementById('order_bill_address_same').checked) { hideDiv('billing_block'); } else { showDiv('billing_block'); }}, 'click')
//]]>
 
First name, Last name
Shipping address
City
StateAlabamaAlaskaArizonaArkansasCaliforniaColoradoConnecticutDelawareDistrict Of ColumbiaFloridaGeorgiaHawaiiIdahoIllinoisIndianaIowaKansasKentuckyLouisianaMaineMarylandMassachusettsMichiganMinnesotaMississippiMissouriMontanaNebraskaNevadaNew HampshireNew JerseyNew MexicoNew YorkNorth CarolinaNorth DakotaOhioOklahomaOregonPennsylvaniaRhode IslandSouth CarolinaSouth DakotaTennesseeTexasUtahVermontVirginiaWashingtonWest VirginiaWisconsinWyoming
Zip
Phone
Email
First name, Last name
Billing address
City
StateAlabamaAlaskaArizonaArkansasCaliforniaColoradoConnecticutDelawareDistrict Of ColumbiaFloridaGeorgiaHawaiiIdahoIllinoisIndianaIowaKansasKentuckyLouisianaMaineMarylandMassachusettsMichiganMinnesotaMississippiMissouriMontanaNebraskaNevadaNew HampshireNew JerseyNew MexicoNew YorkNorth CarolinaNorth DakotaOhioOklahomaOregonPennsylvaniaRhode IslandSouth CarolinaSouth DakotaTennesseeTexasUtahVermontVirginiaWashingtonWest VirginiaWisconsinWyoming
Zip
Phone
Email
Card number
Expiration (Month/Year)JanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecember20062007200820092010201120122013201420152016
Card TypeVisaMasterCardAmerican ExpressDiscover
CSC (Card Security Code)
Note: The CSC is located on the back of MasterCard, VISA, or Discover cards and is typically a separate group of 3 digits to the right of signature strip. On American Express cards, the CSC is a 4 digit code on the front towards the right.
Comments and special shipping instructions
//
showBillingDetails();
toggleProductDetails();
// billing address bug fix. frequency was not triggering it on back()
//
function showBillingDetails() {
if (document.getElementById('order_bill_address_same').checked) {
hideDiv('billing_block');
} else {
showDiv('billing_block');
}
}
// javasript form validation
//
new Validation('form1', {immediate : true});
// data entry masking
//
MaskInput(document.getElementById("order_card_number"), "9999999999999999");
MaskInput(document.getElementById("order_card_csc"), "9999");
MaskInput(document.getElementById("order_bill_zip"), "999999");
MaskInput(document.getElementById("order_ship_zip"), "999999");
// hide, show elements
//
// function toggleDiv(what)
// {
// found = document.getElementById(what);
// if (found.style.display == "block") {
// found.style.display = "none";
// }
// else {
// found.style.display = "block";
// }
// }
function showDiv(what) {
document.getElementById(what).style.display = "block";
}
function hideDiv(what) {
document.getElementById(what).style.display = "none";
}
function toggleProductDetails() {
if (document.getElementById('product_complete').checked == true) {
showDiv('halo_complete_box');
hideDiv('halo_clip_box');
} else {
hideDiv('halo_complete_box');
showDiv('halo_clip_box');
}
}
© Halo Monitoring |
Terms of Service
|
Privacy Policy
(Spec::Expectations::ExpectationNotMetError)
./features/step_definitions/general_steps.rb:135:in `__instance_exec0'
./features/step_definitions/general_steps.rb:135:in `each'
./features/step_definitions/general_steps.rb:135:in `/^(?:|the )(?:|page )content should have "([^\"]*)"$/'
features/online_dtc_store.feature:21:in `Then page content should have "Thank you"'
Failing Scenarios:
cucumber features/online_dtc_store.feature:15 # Scenario: Same as shipping copies shipping data to billing
1 scenario (1 failed)
8 steps (1 failed, 7 passed)
0m2.345s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment