Skip to content

Commit c75f931

Browse files
committed
Added VSCode debugging setup
1 parent 8127328 commit c75f931

File tree

1 file changed

+41
-53
lines changed

1 file changed

+41
-53
lines changed

SampleApps/WebView2APISample/documentation/Testing-Instructions.md

Lines changed: 41 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -673,59 +673,47 @@ Menu item `Script -> Host Objects` is demonstrated.
673673
674674
#### Script Debugging
675675
676-
##### [VSCode] Single WebView JavaScript Debugging (Old Tool: Debugger For Microsoft Edge)
677-
678-
Test Single WebView JavaScript Debugging with old debugging tool: [Debugger For Microsoft Edge](https://github.com/microsoft/vscode-edge-debug2) in VSCode
679-
680-
1. Open VSCode, go to extension and download the old Edge Script Debugging tool
681-
![step 1](screenshots/old-script-debugging-tool.png)
682-
2. Go to same folder where sample app `WebView2APISample.exe` lives and open file `ScenarioJavaScripDebugIndex.js` from the same folder. Set a breakpoint on `function OnAddClick()`
683-
3. In VSCode, go to Debug tab. On the top drop down, select `Debugger For Microsoft Edge: Sample app (Script $(Configuration)|$(Platform))`. (eg. `Debugger For Microsoft Edge: Sample app (Script Debug|x64)`
684-
4. Then click the green Button (GO) to launch the sample app.
685-
5. VM\* error page may launch, just ignore and click go. (Ignore VM\* file in general and click go at any stage).
686-
6. Go to `Scenario -> Script Debugging -> JavaScript`
687-
7. Expect debugger to hit and pause the page.
688-
689-
##### [VSCode] Single WebView JavaScript Debugging (New Tool: JavaScript Debugger Nightly)
690-
691-
Test Single WebView JavaScript Debugging with new debugging tool: [JavaScript Debugger Nightly](https://github.com/microsoft/vscode-js-debug) in VSCode
692-
693-
1. Open VSCode, go to extension and download the new JavaScript Debugger Nightly tool
694-
![step 1](screenshots/new-script-debugging-tool.png)
695-
2. Go to same folder where sample app `WebView2APISample.exe` lives and open file `ScenarioJavaScripDebugIndex.js` from the same folder. Set a breakpoint on `function OnAddClick()`
696-
3. In VSCode, go to Debug tab. On the top drop down, select `JavaScript Debugger(Nightly): Sample app (Script $(Configuration)|$(Platform))`. (eg. `Debugger For Microsoft Edge: Sample app (Script Debug|x64)`
697-
4. Then click the green Button (GO) to launch the sample app.
698-
5. VM\* error page may launch, just ignore and click go. (Ignore VM\* file in general and click go at any stage).
699-
6. Go to `Scenario -> Script Debugging -> JavaScript`
700-
7. Expect debugger to hit and pause the page.
701-
702-
##### [VSCode] Single WebView TypeScript Debugging (Old Tool: Debugger For Microsoft Edge)
703-
704-
Test Single WebView TypeScript Debugging with old debugging tool: [Debugger For Microsoft Edge](https://github.com/microsoft/vscode-edge-debug2) in VSCode
705-
706-
1. Open VSCode, go to extension and download the old Edge Script Debugging tool
707-
![step 1](screenshots/old-script-debugging-tool.png)
708-
2. Go to same folder where sample app `WebView2APISample.exe` lives and open file `ScenarioTypeScripDebugIndex.ts` from the same folder. Set a breakpoint on `function onHeaderClick()`
709-
3. In VSCode, go to Debug tab. On the top drop down, select `Debugger For Microsoft Edge: Sample app (Script $(Configuration)|$(Platform))`. (eg. `Debugger For Microsoft Edge: Sample app (Script Debug|x64)`
710-
4. Then click the green Button (GO) to launch the sample app.
711-
5. VM\* error page may launch, just ignore and click go. (Ignore VM\* file in general and click go at any stage).
712-
6. Go to `Scenario -> Script Debugging -> TypeScript`
713-
7. Click on `Get Current Page Header` button
714-
8. Expect debugger to hit and pause the page.
715-
716-
##### [VSCode] Single WebView TypeScript Debugging (New Tool: JavaScript Debugger Nightly)
717-
718-
Test Single WebView TypeScript Debugging with new debugging tool: [JavaScript Debugger Nightly](https://github.com/microsoft/vscode-js-debug) in VSCode
719-
720-
1. Open VSCode, go to extension and download the new JavaScript Debugger Nightly tool
721-
![step 1](screenshots/new-script-debugging-tool.png)
722-
2. Go to same folder where sample app `WebView2APISample.exe` lives and open file `ScenarioTypeScripDebugIndex.ts` from the same folder. Set a breakpoint on `function onHeaderClick()`
723-
3. In VSCode, go to Debug tab. On the top drop down, select `JavaScript Debugger(Nightly): Sample app (Script $(Configuration)|$(Platform))`. (eg. `Debugger For Microsoft Edge: Sample app (Script Debug|x64)`
724-
4. Then click the green Button (GO) to launch the sample app.
725-
5. VM\* error page may launch, just ignore and click go. (Ignore VM\* file in general and click go at any stage).
726-
6. Go to `Scenario -> Script Debugging -> TypeScript`
727-
7. Click on `Get Current Page Header` button
728-
8. Expect debugger to hit and pause the page.
676+
##### [VSCode] Debugging Setup
677+
678+
1. Open VSCode, go to `View -> Extensions` and install the two debuggers:
679+
1. [Debugger For Microsoft Edge](https://github.com/microsoft/vscode-edge-debug2)
680+
![old-debugging-tool](screenshots/old-script-debugging-tool.png)
681+
1. [JavaScript Debugger Nightly](https://github.com/microsoft/vscode-js-debug)
682+
![new-debugging-tool](screenshots/new-script-debugging-tool.png)
683+
1. Go to `File -> Open Folder` and open `WebView2APISample/` (where `.vscode/` lives)
684+
1. Open files `ScenarioJavaScripDebugIndex.js` and `ScenarioTypeScripDebugIndex.ts` from the same output folder where `WebView2APISample.exe` lives (e.g. `WebView2APISample/Release/x64/`)
685+
1. Set breakpoints at `function OnAddClick()` in `ScenarioJavaScripDebugIndex.js` and `function OnHeaderClick()` in `ScenarioTypeScripDebugIndex.ts`
686+
1. Go to Debug tab via `View -> Run`
687+
688+
##### [VSCode] Single WebView JavaScript Debugging
689+
690+
Test Single WebView JavaScript Debugging with [Debugger For Microsoft Edge](https://github.com/microsoft/vscode-edge-debug2) and [JavaScript Debugger Nightly](https://github.com/microsoft/vscode-js-debug) in VSCode
691+
692+
1. Follow [Debugging Setup](#[vscode]-debugging-setup)
693+
1. Go to Debug tab via `View -> Run`
694+
1. On the top drop down, select `$(Debugger): Sample app (Script $(Configuration)|$(Platform))`. (e.g. `Debugger For Microsoft Edge: Sample app (Script Debug|x64)` and `JavaScript Debugger(Nightly): Sample app (Script Release|x64)`)
695+
![debugger-dropdown](screenshots/debugger-dropdown.png)
696+
1. Press `F5` or click the green Button (GO) to Start Debugging
697+
1. Expected: sample app is launched
698+
1. VM\* error page may launch, just ignore and click go (Ignore VM\* file in general and click go at any stage)
699+
1. Go to `Scenario -> Script Debugging -> JavaScript`
700+
1. Click `Add a new item`
701+
1. Expect debugger to hit the breakpoint and pause the page
702+
703+
##### [VSCode] Single WebView TypeScript Debugging
704+
705+
Test Single WebView TypeScript Debugging with [Debugger For Microsoft Edge](https://github.com/microsoft/vscode-edge-debug2) and [JavaScript Debugger Nightly](https://github.com/microsoft/vscode-js-debug) in VSCode
706+
707+
1. Follow [Debugging Setup](#[vscode]-debugging-setup)
708+
1. Go to Debug tab via `View -> Run`
709+
1. On the top drop down, select `$(Debugger): Sample app (Script $(Configuration)|$(Platform))`. (e.g. `Debugger For Microsoft Edge: Sample app (Script Debug|x64)` and `JavaScript Debugger(Nightly): Sample app (Script Release|x64)`)
710+
![debugger-dropdown](screenshots/debugger-dropdown.png)
711+
1. Press `F5` or click the green Button (GO) to Start Debugging
712+
1. Expected: sample app is launched
713+
1. VM\* error page may launch, just ignore and click go (Ignore VM\* file in general and click go at any stage)
714+
1. Go to `Scenario -> Script Debugging -> TypeScript`
715+
1. Click `Get the Current Page Header`
716+
1. Expect debugger to hit the breakpoint and pause the page
729717
730718
##### [VSCode] Single WebView JavaScript Debugging Using Attach (Old Tool: Debugger For Microsoft Edge)
731719

0 commit comments

Comments
 (0)