Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require File.expand_path( File.dirname( __FILE__ ) + '/../funfx_helper' )
- require File.expand_path( File.dirname( __FILE__ ) + '/../../spec_helper' )
- require 'rexml/document'
- describe "TestXml" do
- before(:each) do
- create_vanilla_account( { :name => 'foo' } )
- load_application( @browser, 'foo', { :login => "test_user", :password => "password", :role => "super", :state => "boxoffice" } )
- search_customer( "John Doe" )
- select_search_customer( @customer )
- end
- it "should test check_test_xml" do
- check_test_xml "boxoffice",
- {
- "//component[id='orderOriginComboBox']/data_provider/row" => "Boxoffice,boxoffice|Online,online|Phone,phone",
- "//component[id='orderOriginComboBox']/data_provider/row" => /Boxoffice/,
- "//component[id='orderOriginComboBox']/data_provider/row" => [ /Boxoffice/, "online" ],
- "//component[id='_CartCheckout_Label1']/text" => "Change order origin",
- "//component[id='_CartCheckout_Label1']/text" => /order/,
- "//component[id='_CartCheckout_Label1']/text" => [ /order/, /origin/ ],
- "//component[id='cheque_btn']/label" => "Cheque",
- "//component[id='cheque_btn']/label" => /heq/,
- "//component[id='cheque_btn']/label" => [ /^Ch/, /que/ ],
- }
- end
- it "should test check_table_test_xml" do
- check_table_test_xml "boxoffice", "orderOriginComboBox", "Boxoffice,boxoffice|Online,online|Phone,phone"
- check_table_test_xml "boxoffice", "orderOriginComboBox", /Boxoffice/
- check_table_test_xml "boxoffice", "orderOriginComboBox", [ /Boxoffice/, "online" ]
- end
- it "should test check_text_test_xml" do
- check_text_test_xml "boxoffice", "last_name_form", "Doe"
- check_text_test_xml "boxoffice", "last_name_form", /oe/
- check_text_test_xml "boxoffice", "last_name_form", [ /oe/, /^D/ ]
- end
- it "should test check_label_test_xml" do
- check_label_test_xml "boxoffice", "cheque_btn", "Cheque"
- check_label_test_xml "boxoffice", "cheque_btn", /heq/
- check_label_test_xml "boxoffice", "cheque_btn", [ /^Ch/, /que/ ]
- end
- it "should test custom xml" do
- check_test_xml "boxoffice",
- {
- "//customTestXml/custom" => "customer xml test",
- }
- end
- it "should text new approach - optimization" do
- xml = test_xml( "boxoffice" )
- check_test_xml "xml=#{xml}",
- {
- "//component[id='orderOriginComboBox']/data_provider/row" => "Boxoffice,boxoffice|Online,online|Phone,phone",
- }
- check_table_test_xml "xml=#{xml}", "orderOriginComboBox", "Boxoffice,boxoffice|Online,online|Phone,phone"
- check_text_test_xml "xml=#{xml}", "_CartCheckout_Label1", "Change order origin"
- check_label_test_xml "xml=#{xml}", "cheque_btn", "Cheque"
- end
- it "should text new approach - nested" do
- check_test_xml "cart",
- {
- "//component[id='sales_session_cmb']/data_provider/row" => /No session/,
- }
- check_test_xml "boxoffice",
- {
- "//component[id='sales_session_cmb']/data_provider/row" => /No session/,
- }
- end
- end
Add Comment
Please, Sign In to add comment