Guest User

Untitled

a guest
Jun 10th, 2018
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. it "should load all bookings for event" do
  2. check_number_of_rows( 'bookings', 2 )
  3. check_row( 'bookings', 0, [@bookings[0].checkin_code,'2','0', 'John Doe', 'jdoe@email.com', '12345', '/images/done.png', '2,checkin'] )
  4. check_row( 'bookings', 1, [@bookings[1].checkin_code,'1','0', 'John Doe', 'jdoe@email.com', '12345', '/images/done.png', '1,checkin'] )
  5. end
  6.  
  7. it "should checkin quantity of 1 on first booking from datagrid form" do
  8. @browser.text_input({:id => 'quantity_form', :automationName => 'booking_checkin_quantity_1'}).input('1')
  9. @browser.button({:id => 'booking_checkin_button', :automationName => 'booking_checkin_button_1'}).click and wait_for_application_to_complete_request
  10. flash_message.should eql(@bookings[0].checkin_code+' - checked in OK (1 remaining)')
  11. check_row( 'bookings', 0, [@bookings[0].checkin_code,'2','1', 'John Doe', 'jdoe@email.com', '12345', '/images/done.png', '1,checkin'] )
  12. end
  13.  
  14. it "should checkin qunatity of 1 on frist booking from checkin code form" do
  15. @browser.text_input({:id => 'checkin_code_form', :automationName => 'checkin_code_form'}).input(@bookings[0].checkin_code)
  16. @browser.button({:id => 'checkin_button', :automationName => 'checkin_button'}).click and wait_for_application_to_complete_request
  17.  
  18. flash_message.should eql(@bookings[0].checkin_code+' - checked in OK (1 remaining)')
  19. check_row( 'bookings', 0, [@bookings[0].checkin_code,'2','1', 'John Doe', 'jdoe@email.com', '12345', '/images/done.png', '1,checkin'] )
  20. @browser.text_input({:id => 'checkin_code_form', :automationName => 'checkin_code_form'}).text.should eql('')
  21. end
  22.  
  23. it "should not allow checkin more than booking quantity" do
  24. @browser.text_input({:id => 'quantity_form', :automationName => 'booking_checkin_quantity_1'}).input('3')
  25. @browser.button({:id => 'booking_checkin_button', :automationName => 'booking_checkin_button_1'}).click and wait_for_application_to_complete_request
  26. flash_message.should eql(@bookings[0].checkin_code+' - ALL 2 checked in OK')
  27. check_row( 'bookings', 0, [@bookings[0].checkin_code,'2','2', 'John Doe', 'jdoe@email.com', '12345', '/images/done.png', '0,checkin'] )
  28.  
  29. @browser.text_input({:id => 'checkin_code_form', :automationName => 'checkin_code_form'}).input(@bookings[0].checkin_code)
  30. @browser.button({:id => 'checkin_button', :automationName => 'checkin_button'}).click and wait_for_application_to_complete_request
  31. flash_message.should eql('application errors code: ' + @bookings[0].checkin_code + ' already checked in')
  32. end
  33.  
  34. it "should require a checkin code to be valid" do
  35. @browser.button({:id => 'checkin_button', :automationName => 'checkin_button'}).click and wait_for_application_to_complete_request
  36. flash_message.should eql('please enter a valid checkin code!')
  37.  
  38. @browser.text_input({:id => 'checkin_code_form', :automationName => 'checkin_code_form'}).input('12345')
  39. @browser.button({:id => 'checkin_button', :automationName => 'checkin_button'}).click and wait_for_application_to_complete_request
  40. flash_message.should eql('please enter a valid checkin code!')
  41. end
Add Comment
Please, Sign In to add comment