/// <summary> /// Initializes a new instance of the <see cref="TestExecutionRuntime" /> class. /// </summary> /// <param name="driver">The driver.</param> /// <param name="reporter">The reporter.</param> /// <exception cref="ArgumentNullException">driver or reporter</exception> public TestExecutionRuntime( IAutomationDriver driver, IReporter reporter) { _driver = driver ?? throw new ArgumentNullException(nameof(driver)); _reporter = reporter ?? throw new ArgumentNullException(nameof(reporter)); }
public PageSection(IAutomationDriver driver, WebDriverWait wait, IWebPageFactory factory, List <IWebElement> elementsList) { Driver = driver; Wait = wait; Factory = factory; WebElements = elementsList; }
public void SetUp() { Driver = new AutomationDriver(Config, DefaultBrowser); Factory = new WebPageFactory(Driver); var env = Config.ActiveEnvironment; Driver.Navigate().GoToUrl(Config.GetBaseUrl(env)); }
/// <summary> /// Gets the activity. /// </summary> /// <param name="step">The step.</param> /// <returns></returns> /// <exception cref="InvalidOperationException">Do</exception> public static IActivity GetActivity(ITestStep step, IReporter reporter, IAutomationDriver driver) { if (_instance._activities.ContainsKey(step.Do)) { var activityType = _instance._activities[step.Do]; return((IActivity)Activator.CreateInstance(activityType, step, reporter, driver)); } throw new InvalidOperationException($"Invalid activity {nameof(step.Do)}"); }
public void SetupDriver(Browser currentBrowser) { Driver = new AutomationDriver(Config, currentBrowser); Factory = new WebPageFactory(Driver); var env = Config.ActiveEnvironment; var url = Config.GetBaseUrl(env); Driver.Navigate().GoToUrl(url); }
public LoggedOutNavBar(IAutomationDriver driver, WebDriverWait wait, IWebPageFactory factory, List <IWebElement> elementsList) : base(driver, wait, factory, elementsList) { WebElements.AddRange( new List <IWebElement> { GitHubLogo, FeaturesLink, BusinessLink, ExploreLink, MarketplaceLink, PricingLink, SearchTextbox }); }
/// <summary> /// Initializes a new instance of the <see cref="NavigateActivity" /> class. /// </summary> /// <param name="step">The step.</param> /// <param name="reporter">The reporter.</param> /// <param name="driver">The driver.</param> /// <exception cref="System.ArgumentException">Argument</exception> public NavigateActivity(ITestStep step, IReporter reporter, IAutomationDriver driver) : base(step, reporter, driver) { if (!Uri.IsWellFormedUriString(step.Argument, UriKind.Absolute)) { throw new ArgumentException($"{nameof(step.Argument)} is not a valid Uri. A valid absolute Uri must be specified."); } Action = ActivityTypes.Navigate; _argument = step.Argument; _element = step.Element; }
/// <summary> /// Initializes a new instance of the <see cref="BaseActivity" /> class. /// </summary> /// <param name="step">The step.</param> /// <param name="reporter">The reporter.</param> /// <param name="driver">The driver.</param> /// <exception cref="System.ArgumentNullException"> /// reporter or step or SeleniumWebDriver or driver /// </exception> public BaseActivity(ITestStep step, IReporter reporter, IAutomationDriver driver) { Reporter = reporter ?? throw new ArgumentNullException(nameof(reporter)); TestStep = step ?? throw new ArgumentNullException(nameof(step)); Driver = driver ?? throw new ArgumentNullException(nameof(driver)); if (driver.SeleniumWebDriver == null) { throw new ArgumentNullException(nameof(driver.SeleniumWebDriver)); } Result = new ActivityExecutionResult(); }
/// <summary> /// Initializes a new instance of the <see cref="TestExecutionEngine" /> class. /// </summary> /// <param name="testCase">The test case.</param> public TestExecutionEngine( IAutomationDriver driver, IReporter reporter) { _driver = driver ?? throw new ArgumentNullException(nameof(driver)); _reporter = reporter ?? throw new ArgumentNullException(nameof(reporter)); _runtime = new TestExecutionRuntime(_driver, reporter); _testSuites = new List <ITestSuite> { new TestSuite { Name = DEFAULT_SUITE_NAME, TestCases = new List <ITestCase>() } }; }
/// <summary> /// Initializes a new instance of the <see cref="ClickActivity" /> class. /// </summary> /// <param name="step">The step.</param> /// <param name="reporter"></param> /// <param name="driver"></param> /// <exception cref="System.ArgumentNullException">Element</exception> /// <exception cref="System.ArgumentException">Invalid value specified. - ElementLocator</exception> public ClickActivity( ITestStep step, IReporter reporter, IAutomationDriver driver) : base(step, reporter, driver) { if (string.IsNullOrEmpty(step.Element)) { throw new ArgumentNullException(nameof(step.Element)); } if (step.ElementLocator == ElementLocatorMethods.None) { throw new ArgumentException("Invalid value specified.", nameof(step.ElementLocator)); } _element = step.Element; _elementLocator = step.ElementLocator; }
/// <summary> /// Initializes a new instance of the <see cref="SetValueActivity" /> class. /// </summary> /// <param name="step">The step.</param> /// <param name="reporter">The reporter.</param> /// <param name="driver">The driver.</param> /// <exception cref="System.ArgumentNullException">Element or Argument</exception> /// <exception cref="System.InvalidOperationException"></exception> public SetValueActivity(ITestStep step, IReporter reporter, IAutomationDriver driver) : base(step, reporter, driver) { if (string.IsNullOrEmpty(step.Element)) { throw new ArgumentNullException(nameof(step.Element)); } if (step.ElementLocator == ElementLocatorMethods.None) { throw new InvalidOperationException($"Invalid ElementLocator: {step.ElementLocator}"); } if (string.IsNullOrEmpty(step.Argument)) { throw new ArgumentNullException(nameof(step.Argument)); } _element = step.Element; _argument = step.Argument; _elementLocator = step.ElementLocator; }
public WebPageFactory(IAutomationDriver driver) { _driver = driver; }
/// <summary> /// Initializes a new instance of the <see cref="CloseBrowser" /> class. /// </summary> /// <param name="step">The step.</param> /// <param name="reporter">The reporter.</param> /// <param name="driver">The driver.</param> public CloseBrowser(ITestStep step, IReporter reporter, IAutomationDriver driver) : base(step, reporter, driver) { }
public BullBearingsProvider(IAutomationDriver driver, IAutomationSettings settings) { _driver = driver; _settings = settings; }
/// <summary> /// Initializes a new instance of the <see cref="SelectActivity" /> class. /// </summary> /// <param name="step">The step.</param> /// <param name="reporter">The reporter.</param> /// <param name="driver">The driver.</param> public SelectActivity(ITestStep step, IReporter reporter, IAutomationDriver driver) : base(step, reporter, driver) { _step = step; }