On exception when calling JS from .NET, return JS stack trace to .NET invoker

This commit is contained in:
Steve Sanderson 2017-12-15 11:05:28 +00:00
parent 6eede7b109
commit 67f7559950
1 changed files with 3 additions and 1 deletions

View File

@ -4,7 +4,6 @@
using Microsoft.Blazor.E2ETest.Infrastructure;
using Microsoft.Blazor.E2ETest.Infrastructure.ServerFixtures;
using OpenQA.Selenium;
using System;
using Xunit;
namespace Microsoft.Blazor.E2ETest.Tests
@ -77,6 +76,9 @@ namespace Microsoft.Blazor.E2ETest.Tests
Browser.FindElement(By.CssSelector("#callJs button")).Click();
var result = GetValue(Browser, "callJsResult");
Assert.StartsWith(".NET got exception: Error: This is a JavaScript exception.", result);
// Also verify we got a stack trace
Assert.Contains("at triggerJsException", result);
}
private static string GetValue(IWebDriver webDriver, string elementId)