Just one idea I came up with. I used Hash and Class object instead of 2D array foo. Csv 209,global,text.
Catalogue,2010 EI-176 392,global,numeric,Numéro d'ordre,2 require 'csv' expected_datas = CSV. Readlines('foo. Csv').
Map do |row| { :id => row0, :scope => row1, :type => row2, :name => row3, :value => row4 } end class Data attr_reader :id,:scope,:type,:name,:value def initialize(tr) id = tr.id. Slice(/attr-row-(0-9+)/,1) scope = tr. Td(:id,/scope/).img.src.
Slice(/attr_bullet_(.+? ). Png/,1) type = tr.Td(:id,/type/).img.src.
Slice(/attrib_(.+? ). Png/,1) name = tr.
Td(:id,/name/). Text value = tr.Td(:id,/value/). Text end end browser = Watir::Browser.
New browser. Goto 'foobar' datas = browser. Table(:id,'attr-table').tbody.trs.
Map{|tr| Data. New(tr)} datas. Zip(expected_datas).
Each do |data,expected_data| Data. Instance_methods(false). Each do |method| data.
Send(method). Should == expected_datamethod. To_sym end end # something action (refresh or redraw action) browser.
Refresh after_datas = browser. Table(:id,'attr-table').tbody.trs. Map{|tr| Data.
New(tr)} datas. Zip(after_datas). Each do |data,after_data| Data.
Instance_methods(false). Each do |method| data. Send(method).
Should == after_data. Send(method) end end.
Just one idea I came up with. I used Hash and Class object instead of 2D array. Foo.
Csv 209,global,text. Catalogue,2010 EI-176 392,global,numeric,Numéro d'ordre,2 require 'csv' expected_datas = CSV. Readlines('foo.
Csv'). Map do |row| { :id => row0, :scope => row1, :type => row2, :name => row3, :value => row4 } end class Data attr_reader :id,:scope,:type,:name,:value def initialize(tr) id = tr.id. Slice(/attr-row-(0-9+)/,1) scope = tr.Td(:id,/scope/).img.src.
Slice(/attr_bullet_(.+? ). Png/,1) type = tr.
Td(:id,/type/).img.src. Slice(/attrib_(.+?). Png/,1) name = tr.
Td(:id,/name/). Text value = tr. Td(:id,/value/).
Text end end browser = Watir::Browser. New browser. Goto 'foobar' datas = browser.
Table(:id,'attr-table').tbody.trs. Map{|tr| Data. New(tr)} datas.
Zip(expected_datas). Each do |data,expected_data| Data. Instance_methods(false).
Each do |method| data. Send(method). Should == expected_datamethod.
To_sym end end # something action (refresh or redraw action) browser. Refresh after_datas = browser. Table(:id,'attr-table').tbody.trs.
Map{|tr| Data. New(tr)} datas. Zip(after_datas).
Each do |data,after_data| Data. Instance_methods(false). Each do |method| data.
Send(method). Should == after_data. Send(method) end end.
I think that might well define the approach you want to take. For example if you just want to know if there's a mismatch, and don't care where, then comparing arrays might be easiest. If the order of the rows could vary, then I think comparing Hashes might be best If you want each mismatch reported individually then iterating by row and column would allow you to report discrete errors, especially if you build a list of differences and then do your assert at the very end based on number of differences found.
You could go for exact match before_htmltable after_htmltable Or you could strip whitespace before_htmltable. Gsub(/\s+/, ' ') after_htmltable. Gsub(/\s+/, ' ') I would think that creating the array then comparing each element would be more expensive.Dave.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.