Transcript
00:00 So I'm back at this problematic test, and what I want to do to debug it is insert breakpoints after each interaction with the game. So I will add this debugger statement after the first interaction, then the second, and the third. Now since I have this debugger statement, I want my test execution to stop whenever
00:19 it reaches those statements. To make that happen, I need to run my test in a special debug mode. That's where that launch.json configuration comes in. So I go to this Run & Debug panel, select the configuration, Debug Vitas Browser, and click Run. I select the test I want to debug, I just have one here, click OK.
00:39 It will spawn the automation, and you can see, let me clean this up, you can see that the test freezes at this render call over here. This is because we used inspect break flag. So what I can do now is use this control panel here for debugger to help me debug this test. For now, I just wanted to continue to the first breakpoint, and I will click Resume Execution.
00:58 You can see that the code stops at this debugger after this particular action with the game, and I can see the result in the UI. I can continue executing the code, jumping between debuggers, until I reach the third debugger, and here I can see the problem. And if I keep running it after this one, I can see that the test failed now over here.
01:17 Keep in mind that your tests isn't the only place where you can use breakpoints. You can also add them to your code, and this will allow you to see why certain actions are happening, and also stop the time and inspect the state of your UI when they do. Let's explore what else you can do with debugger and breakpoints in the next exercise.