Permalink
Browse files

Fixed an issue where the apt/suite and delivery details were not popu…

…lating the order.
  • Loading branch information...
1 parent 658ba7a commit 861a674f237f0c54f4d914efb85235142c04fa8e @travist committed Sep 4, 2013
Showing with 11 additions and 2 deletions.
  1. +2 −0 config.json
  2. +9 −2 lib/makemeasandwich.js
View
@@ -6,6 +6,8 @@
"city": "Addison",
"state": "Texas",
"zip": "75001",
+ "gate_code": "",
+ "delivery_instructions": "",
"sandwich": "country club",
"who": "Travis",
"bread": "French Bread",
View
@@ -204,14 +204,16 @@ var newDelivery = function(done) {
print('Filling out delivery information.'),
$.go(false, 'visit', 'https://online.jimmyjohns.com/#/deliveryaddress'),
$.go(false, 'waitForElement', '#companyInput'),
- setInput('#companyInput', 'company'),
+ setInput('#companyInput', 'company', true),
setInput('#addressInput', 'address'),
setInput('#aptNoInput', 'apt/suite', true),
setInput('#cityInput', 'city'),
selectVal('#stateSelect', 'state'),
setInput('#zip', 'zip'),
+ sleep(1000),
$('#verifyAddressBtn').go(false, 'click'),
$.go(false, 'waitForElement', '#confirmDeliveryAddressBtn'),
+ sleep(1000),
$('#confirmDeliveryAddressBtn').go(false, 'click'),
$.go(false, 'waitForElement', 'a.menuTab'),
print('Sucessfully filled out delivery information.'),
@@ -407,11 +409,16 @@ var checkout = function(done) {
setInput('#billingZip', 'billing_zip'),
$('a:contains("Review Order")').go(false, 'click'),
$.go(false, 'waitForElement', 'h1:contains("Review & Place Order")'),
+ setInput('#companyInput', 'company', true),
+ setInput('#aptNoInput', 'apt/suite', true),
+ setInput('#gateCode', 'gate_code', true),
+ setInput('#deliveryInstructions', 'delivery_instructions', true),
+ sleep(1000),
print('Placing order...'),
$('a:contains("Place Order")').go(false, 'click'),
$.go(false, 'waitForElement', 'h1:contains("Thank you for your order")'),
$.go('capture', __dirname + '/complete.png'),
- print('Delivery on its way!')
+ print('Delivery on its way! Order details at ' + __dirname + '/complete.png')
], done);
};

0 comments on commit 861a674

Please sign in to comment.