Beispiel #1
0
        public async Task RunAsync()
        {
            _logger.LogTrace("RunAsync()");

            if (_snapshootOptions.MakeSnapShootEachSeconds > 0)
            {
                if (EnableTask)
                {
                    _seleniumWrapper.EnableTimerSnapShoot(_persistenceManager.BaseFileName, _snapshootOptions.MakeSnapShootEachSeconds * 1000);
                }
                else
                {
                    _seleniumWrapper.DisableTimerSnapShoot();
                }
            }

            await Task.CompletedTask; // fake await since no awaitable action here
        }
Beispiel #2
0
        public void Run()
        {
            _logger.LogTrace("Run()");

            // do the dump requested
            if (_dumpingOptions.DumpBrowserContextOnCrash)
            {
                string fileNameBase = string.Concat(_persistenceManager.BaseFileName, ".", DateTime.Now.ToString("yyyyMMdd-HHmmss")); // no fraction of second, so no conflit with the beginshapshoot task

                _seleniumWrapper.DisableTimerSnapShoot(true);

                // first is screenshot, almost immediat
                _seleniumWrapper.SafeDumpCurrentPng(string.Concat(fileNameBase, ".png"));

                // then is dumping html, it can take a few second
                _seleniumWrapper.SafeDumpCurrentHtml(string.Concat(fileNameBase, ".html"));
            }
            else
            {
                _logger.LogDebug("DumpBrowserContextOnCrash is disabled");
            }
        }