Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chutzpah Test Runner Context Menu: Modern browser support for debugging #795

Open
Arrowana opened this issue Jan 12, 2021 · 5 comments
Open

Comments

@Arrowana
Copy link

It would be very helpful if it could be configured what browser to use when debugging using Visual Studio context menu "Run Chutzpah with" => "Debugger".

It opens Internet explorer, which is far from being a modern browser resulting and all sorts of missing things. As a result I cannot debug my code directly from visual studio.

The code that seems to be setting up the debugger attached to IE.

public void LaunchTest(TestContext testContext)
{
var file = testContext.TestHarnessPath;
file = urlBuilder.GenerateFileUrl(testContext, file, fullyQualified: true);
// Start IE.
ProcessStartInfo startInfo = new ProcessStartInfo()
{
UseShellExecute = true,
FileName = BrowserPathHelper.GetBrowserPath("ie"),
Arguments = string.Format("-noframemerging -suspended -debug {0}", file)
// -noframemerging
// This is what VS does when launching the script debugger.
// Unsure whether strictly necessary.
// -suspended
// This is what VS does when launching the script debugger.
// Seems to cause IE to suspend all threads which is what we want.
// -debug
// This is what VS does when launching the script debugger.
// Not sure exactly what it does.
};
Process ieMainProcess = Process.Start(startInfo);
// Get child 'tab' process spawned by IE.
// We need to wait a few ms for IE to open the process.
Process ieTabProcess = null;
for (int i = 0;; ++i) {
System.Threading.Thread.Sleep(10);
ieTabProcess = ProcessExtensions.FindFirstChildProcessOf(ieMainProcess.Id);
if (ieTabProcess != null) {
break; }
if (i > 400) { // 400 * 10 = 4s timeout
throw new InvalidOperationException("Timeout waiting for Internet Explorer child process to start."); }
}
// Debug the script in that tab process.
DteHelpers.DebugAttachToProcess(ieTabProcess.Id, "script");
// Resume the threads in the IE process which where started off suspended.
ieTabProcess.Resume();
}

@Mek7
Copy link

Mek7 commented May 5, 2021

I think this is a "must have".
We have set Engine: Chrome in chutzpah.json so we would expect that debugging also uses Chrome. Moreover, if we only mark a single test in Test Explorer in Visual Studio, all tests from the same file are run instead of the single selected one.

@AngelRodriguez8008
Copy link

Same Problem tring to run Jasmine 3.7.1, Code Coverage, still also empty

@AndrewBryanScott
Copy link

We have a similar problem, IE does not support running WebGL and we have tests written to test mapping tool loads, really need to be able to change the browser the tests run in, these tests also fail in the test explorer "Couldn't create WebGL context. Your browser may not support WebGL, or it's turned off,"

@stale
Copy link

stale bot commented Apr 16, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 16, 2022
@Mek7
Copy link

Mek7 commented Apr 16, 2022

Please don't close until a fix is confirmed.
I don't currently have a VS instance with chutzpah for testing at hand.

@stale stale bot removed the wontfix label Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants