"Fossies" - the Fresh Open Source Software Archive

Member "selenium-selenium-4.8.1/dotnet/test/common/DevTools/DevToolsTestFixture.cs" (17 Feb 2023, 1170 Bytes) of package /linux/www/selenium-selenium-4.8.1.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C# source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 using NUnit.Framework;
    2 using OpenQA.Selenium.Environment;
    3 using System;
    4 using System.Collections.Generic;
    5 using System.Linq;
    6 using System.Text;
    7 using System.Threading.Tasks;
    8 
    9 namespace OpenQA.Selenium.DevTools
   10 {
   11     public class DevToolsTestFixture : DriverTestFixture
   12     {
   13         protected IDevTools devTools;
   14         protected IDevToolsSession session;
   15 
   16         public bool IsDevToolsSupported
   17         {
   18             get { return devTools != null; }
   19         }
   20 
   21         [SetUp]
   22         public void Setup()
   23         {
   24             driver = EnvironmentManager.Instance.GetCurrentDriver();
   25             devTools = driver as IDevTools;
   26             if (devTools == null)
   27             {
   28                 Assert.Ignore("{0} does not support Chrome DevTools Protocol", EnvironmentManager.Instance.Browser);
   29                 return;
   30             }
   31 
   32             session = devTools.GetDevToolsSession();
   33         }
   34 
   35         [TearDown]
   36         public void Teardown()
   37         {
   38             if (session != null)
   39             {
   40                 session.Dispose();
   41                 EnvironmentManager.Instance.CloseCurrentDriver();
   42                 driver = null;
   43             }
   44         }
   45     }
   46 }