File tree Expand file tree Collapse file tree 1 file changed +7
-13
lines changed
rb/spec/integration/selenium/webdriver Expand file tree Collapse file tree 1 file changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -100,26 +100,20 @@ module WebDriver
100100
101101 it 'notifies about log messages' do
102102 logs = [ ]
103- driver . on_log_event ( :console ) { |log | logs . push ( log ) }
103+ driver . on_log_event ( :console ) { |log | logs . push ( log . args [ 0 ] ) }
104104 driver . navigate . to url_for ( 'javascriptPage.html' )
105105
106- driver . execute_script ( "console.log('I like cheese');" )
107- sleep 0.5
108106 driver . execute_script ( 'console.log(true);' )
109- sleep 0.5
110107 driver . execute_script ( 'console.log(null);' )
111- sleep 0.5
112108 driver . execute_script ( 'console.log(undefined);' )
113- sleep 0.5
114109 driver . execute_script ( 'console.log(document);' )
115- sleep 0.5
110+ driver . execute_script ( "console.log('I like cheese');" )
116111
117- expect ( logs ) . to include (
118- an_object_having_attributes ( type : :log , args : [ 'I like cheese' ] ) ,
119- an_object_having_attributes ( type : :log , args : [ true ] ) ,
120- an_object_having_attributes ( type : :log , args : [ nil ] ) ,
121- an_object_having_attributes ( type : :log , args : [ { 'type' => 'undefined' } ] )
122- )
112+ wait . until { logs . include? ( 'I like cheese' ) }
113+
114+ expect ( logs ) . to include ( true )
115+ expect ( logs ) . to include ( nil )
116+ expect ( logs ) . to include ( { 'type' => 'undefined' } )
123117 end
124118
125119 it 'notifies about document log messages' do
You can’t perform that action at this time.
0 commit comments