@@ -10,50 +10,56 @@ import {
1010 waitForInterfaceStabilization ,
1111} from 'e2ed/actions' ;
1212
13- test ( 'correctly read data from browser' , { meta : { testId : '14' } } , async ( ) => {
14- await navigateToPage ( E2edReportExample ) ;
15-
16- await createClientFunction ( ( ) => {
17- console . error ( 'error' ) ;
18- console . info ( 'info' ) ;
19- console . log ( 'log' ) ;
20- console . warn ( 'warning' ) ;
21-
22- setTimeout ( ( ) => {
23- throw new Error ( 'foo' ) ;
24- } , 100 ) ;
25- } ) ( ) ;
26-
27- const consoleMessages = getBrowserConsoleMessages ( ) ;
28- const columnNumber = 12 ;
29- const url = '' ;
30-
31- const consoleMessagesWithoutDate = consoleMessages . map (
32- ( { dateTimeInIso : _ , ...messageWithoutDate } ) => messageWithoutDate ,
33- ) ;
34-
35- await expect ( consoleMessagesWithoutDate , 'getBrowserConsoleMessages read all of messages' ) . eql ( [
36- { args : [ 'error' ] , location : { columnNumber, lineNumber : 3 , url} , text : 'error' , type : 'error' } ,
37- { args : [ 'info' ] , location : { columnNumber, lineNumber : 4 , url} , text : 'info' , type : 'info' } ,
38- { args : [ 'log' ] , location : { columnNumber, lineNumber : 5 , url} , text : 'log' , type : 'log' } ,
39- {
40- args : [ 'warning' ] ,
41- location : { columnNumber, lineNumber : 6 , url} ,
42- text : 'warning' ,
43- type : 'warning' ,
44- } ,
45- ] ) ;
46-
47- const jsErrors = getBrowserJsErrors ( ) ;
48-
49- await expect (
50- jsErrors . length ,
51- 'getBrowserJsErrors read zero JS errors when there are no errors' ,
52- ) . eql ( 0 ) ;
53-
54- await waitForInterfaceStabilization ( 100 ) ;
55-
56- await expect ( jsErrors . length , 'getBrowserJsErrors read all JS errors' ) . eql ( 1 ) ;
57-
58- await expect ( String ( jsErrors [ 0 ] ?. error ) , 'getBrowserJsErrors read all JS errors' ) . contains ( 'foo' ) ;
59- } ) ;
13+ test (
14+ 'correctly read data from browser' ,
15+ { meta : { testId : '14' } , viewportHeight : 1200 , viewportWidth : 1600 } ,
16+ async ( ) => {
17+ await navigateToPage ( E2edReportExample ) ;
18+
19+ await createClientFunction ( ( ) => {
20+ console . error ( 'error' ) ;
21+ console . info ( 'info' ) ;
22+ console . log ( 'log' ) ;
23+ console . warn ( 'warning' ) ;
24+
25+ setTimeout ( ( ) => {
26+ throw new Error ( 'foo' ) ;
27+ } , 100 ) ;
28+ } ) ( ) ;
29+
30+ const consoleMessages = getBrowserConsoleMessages ( ) ;
31+ const columnNumber = 12 ;
32+ const url = '' ;
33+
34+ const consoleMessagesWithoutDate = consoleMessages . map (
35+ ( { dateTimeInIso : _ , ...messageWithoutDate } ) => messageWithoutDate ,
36+ ) ;
37+
38+ await expect ( consoleMessagesWithoutDate , 'getBrowserConsoleMessages read all of messages' ) . eql ( [
39+ { args : [ 'error' ] , location : { columnNumber, lineNumber : 3 , url} , text : 'error' , type : 'error' } ,
40+ { args : [ 'info' ] , location : { columnNumber, lineNumber : 4 , url} , text : 'info' , type : 'info' } ,
41+ { args : [ 'log' ] , location : { columnNumber, lineNumber : 5 , url} , text : 'log' , type : 'log' } ,
42+ {
43+ args : [ 'warning' ] ,
44+ location : { columnNumber, lineNumber : 6 , url} ,
45+ text : 'warning' ,
46+ type : 'warning' ,
47+ } ,
48+ ] ) ;
49+
50+ const jsErrors = getBrowserJsErrors ( ) ;
51+
52+ await expect (
53+ jsErrors . length ,
54+ 'getBrowserJsErrors read zero JS errors when there are no errors' ,
55+ ) . eql ( 0 ) ;
56+
57+ await waitForInterfaceStabilization ( 100 ) ;
58+
59+ await expect ( jsErrors . length , 'getBrowserJsErrors read all JS errors' ) . eql ( 1 ) ;
60+
61+ await expect ( String ( jsErrors [ 0 ] ?. error ) , 'getBrowserJsErrors read all JS errors' ) . contains (
62+ 'foo' ,
63+ ) ;
64+ } ,
65+ ) ;
0 commit comments