public async Task <WebTestResult> Test(string url) { Uri uri; TestRes = new WebTestResult(); if (!UrlVerify(url, out uri)) { TestRes.Exception = new Exception("Wrong Url"); } else { try { TestRes = await Tester.BeginTest(uri).ConfigureAwait(false); if (Storage != null && TestRes.TestCompletedSuccessfully) { await Storage.SaveChangesAsync().ConfigureAwait(false); } } catch (Exception e) { TestRes.Exception = e; return(TestRes); } Formater.Dispose(); } return(TestRes); }
public async Task <ActionResult> Compute(string url, string connectionId) { var tester = new WPTest(new ClientSideSender(connectionId), _committer); WebTestResult testRes = await tester.Test(url); return(new JsonNetResult(testRes)); }
public void TestGallery() { Uri testUri = _webTest.GetTestUri("/GalleryPluginTests.htm"); WebTestResult chromeResult = _webTest.RunTest(testUri, WebBrowser.Chrome); Assert.IsTrue(chromeResult.Succeeded, "Chrome:\r\n" + chromeResult.Log); }
public void TestMethod1() { Uri pageUri = _webTest.GetTestUri("/DefaultTests.htm"); WebTestResult chromeResult = _webTest.RunTest(pageUri, WebBrowser.Chrome); Assert.IsTrue(chromeResult.Succeeded, "Chrome:\r\n" + chromeResult.Log); }
public void TestMethod1() { WebTestPageBuilder pageBuilder = new WebTestPageBuilder("DefaultTests"); string html = pageBuilder.AddScripts("mscorlib.debug.js", "AroundMe.test.js") .ToHtml(); Uri pageUri = _webTest.CreateContent("/DefaultTests.htm", html, "text/html"); WebTestResult chromeResult = _webTest.RunTest(pageUri, WebBrowser.Chrome); Assert.IsTrue(chromeResult.Succeeded, "Chrome:\r\n" + chromeResult.Log); }
protected void RunTest(string url) { if (_compilationFailures != null) { Assert.Fail("Could not run test due to compilation failure of " + _compilationFailures + "."); return; } Uri testUri = _webTest.GetTestUri(url); WebTestResult result = _webTest.RunTest(testUri, WebBrowser.Chrome); Console.Write(result.Log); Assert.IsTrue(result.Succeeded, "Log:\n" + result.Log); }
public void TestMethod1() { Uri testUri = _webTest.GetTestUri("/Default.htm"); WebTestResult ieResult = _webTest.RunTest(testUri, WebBrowser.InternetExplorer); Assert.IsTrue(ieResult.Succeeded, "Internet Explorer:\r\n" + ieResult.Log); WebTestResult chromeResult = _webTest.RunTest(testUri, WebBrowser.Chrome); Assert.IsTrue(chromeResult.Succeeded, "Chrome:\r\n" + chromeResult.Log); WebTestResult ffResult = _webTest.RunTest(testUri, WebBrowser.Firefox); Assert.IsTrue(ffResult.Succeeded, "Firefox:\r\n" + ffResult.Log); }
public void TestMethod1() { // TestClass1.htm is in the Web directory, and gets deployed along with all // content of the Web directory per the metadata on the class. // You need to edit it to include HTML content and scripts you need to run // the test. Uri testUri = _webTest.GetTestUri("/TestClass1.htm"); // Alternatively you can also use _webTest.CreatePage to register some // content you create dynamically in the test for serving from the web server. WebTestResult ieResult = _webTest.RunTest(testUri, WebBrowser.InternetExplorer); Assert.IsTrue(ieResult.Succeeded, "Internet Explorer:\r\n" + ieResult.Log); WebTestResult chromeResult = _webTest.RunTest(testUri, WebBrowser.Chrome); Assert.IsTrue(chromeResult.Succeeded, "Chrome:\r\n" + chromeResult.Log); WebTestResult ffResult = _webTest.RunTest(testUri, WebBrowser.Firefox); Assert.IsTrue(ffResult.Succeeded, "Firefox:\r\n" + ffResult.Log); }