@@ -12,55 +12,14 @@ import * as path from "path";
1212/* global process, describe, before, it, after, console */
1313const host : string = "excel" ;
1414const manifestPath = path . resolve ( `${ process . cwd ( ) } /test/end-to-end/test-manifest.xml` ) ;
15+ const manifestPathDebugging = path . resolve ( `${ process . cwd ( ) } /test/end-to-end/test-manifest-debugging.xml` ) ;
1516const port : number = 4201 ;
1617const testDataFile : string = `${ process . cwd ( ) } /test/end-to-end/src/test-data.json` ;
1718const testJsonData = JSON . parse ( fs . readFileSync ( testDataFile ) . toString ( ) ) ;
1819const testServer = new officeAddinTestServer . TestServer ( port ) ;
1920let testValues : any = [ ] ;
2021
2122describe ( "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- } ) ;
6423 describe ( "UI Tests" , function ( ) {
6524 before ( `Setup test environment and sideload ${ host } ` , async function ( ) {
6625 this . timeout ( 0 ) ;
@@ -137,4 +96,46 @@ describe("Test Excel Custom Functions", function () {
13796 await stopDebugging ( manifestPath ) ;
13897 } ) ;
13998 } ) ;
99+ describe ( "Debugger Tests" , function ( ) {
100+ before ( `Setup test environment and sideload ${ host } ` , async function ( ) {
101+ this . timeout ( 0 ) ;
102+ // Call startDebugging to start dev-server and sideload
103+ const devServerCmd : string = `npm run dev-server -- --config ./test/end-to-end/webpack.config.js --env testType=debugger` ;
104+ const devServerPort : number = 3001 ;
105+ const options = {
106+ appType : AppType . Desktop ,
107+ app : toOfficeApp ( host ) ,
108+ devServerCommandLine : devServerCmd ,
109+ devServerPort : devServerPort ,
110+ enableDebugging : true ,
111+ } ;
112+ await startDebugging ( manifestPathDebugging , options ) ;
113+ } ) ;
114+ describe ( "Test Debugger" , function ( ) {
115+ let ws : WebSocket ;
116+ before ( "Open websocket connection to Debugger" , async function ( ) {
117+ this . timeout ( 60 * 1000 ) ;
118+ ws = await connectToWebsocket ( ) ;
119+ assert . notStrictEqual ( ws , undefined , "Unable to connect to the websocket." ) ;
120+ } ) ;
121+ it ( "enable debugging" , async function ( ) {
122+ await enableDebugging ( ws ) ;
123+ } ) ;
124+ it ( "pause debugging" , async function ( ) {
125+ await pauseDebugging ( ws ) ;
126+ } ) ;
127+ after ( "Close websocket connection" , async function ( ) {
128+ ws . close ( ) ;
129+ } ) ;
130+ } ) ;
131+ after ( "Teardown test environment" , async function ( ) {
132+ this . timeout ( 0 ) ;
133+ // Close excel
134+ const applicationClosed = await closeDesktopApplication ( ) ;
135+ assert . strictEqual ( applicationClosed , true ) ;
136+
137+ // Unregister the add-in
138+ await stopDebugging ( manifestPathDebugging ) ;
139+ } ) ;
140+ } ) ;
140141} ) ;
0 commit comments