public void Patch_WithNullOptions_ShouldReturnCorrectDriverOptionsType(BrowserType browserType, Type expectedType) { OpenQA.Selenium.DriverOptions options = DriverOptionsHelper.Patch(null, browserType); Assert.IsTrue(options.GetType().Equals(expectedType)); Assert.AreEqual(options.PageLoadStrategy, OpenQA.Selenium.PageLoadStrategy.Normal); Assert.AreEqual(options.UnhandledPromptBehavior, OpenQA.Selenium.UnhandledPromptBehavior.DismissAndNotify); }
public void Patch_WithUnhandledPromptBehaviorDefault_ShouldReturnWithUnhandledPromptBehaviorDismissAndNotify() { OpenQA.Selenium.Chrome.ChromeOptions originalOptions = new OpenQA.Selenium.Chrome.ChromeOptions(); originalOptions.PageLoadStrategy = OpenQA.Selenium.PageLoadStrategy.Normal; OpenQA.Selenium.DriverOptions patchedOptions = DriverOptionsHelper.Patch(originalOptions, BrowserType.Chrome); Assert.AreEqual(OpenQA.Selenium.UnhandledPromptBehavior.DismissAndNotify, patchedOptions.UnhandledPromptBehavior); }
/// <summary> /// Initializes a new instance of the <see cref="SafariDriver"/> class. /// </summary> /// <param name="remoteAddress">The base address for the Agent API (e.g. http://localhost:8585).</param> /// <param name="token">The development token used to communicate with the Agent, see <a href="https://app.testproject.io/#/integrations/sdk">here</a> for more info.</param> /// <param name="safariOptions">See <see cref="SafariOptions"/> for more details.</param> /// <param name="projectName">The project name to report.</param> /// <param name="jobName">The job name to report.</param> /// <param name="disableReports">Set to true to disable all reporting (no report will be created on TestProject).</param> public SafariDriver( Uri remoteAddress = null, string token = null, SafariOptions safariOptions = null, string projectName = null, string jobName = null, bool disableReports = false) : base(remoteAddress, token, DriverOptionsHelper.Patch(safariOptions, BrowserType.Safari), projectName, jobName, disableReports) { }
/// <summary> /// Initializes a new instance of the <see cref="InternetExplorerDriver"/> class. /// </summary> /// <param name="remoteAddress">The base address for the Agent API (e.g. http://localhost:8585).</param> /// <param name="token">The development token used to communicate with the Agent, see <a href="https://app.testproject.io/#/integrations/sdk">here</a> for more info.</param> /// <param name="internetExplorerOptions">See <see cref="InternetExplorerOptions"/> for more details.</param> /// <param name="projectName">The project name to report.</param> /// <param name="jobName">The job name to report.</param> /// <param name="disableReports">Set to true to disable all reporting (no report will be created on TestProject).</param> public InternetExplorerDriver( Uri remoteAddress = null, string token = null, InternetExplorerOptions internetExplorerOptions = null, string projectName = null, string jobName = null, bool disableReports = false) : base(remoteAddress, token, DriverOptionsHelper.Patch(internetExplorerOptions, BrowserType.InternetExplorer), projectName, jobName, disableReports) { }
/// <summary> /// Initializes a new instance of the <see cref="RemoteWebDriver"/> class. /// </summary> /// <param name="remoteAddress">The base address for the Agent API (e.g. http://localhost:8585).</param> /// <param name="token">The development token used to communicate with the Agent, see <a href="https://app.testproject.io/#/integrations/sdk">here</a> for more info.</param> /// <param name="driverOptions">See <see cref="DriverOptions"/> for more details.</param> /// <param name="projectName">The project name to report.</param> /// <param name="jobName">The job name to report.</param> /// <param name="disableReports">Set to true to disable all reporting (no report will be created on TestProject).</param> public RemoteWebDriver( Uri remoteAddress = null, string token = null, DriverOptions driverOptions = null, string projectName = null, string jobName = null, bool disableReports = false) : base(remoteAddress, token, DriverOptionsHelper.Patch(driverOptions, BrowserType.Remote), projectName, jobName, disableReports) { }
/// <summary> /// Initializes a new instance of the <see cref="ChromeDriver"/> class. /// </summary> /// <param name="remoteAddress">The base address for the Agent API (e.g. http://localhost:8585).</param> /// <param name="token">The development token used to communicate with the Agent, see <a href="https://app.testproject.io/#/integrations/sdk">here</a> for more info.</param> /// <param name="chromeOptions">See <see cref="ChromeOptions"/> for more details.</param> /// <param name="projectName">The project name to report.</param> /// <param name="jobName">The job name to report.</param> /// <param name="disableReports">Set to true to disable all reporting (no report will be created on TestProject).</param> public ChromeDriver( Uri remoteAddress = null, string token = null, ChromeOptions chromeOptions = null, string projectName = null, string jobName = null, bool disableReports = false) : base(remoteAddress, token, DriverOptionsHelper.Patch(chromeOptions, BrowserType.Chrome), projectName, jobName, disableReports) { }
public void Patch_WithExistingOptions_ShouldReturnUnchangedOptions() { OpenQA.Selenium.Chrome.ChromeOptions originalOptions = new OpenQA.Selenium.Chrome.ChromeOptions(); originalOptions.PageLoadStrategy = OpenQA.Selenium.PageLoadStrategy.Eager; originalOptions.UnhandledPromptBehavior = OpenQA.Selenium.UnhandledPromptBehavior.AcceptAndNotify; OpenQA.Selenium.DriverOptions patchedOptions = DriverOptionsHelper.Patch(originalOptions, BrowserType.Chrome); Assert.AreEqual(originalOptions, patchedOptions); }
/// <summary> /// Initializes a new instance of the <see cref="FirefoxDriver"/> class. /// </summary> /// <param name="remoteAddress">The base address for the Agent API (e.g. http://localhost:8585).</param> /// <param name="token">The development token used to communicate with the Agent, see <a href="https://app.testproject.io/#/integrations/sdk">here</a> for more info.</param> /// <param name="firefoxOptions">See <see cref="FirefoxOptions"/> for more details.</param> /// <param name="projectName">The project name to report.</param> /// <param name="jobName">The job name to report.</param> /// <param name="disableReports">Set to true to disable all reporting (no report will be created on TestProject).</param> public FirefoxDriver( Uri remoteAddress = null, string token = null, FirefoxOptions firefoxOptions = null, string projectName = null, string jobName = null, bool disableReports = false) : base(remoteAddress, token, DriverOptionsHelper.Patch(firefoxOptions, BrowserType.Firefox), projectName, jobName, disableReports) { }
/// <summary> /// Initializes a new instance of the <see cref="RemoteWebDriver"/> class. /// </summary> /// <param name="remoteAddress">The base address for the Agent API (e.g. http://localhost:8585).</param> /// <param name="token">The development token used to communicate with the Agent, see <a href="https://app.testproject.io/#/integrations/sdk">here</a> for more info.</param> /// <param name="driverOptions">See <see cref="DriverOptions"/> for more details.</param> /// <param name="projectName">The project name to report.</param> /// <param name="jobName">The job name to report.</param> /// <param name="disableReports">Set to true to disable all reporting (no report will be created on TestProject).</param> /// <param name="reportType">The report type of the execution, can be local, cloud or both.</param> /// <param name="reportName">The name of the local generated report.</param> /// <param name="reportPath">The path of the local generated report.</param> public RemoteWebDriver( Uri remoteAddress = null, string token = null, DriverOptions driverOptions = null, string projectName = null, string jobName = null, bool disableReports = false, ReportType reportType = ReportType.CLOUD_AND_LOCAL, string reportName = null, string reportPath = null) : base(remoteAddress, token, DriverOptionsHelper.Patch(driverOptions, BrowserType.Remote), projectName, jobName, disableReports, reportType, reportName, reportPath) { }
/// <summary> /// Initializes a new instance of the <see cref="InternetExplorerDriver"/> class. /// </summary> /// <param name="remoteAddress">The base address for the Agent API (e.g. http://localhost:8585).</param> /// <param name="token">The development token used to communicate with the Agent, see <a href="https://app.testproject.io/#/integrations/sdk">here</a> for more info.</param> /// <param name="internetExplorerOptions">See <see cref="InternetExplorerOptions"/> for more details.</param> /// <param name="projectName">The project name to report.</param> /// <param name="jobName">The job name to report.</param> /// <param name="disableReports">Set to true to disable all reporting (no report will be created on TestProject).</param> /// <param name="reportType">The report type of the execution, can be local, cloud or both.</param> /// <param name="reportName">The name of the local generated report.</param> /// <param name="reportPath">The path of the local generated report.</param> public InternetExplorerDriver( Uri remoteAddress = null, string token = null, InternetExplorerOptions internetExplorerOptions = null, string projectName = null, string jobName = null, bool disableReports = false, ReportType reportType = ReportType.CLOUD_AND_LOCAL, string reportName = null, string reportPath = null) : base(remoteAddress, token, DriverOptionsHelper.Patch(internetExplorerOptions, BrowserType.InternetExplorer), projectName, jobName, disableReports, reportType, reportName, reportPath) { }
/// <summary> /// Initializes a new instance of the <see cref="FirefoxDriver"/> class. /// </summary> /// <param name="remoteAddress">The base address for the Agent API (e.g. http://localhost:8585).</param> /// <param name="token">The development token used to communicate with the Agent, see <a href="https://app.testproject.io/#/integrations/sdk">here</a> for more info.</param> /// <param name="firefoxOptions">See <see cref="FirefoxOptions"/> for more details.</param> /// <param name="projectName">The project name to report.</param> /// <param name="jobName">The job name to report.</param> /// <param name="disableReports">Set to true to disable all reporting (no report will be created on TestProject).</param> /// <param name="reportType">The report type of the execution, can be local, cloud or both.</param> /// <param name="reportName">The name of the local generated report.</param> /// <param name="reportPath">The path of the local generated report.</param> /// <param name="remoteConnectionTimeout">The remote connection timeout to the server. Default is 60 seconds.</param> /// <param name="restClientTimeout"> The connection timeout to the agent in milliseconds. Default is 120 seconds.</param> public FirefoxDriver( Uri remoteAddress = null, string token = null, FirefoxOptions firefoxOptions = null, string projectName = null, string jobName = null, bool disableReports = false, ReportType reportType = ReportType.CLOUD_AND_LOCAL, string reportName = null, string reportPath = null, TimeSpan?remoteConnectionTimeout = null, int restClientTimeout = AgentClient.DefaultRestClientTimeoutInMilliseconds) : base(remoteAddress, token, DriverOptionsHelper.Patch(firefoxOptions, BrowserType.Chrome), projectName, jobName, disableReports, reportType, reportName, reportPath, remoteConnectionTimeout, restClientTimeout) { }