@@ -17,6 +17,7 @@ describe('Main', () => {
17
17
18
18
describe ( 'Context Menu' , ( ) => {
19
19
const delay200 = ( ) => delay ( 200 ) ;
20
+ const delay500 = ( ) => delay ( 500 ) ;
20
21
it ( 'should show AsyncStorage content as expected' , async ( ) => {
21
22
const { client } = rndebugger ;
22
23
await client . execute ( ( ) => window . invokeDevMethod ( 'showAsyncStorage' ) ) . then ( delay200 ) ;
@@ -26,7 +27,7 @@ describe('Main', () => {
26
27
logs . some ( log => log . message . indexOf ( '[RNDebugger] No AsyncStorage content.' ) > - 1 )
27
28
) . toBeTruthy ( ) ;
28
29
29
- await element ( by . id ( 'navigate-async-storage ' ) )
30
+ await element ( by . id ( 'navigate-context-menu ' ) )
30
31
. tap ( )
31
32
. then ( delay200 ) ;
32
33
@@ -38,6 +39,10 @@ describe('Main', () => {
38
39
it ( 'should clear AsyncStorage as expected' , async ( ) => {
39
40
const { client } = rndebugger ;
40
41
42
+ await element ( by . id ( 'navigate-context-menu' ) )
43
+ . tap ( )
44
+ . then ( delay500 ) ;
45
+
41
46
await client . execute ( ( ) => window . invokeDevMethod ( 'clearAsyncStorage' ) ) . then ( delay200 ) ;
42
47
await client . execute ( ( ) => window . invokeDevMethod ( 'showAsyncStorage' ) ) . then ( delay200 ) ;
43
48
const logs = await client . getRenderProcessLogs ( ) ;
@@ -46,5 +51,27 @@ describe('Main', () => {
46
51
logs . some ( log => log . message . indexOf ( '[RNDebugger] No AsyncStorage content.' ) > - 1 )
47
52
) . toBeTruthy ( ) ;
48
53
} ) ;
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
+ } ) ;
49
76
} ) ;
50
77
} ) ;
0 commit comments