public async Task AutoSetUpAsync(string browserName)
        {
            var result = await DriverSetup.AutoSetUpAsync(browserName);

            AssertDriverIsSetUp(result, browserName);
            AssertVersionCache(browserName);
        }
        public void TestInitialize()
        {
            DriverSetup driverSetup = new DriverSetup();

            driver            = driverSetup.getDriver();
            MyScoreSoccerPage = new MyScoreSoccerPage(driver);
        }
        public void AutoSetUpAsync_ThrowsArgumentException(string[] browserNames)
        {
            var exception = Assert.ThrowsAsync <ArgumentException>(() =>
                                                                   DriverSetup.AutoSetUpAsync(browserNames));

            exception.Message.Should().ContainEquivalentOf("unsupported");
        }
        public void AutoSetUp(string browserName)
        {
            var result = DriverSetup.AutoSetUp(browserName);

            AssertDriverIsSetUp(result, browserName);
            AssertVersionCache(browserName);
        }
 public void Setup()
 {
     Driver = DriverSetup.GetDriver(Browsers.Chrome);
     Driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(Constants.DEFAULT_IMPWAIT_TIMEOUT);
     Driver.Manage().Cookies.DeleteAllCookies();
     Driver.Manage().Window.Maximize();
 }
Exemple #6
0
        public void SetUp_WithVersion(string browserName, string version)
        {
            var result = DriverSetup.Configure(browserName)
                         .WithVersion(version)
                         .SetUp();

            AssertDriverIsSetUp(result, browserName, version);
        }
Exemple #7
0
        public void SetUp_ByBrowserVersion_Unsupported(string browserName, string version)
        {
            var builder = DriverSetup.Configure(browserName)
                          .ByBrowserVersion(version);

            Assert.Throws <DriverSetupException>(() =>
                                                 builder.SetUp());
        }
        public void GlobalSetUp()
        {
            AtataContext.GlobalConfiguration.ApplyJsonConfig();

            DriverSetup.GetDefaultConfiguration(BrowserNames.InternetExplorer)
            .WithX32Architecture();

            AtataContext.GlobalConfiguration.AutoSetUpConfiguredDrivers();
        }
Exemple #9
0
        public void SetUp_WithLatestVersion(string browserName)
        {
            var result = DriverSetup.Configure(browserName)
                         .WithLatestVersion()
                         .SetUp();

            AssertDriverIsSetUp(result, browserName);
            AssertVersionCache(browserName);
        }
        public async Task SetUpAsync_DifferentBrowsers_InParallel()
        {
            var results = await Task.WhenAll(
                DriverSetup.ConfigureChrome().SetUpAsync(),
                DriverSetup.ConfigureFirefox().SetUpAsync(),
                DriverSetup.ConfigureEdge().SetUpAsync());

            AssertAutoSetUpDriverResults(results, new[] { BrowserNames.Chrome, BrowserNames.Firefox, BrowserNames.Edge });
        }
Exemple #11
0
        public void SetUp()
        {
            DriverJsonMapperAliases.Register <RemoteDriverJsonMapperOverride>(DriverAliases.Remote);
            DriverJsonMapperAliases.Register <ChromeDriverJsonMapperOverride>(DriverAliases.Chrome);
            DriverJsonMapperAliases.Register <FirefoxDriverJsonMapperOverride>(DriverAliases.Firefox);
            DriverJsonMapperAliases.Register <InternetExplorerDriverJsonMapperOverride>(DriverAliases.InternetExplorer);
            DriverJsonMapperAliases.Register <EdgeDriverJsonMapperOverride>(DriverAliases.Edge);

            DriverSetup.AutoSetUp(BrowserNames.Chrome, BrowserNames.Firefox, BrowserNames.Edge, BrowserNames.InternetExplorer);
        }
Exemple #12
0
        public void SetUp_WithAutoVersion_WithX32Architecture(string browserName)
        {
            var result = DriverSetup.Configure(browserName)
                         .WithAutoVersion()
                         .WithX32Architecture()
                         .SetUp();

            AssertDriverIsSetUp(result, browserName, architecture: Architecture.X32);
            AssertVersionCache(browserName);
        }
        public async Task SetUpAsync_SameBrowsers_WithMutex_InParallel()
        {
            var results = await Task.WhenAll(
                DriverSetup.ConfigureChrome().WithMutex(true).SetUpAsync(),
                DriverSetup.ConfigureChrome().WithMutex(true).SetUpAsync(),
                DriverSetup.ConfigureChrome().WithMutex(true).SetUpAsync());

            results.Should().HaveCount(3);
            results[0].Should().BeEquivalentTo(results[1]).And.BeEquivalentTo(results[2]);
            AssertDriverIsSetUp(results[0], BrowserNames.Chrome);
            AssertVersionCache(BrowserNames.Chrome);
        }
Exemple #14
0
        public void GlobalSetUp()
        {
            string driverAlias = TestContext.Parameters.Get("DriverAlias", DriverAliases.Chrome);

            AtataContext.GlobalConfiguration
            .ApplyJsonConfig()
            .UseDriver(driverAlias);

            DriverSetup.GetDefaultConfiguration(BrowserNames.InternetExplorer)
            .WithX32Architecture();

            AtataContext.GlobalConfiguration.AutoSetUpDriverToUse();
        }
        public void GlobalSetUp()
        {
            try
            {
                PingTestApp();
            }
            catch (WebException)
            {
                RunTestApp();
            }

            DriverSetup.AutoSetUp(BrowserNames.Chrome);
        }
        public void GlobalSetUp()
        {
            RetrySettings.ThreadBoundary = RetrySettingsThreadBoundary.AsyncLocal;

            try
            {
                PingTestApp();
            }
            catch (WebException)
            {
                RunTestApp();
            }

            DriverSetup.AutoSetUp(BrowserNames.Chrome);
        }
