@@ -19,6 +19,48 @@ const testServer = new officeAddinTestServer.TestServer(port);
1919let testValues : any = [ ] ;
2020
2121describe ( "Test Excel Custom Functions" , function ( ) {
22+ describe ( "Debugger Tests" , function ( ) {
23+ before ( `Setup test environment and sideload ${ host } ` , async function ( ) {
24+ this . timeout ( 0 ) ;
25+ // Call startDebugging to start dev-server and sideload
26+ const devServerCmd : string = `npm run dev-server -- --config ./test/end-to-end/webpack.config.js --env testType=debugger` ;
27+ const devServerPort : number = 3001 ;
28+ const options = {
29+ appType : AppType . Desktop ,
30+ app : toOfficeApp ( host ) ,
31+ devServerCommandLine : devServerCmd ,
32+ devServerPort : devServerPort ,
33+ enableDebugging : true ,
34+ } ;
35+ await startDebugging ( manifestPath , options ) ;
36+ } ) ;
37+ describe ( "Test Debugger" , function ( ) {
38+ let ws : WebSocket ;
39+ before ( "Open websocket connection to Debugger" , async function ( ) {
40+ this . timeout ( 60 * 1000 ) ;
41+ ws = await connectToWebsocket ( ) ;
42+ assert . notStrictEqual ( ws , undefined , "Unable to connect to the websocket." ) ;
43+ } ) ;
44+ it ( "enable debugging" , async function ( ) {
45+ await enableDebugging ( ws ) ;
46+ } ) ;
47+ it ( "pause debugging" , async function ( ) {
48+ await pauseDebugging ( ws ) ;
49+ } ) ;
50+ after ( "Close websocket connection" , async function ( ) {
51+ ws . close ( ) ;
52+ } ) ;
53+ } ) ;
54+ after ( "Teardown test environment" , async function ( ) {
55+ this . timeout ( 0 ) ;
56+ // Close excel
57+ const applicationClosed = await closeDesktopApplication ( ) ;
58+ assert . strictEqual ( applicationClosed , true ) ;
59+
60+ // Unregister the add-in
61+ await stopDebugging ( manifestPath ) ;
62+ } ) ;
63+ } ) ;
2264 describe ( "UI Tests" , function ( ) {
2365 before ( `Setup test environment and sideload ${ host } ` , async function ( ) {
2466 this . timeout ( 0 ) ;
@@ -91,48 +133,6 @@ describe("Test Excel Custom Functions", function () {
91133 const applicationClosed = await closeDesktopApplication ( ) ;
92134 assert . strictEqual ( applicationClosed , true ) ;
93135
94- // Unregister the add-in
95- await stopDebugging ( manifestPath ) ;
96- } ) ;
97- } ) ;
98- describe ( "Debugger Tests" , function ( ) {
99- before ( `Setup test environment and sideload ${ host } ` , async function ( ) {
100- this . timeout ( 0 ) ;
101- // Call startDebugging to start dev-server and sideload
102- const devServerCmd : string = `npm run dev-server -- --config ./test/end-to-end/webpack.config.js --env testType=debugger` ;
103- const devServerPort : number = 3001 ;
104- const options = {
105- appType : AppType . Desktop ,
106- app : toOfficeApp ( host ) ,
107- devServerCommandLine : devServerCmd ,
108- devServerPort : devServerPort ,
109- enableDebugging : true ,
110- } ;
111- await startDebugging ( manifestPath , options ) ;
112- } ) ;
113- describe ( "Test Debugger" , function ( ) {
114- let ws : WebSocket ;
115- before ( "Open websocket connection to Debugger" , async function ( ) {
116- this . timeout ( 60 * 1000 ) ;
117- ws = await connectToWebsocket ( ) ;
118- assert . notStrictEqual ( ws , undefined , "Unable to connect to the websocket." ) ;
119- } ) ;
120- it ( "enable debugging" , async function ( ) {
121- await enableDebugging ( ws ) ;
122- } ) ;
123- it ( "pause debugging" , async function ( ) {
124- await pauseDebugging ( ws ) ;
125- } ) ;
126- after ( "Close websocket connection" , async function ( ) {
127- ws . close ( ) ;
128- } ) ;
129- } ) ;
130- after ( "Teardown test environment" , async function ( ) {
131- this . timeout ( 0 ) ;
132- // Close excel
133- const applicationClosed = await closeDesktopApplication ( ) ;
134- assert . strictEqual ( applicationClosed , true ) ;
135-
136136 // Unregister the add-in
137137 await stopDebugging ( manifestPath ) ;
138138 } ) ;
0 commit comments