@@ -17,6 +17,7 @@ describe('Main', () => {
1717
1818 describe ( 'Context Menu' , ( ) => {
1919 const delay200 = ( ) => delay ( 200 ) ;
20+ const delay500 = ( ) => delay ( 500 ) ;
2021 it ( 'should show AsyncStorage content as expected' , async ( ) => {
2122 const { client } = rndebugger ;
2223 await client . execute ( ( ) => window . invokeDevMethod ( 'showAsyncStorage' ) ) . then ( delay200 ) ;
@@ -26,7 +27,7 @@ describe('Main', () => {
2627 logs . some ( log => log . message . indexOf ( '[RNDebugger] No AsyncStorage content.' ) > - 1 )
2728 ) . toBeTruthy ( ) ;
2829
29- await element ( by . id ( 'navigate-async-storage ' ) )
30+ await element ( by . id ( 'navigate-context-menu ' ) )
3031 . tap ( )
3132 . then ( delay200 ) ;
3233
@@ -38,6 +39,10 @@ describe('Main', () => {
3839 it ( 'should clear AsyncStorage as expected' , async ( ) => {
3940 const { client } = rndebugger ;
4041
42+ await element ( by . id ( 'navigate-context-menu' ) )
43+ . tap ( )
44+ . then ( delay500 ) ;
45+
4146 await client . execute ( ( ) => window . invokeDevMethod ( 'clearAsyncStorage' ) ) . then ( delay200 ) ;
4247 await client . execute ( ( ) => window . invokeDevMethod ( 'showAsyncStorage' ) ) . then ( delay200 ) ;
4348 const logs = await client . getRenderProcessLogs ( ) ;
@@ -46,5 +51,27 @@ describe('Main', () => {
4651 logs . some ( log => log . message . indexOf ( '[RNDebugger] No AsyncStorage content.' ) > - 1 )
4752 ) . toBeTruthy ( ) ;
4853 } ) ;
54+
55+ it ( 'should send Network request as expected if Network Inspsect enabled' , async ( ) => {
56+ const { client } = rndebugger ;
57+
58+ await element ( by . id ( 'navigate-context-menu' ) )
59+ . tap ( )
60+ . then ( delay500 ) ;
61+ await element ( by . id ( 'send-request' ) )
62+ . tap ( )
63+ . then ( delay200 ) ;
64+
65+ await client . execute ( ( ) => window . invokeDevMethod ( 'networkInspect' ) ) . then ( delay200 ) ;
66+ const logs = await client . getRenderProcessLogs ( ) ;
67+ // Print renderer process logs
68+ expect (
69+ logs . some (
70+ log =>
71+ // NOTE: https://github.com/electron/spectron/issues/282
72+ log . message . indexOf ( '[RNDebugger]' ) > - 1
73+ )
74+ ) . toBeTruthy ( ) ;
75+ } ) ;
4976 } ) ;
5077} ) ;
0 commit comments