Guest User

Untitled

a guest
May 24th, 2018
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.44 KB | None | 0 0
  1. require File.expand_path( File.dirname( __FILE__ ) + '/../funfx_helper' )
  2. require File.expand_path( File.dirname( __FILE__ ) + '/../../spec_helper' )
  3. require 'rexml/document'
  4.  
  5. describe "TestXml" do
  6.  
  7. before(:each) do
  8. create_vanilla_account( { :name => 'foo' } )
  9.  
  10. load_application( @browser, 'foo', { :login => "test_user", :password => "password", :role => "super", :state => "boxoffice" } )
  11.  
  12. search_customer( "John Doe" )
  13.  
  14. select_search_customer( @customer )
  15. end
  16.  
  17. it "should test check_test_xml" do
  18. check_test_xml "boxoffice",
  19. {
  20. "//component[id='orderOriginComboBox']/data_provider/row" => "Boxoffice,boxoffice|Online,online|Phone,phone",
  21. "//component[id='orderOriginComboBox']/data_provider/row" => /Boxoffice/,
  22. "//component[id='orderOriginComboBox']/data_provider/row" => [ /Boxoffice/, "online" ],
  23.  
  24. "//component[id='_CartCheckout_Label1']/text" => "Change order origin",
  25. "//component[id='_CartCheckout_Label1']/text" => /order/,
  26. "//component[id='_CartCheckout_Label1']/text" => [ /order/, /origin/ ],
  27.  
  28. "//component[id='cheque_btn']/label" => "Cheque",
  29. "//component[id='cheque_btn']/label" => /heq/,
  30. "//component[id='cheque_btn']/label" => [ /^Ch/, /que/ ],
  31. }
  32. end
  33.  
  34. it "should test check_table_test_xml" do
  35. check_table_test_xml "boxoffice", "orderOriginComboBox", "Boxoffice,boxoffice|Online,online|Phone,phone"
  36. check_table_test_xml "boxoffice", "orderOriginComboBox", /Boxoffice/
  37. check_table_test_xml "boxoffice", "orderOriginComboBox", [ /Boxoffice/, "online" ]
  38. end
  39.  
  40. it "should test check_text_test_xml" do
  41. check_text_test_xml "boxoffice", "last_name_form", "Doe"
  42. check_text_test_xml "boxoffice", "last_name_form", /oe/
  43. check_text_test_xml "boxoffice", "last_name_form", [ /oe/, /^D/ ]
  44. end
  45.  
  46. it "should test check_label_test_xml" do
  47. check_label_test_xml "boxoffice", "cheque_btn", "Cheque"
  48. check_label_test_xml "boxoffice", "cheque_btn", /heq/
  49. check_label_test_xml "boxoffice", "cheque_btn", [ /^Ch/, /que/ ]
  50. end
  51.  
  52. it "should test custom xml" do
  53. check_test_xml "boxoffice",
  54. {
  55. "//customTestXml/custom" => "customer xml test",
  56. }
  57. end
  58.  
  59. it "should text new approach - optimization" do
  60. xml = test_xml( "boxoffice" )
  61.  
  62. check_test_xml "xml=#{xml}",
  63. {
  64. "//component[id='orderOriginComboBox']/data_provider/row" => "Boxoffice,boxoffice|Online,online|Phone,phone",
  65. }
  66.  
  67. check_table_test_xml "xml=#{xml}", "orderOriginComboBox", "Boxoffice,boxoffice|Online,online|Phone,phone"
  68.  
  69. check_text_test_xml "xml=#{xml}", "_CartCheckout_Label1", "Change order origin"
  70.  
  71. check_label_test_xml "xml=#{xml}", "cheque_btn", "Cheque"
  72. end
  73.  
  74. it "should text new approach - nested" do
  75. check_test_xml "cart",
  76. {
  77. "//component[id='sales_session_cmb']/data_provider/row" => /No session/,
  78. }
  79. check_test_xml "boxoffice",
  80. {
  81. "//component[id='sales_session_cmb']/data_provider/row" => /No session/,
  82. }
  83. end
  84.  
  85. end
Add Comment
Please, Sign In to add comment