internal static async Task SetupAsync()
        {
            Server      = SimpleServer.Create(TestConstants.Port, TestUtils.FindParentDirectory("Playwright.Tests.TestServer"));
            HttpsServer = SimpleServer.CreateHttps(TestConstants.HttpsPort, TestUtils.FindParentDirectory("Playwright.Tests.TestServer"));

            var serverStart      = Server.StartAsync();
            var httpsServerStart = HttpsServer.StartAsync();

            await Task.WhenAll(serverStart, httpsServerStart);
        }
Exemplo n.º 2
0
        private async Task SetupAsync()
        {
            var downloaderTask = new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision);

            Server      = SimpleServer.Create(TestConstants.Port, TestUtils.FindParentDirectory("PuppeteerSharp.TestServer"));
            HttpsServer = SimpleServer.CreateHttps(TestConstants.HttpsPort, TestUtils.FindParentDirectory("PuppeteerSharp.TestServer"));

            var serverStart      = Server.StartAsync();
            var httpsServerStart = HttpsServer.StartAsync();

            await Task.WhenAll(downloaderTask, serverStart, httpsServerStart);
        }
        private async Task SetupAsync()
        {
            var downloaderTask = TestConstants.GetNewBrowserType().CreateBrowserFetcher().DownloadAsync();

            Server      = SimpleServer.Create(TestConstants.Port, TestUtils.FindParentDirectory("PlaywrightSharp.TestServer"));
            HttpsServer = SimpleServer.CreateHttps(TestConstants.HttpsPort, TestUtils.FindParentDirectory("PlaywrightSharp.TestServer"));

            var serverStart      = Server.StartAsync();
            var httpsServerStart = HttpsServer.StartAsync();

            await Task.WhenAll(downloaderTask, serverStart, httpsServerStart);
        }
        internal static async Task SetupAsync()
        {
            var downloaderTask = PlaywrightSharp.Playwright.InstallAsync();

            Server      = SimpleServer.Create(TestConstants.Port, TestUtils.FindParentDirectory("PlaywrightSharp.TestServer"));
            HttpsServer = SimpleServer.CreateHttps(TestConstants.HttpsPort, TestUtils.FindParentDirectory("PlaywrightSharp.TestServer"));

            var serverStart      = Server.StartAsync();
            var httpsServerStart = HttpsServer.StartAsync();

            await Task.WhenAll(downloaderTask, serverStart, httpsServerStart);
        }
Exemplo n.º 5
0
        private async Task SetupAsync()
        {
            using var browserFetcher = new BrowserFetcher(TestConstants.IsChrome ? Product.Chrome : Product.Firefox);
            var downloaderTask = browserFetcher.DownloadAsync();

            Server      = SimpleServer.Create(TestConstants.Port, TestUtils.FindParentDirectory("PuppeteerSharp.TestServer"));
            HttpsServer = SimpleServer.CreateHttps(TestConstants.HttpsPort, TestUtils.FindParentDirectory("PuppeteerSharp.TestServer"));

            var serverStart      = Server.StartAsync();
            var httpsServerStart = HttpsServer.StartAsync();

            await Task.WhenAll(downloaderTask, serverStart, httpsServerStart);
        }
Exemplo n.º 6
0
        public static Task <HttpService> Register(WorkerAwareTest test)
        {
            var workerIndex = test.WorkerIndex;

            return(test.RegisterService("Http", async() =>
            {
                var http = new HttpService
                {
                    Server = SimpleServer.Create(8907 + workerIndex * 2, TestUtils.FindParentDirectory("Playwright.Tests.TestServer")),
                    HttpsServer = SimpleServer.CreateHttps(8907 + workerIndex * 2 + 1, TestUtils.FindParentDirectory("Playwright.Tests.TestServer"))
                };
                await Task.WhenAll(http.Server.StartAsync(), http.HttpsServer.StartAsync());
                return http;
            }));
        }
        internal static async Task SetupAsync()
        {
            /*
             * var browserFetcher = TestConstants.GetNewBrowserType().CreateBrowserFetcher();
             * int percentage = 0;
             * browserFetcher.DownloadProgressChanged += (sender, e) =>
             * {
             *  if (percentage != e.ProgressPercentage)
             *  {
             *      percentage = e.ProgressPercentage;
             *      Console.WriteLine($"[{TestConstants.Product}] downloading browser {percentage}%");
             *  }
             * };
             * Console.WriteLine($"Downloading browser...");
             * var downloaderTask = browserFetcher.DownloadAsync();
             */
            Server      = SimpleServer.Create(TestConstants.Port, TestUtils.FindParentDirectory("PlaywrightSharp.TestServer"));
            HttpsServer = SimpleServer.CreateHttps(TestConstants.HttpsPort, TestUtils.FindParentDirectory("PlaywrightSharp.TestServer"));

            var serverStart      = Server.StartAsync();
            var httpsServerStart = HttpsServer.StartAsync();

            await Task.WhenAll(/*downloaderTask, */ serverStart, httpsServerStart);
        }