svirgibs

New.ApplicationManager

Jan 18th, 2021 (edited)
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.61 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using NUnit.Framework;
  6. using OpenQA.Selenium;
  7. using OpenQA.Selenium.Firefox;
  8. using OpenQA.Selenium.Support.UI;
  9.  
  10. namespace WebAddressbookTests
  11. {
  12.     public class ApplicationManager
  13.     {
  14.         protected IWebDriver driver;
  15.         protected string baseURL;
  16.  
  17.         protected LoginHelper loginHelper;
  18.         protected NavigationHelper navigator;
  19.         protected GroupHelper groupHelper;
  20.  
  21.         public ApplicationManager()
  22.         {
  23.             driver = new FirefoxDriver();
  24.             baseURL = "http://localhost";
  25.  
  26.             loginHelper = new LoginHelper(this);
  27.             navigator = new NavigationHelper(this, baseURL);
  28.             groupHelper = new GroupHelper(this);
  29.         }
  30.  
  31.         public IWebDriver Driver
  32.         {
  33.             get
  34.             {
  35.                 return driver;
  36.             }
  37.         }
  38.  
  39.         public void Stop()
  40.         {
  41.             try
  42.             {
  43.                 driver.Quit();
  44.             }
  45.             catch (Exception)
  46.             {
  47.                 // Ignore errors if unable to close the browser
  48.             }
  49.         }
  50.  
  51.         public LoginHelper Auth
  52.         {
  53.             get
  54.             {
  55.                 return loginHelper;
  56.             }
  57.         }
  58.  
  59.         public NavigationHelper Navigator
  60.         {
  61.             get
  62.             {
  63.                 return navigator;
  64.             }
  65.         }
  66.  
  67.         public GroupHelper Groups
  68.         {
  69.             get
  70.             {
  71.                 return groupHelper;
  72.             }
  73.         }
  74.  
  75.  
  76.     }
  77. }
  78.  
Add Comment
Please, Sign In to add comment