Exemple #17
0
        public DynamicFormTest(ITestOutputHelper output)
        {
            DriverSetup.AutoSetUp(BrowserNames.Chrome);

            AtataContext.Configure()
            .UseChrome()
            .AddLogConsumer(new XUnitLogConsumer(output))
            .WithMinLevel(LogLevel.Trace)
            .AddScreenshotFileSaving()
            .Build();

            ValueRandomizer.RegisterRandomizer <DateTime>((meta) =>
            {
                return(DateTime.Now.AddDays(0 - Randomizer.GetInt(0, 10000)));
            });
        }
Exemple #18
0
        public void GlobalSetUp()
        {
            AtataContext.GlobalConfiguration
            .UseDriver(() =>
            {
                EdgeOptions options = new EdgeOptions
                {
                    UseChromium = true
                };

                options.AddArguments("headless", "disable-gpu", "window-size=1024,768");

                return(new EdgeDriver(options));
            })
            .UseBaseUrl("https://demo.atata.io/")
            .UseCulture("en-US")
            .UseAllNUnitFeatures();

            DriverSetup.AutoSetUp(BrowserNames.Edge);
        }
Exemple #19
0
        public void GlobalSetUp()
        {
            AtataContext.GlobalConfiguration
            .UseChrome()
            .WithArguments("start-maximized")
            .UseEdge()

            // TODO: You can also specify remote driver configuration(s):
            // .UseRemoteDriver()
            // .WithAlias("chrome_remote")
            // .WithRemoteAddress("http://127.0.0.1:4444/wd/hub")
            // .WithOptions(new ChromeOptions())
            .UseBaseUrl("https://demo.atata.io/")
            .UseCulture("en-US")
            .UseAllNUnitFeatures();

            DriverSetup.GetDefaultConfiguration(BrowserNames.InternetExplorer)
            .WithX32Architecture();

            AtataContext.GlobalConfiguration.AutoSetUpConfiguredDrivers();
        }
Exemple #20
0
        public void GlobalSetUp()
        {
            AtataContext.GlobalConfiguration
            .UseChrome()
            .WithArguments("start-maximized")
            .UseInternetExplorer()
            // TODO: Specify Internet Explorer settings, like:
            // WithOptions(x => x.EnableNativeEvents = true).
            //.UseFirefox().
            //    WithFixOfCommandExecutionDelay()
            // TODO: You can also specify remote driver configuration(s):
            // UseRemoteDriver().
            // WithAlias("chrome_remote").
            // WithRemoteAddress("http://127.0.0.1:4444/wd/hub").
            // WithOptions(new ChromeOptions()).
            .UseBaseUrl("https://demo.atata.io/")
            .UseCulture("en-US")
            .UseAllNUnitFeatures();

            DriverSetup.GetDefaultConfiguration(BrowserNames.InternetExplorer)
            .WithX32Architecture();

            AtataContext.GlobalConfiguration.AutoSetUpConfiguredDrivers();
        }
 private static void SetUpDriver() =>
 DriverSetup.AutoSetUp(BrowserNames.Chrome);
        public async Task AutoSetUpAsync(string[] browserNames)
        {
            var results = await DriverSetup.AutoSetUpAsync(browserNames);

            AssertAutoSetUpDriverResults(results, browserNames);
        }
        public void AutoSetUp(string[] browserNames)
        {
            var results = DriverSetup.AutoSetUp(browserNames);

            AssertAutoSetUpDriverResults(results, browserNames);
        }
 public void AutoSetUpAsync_ThrowsArgumentNullException(string[] browserNames)
 {
     Assert.ThrowsAsync <ArgumentNullException>(() =>
                                                DriverSetup.AutoSetUpAsync(browserNames));
 }
        public void AutoSetUpSafely(string[] browserNames)
        {
            var results = DriverSetup.AutoSetUpSafely(browserNames);

            AssertAutoSetUpDriverResults(results, browserNames?.Where(IsValidBrowserName) ?? new string[0]);
        }
        public async Task AutoSetUpSafelyAsync(string[] browserNames)
        {
            var results = await DriverSetup.AutoSetUpSafelyAsync(browserNames);

            AssertAutoSetUpDriverResults(results, browserNames?.Where(IsValidBrowserName) ?? new string[0]);
        }
 public void BeforeScenario(ScenarioContext scenarioContext)
 {
     ObjectRepo.SetWebDriver(DriverSetup.InitializeWebDriver(ObjectRepo.ConfigReader.GetBrowser()));
 }
Exemple #28
0
 /// <summary>
 /// Clicks the element and returns a new page
 /// </summary>
 /// <typeparam name="T">Type of page to return</typeparam>
 /// <returns>Page of Type T</returns>
 public T Click <T>(int timeout = 20)
 {
     Click(timeout);
     return(DriverSetup.getInstance().GetPage <T>(Driver));
 }