示例#1
0
        public void OneTimeSetUpBase()
        {
            this.testDb           = new TestDb();
            this.dbContext        = testDb.CreateDbContext();
            this.testEventuresApp = new TestEventuresApp <Startup>(testDb, ApiPath);
            this.baseUrl          = this.testEventuresApp.ServerUri;

            // Initialize Appium Local Service to start the Appium server automatically
            appiumLocalService = new AppiumServiceBuilder().UsingAnyFreePort().Build();
            appiumLocalService.Start();

            var appiumOptions = new AppiumOptions()
            {
                PlatformName = "Windows"
            };
            var fullPathName = Path.GetFullPath(AppPath);

            appiumOptions.AddAdditionalCapability("app", fullPathName);

            // Initialize the Windows driver with Appium local service and options
            driver = new WindowsDriver <WindowsElement>(
                appiumLocalService, appiumOptions);

            // Set an implicit wait for the UI interaction
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(10);

            // Set an explicit wait for the UI interaction
            wait = new WebDriverWait(driver, TimeSpan.FromSeconds(60));
        }
示例#2
0
 public void OneTimeSetUpBase()
 {
     this.testDb           = new TestDb();
     this.dbContext        = testDb.CreateDbContext();
     this.testEventuresApi = new TestEventuresApp <Startup>(
         testDb, "../../../../Eventures.WebAPI");
     this.httpClient = new HttpClient()
     {
         BaseAddress = new Uri(this.testEventuresApi.ServerUri)
     };
 }
示例#3
0
        public void OneTimeSetupBase()
        {
            // Run the Web app in a local Web server
            this.testDb           = new TestDb();
            this.testEventuresApp = new TestEventuresApp <Startup>(
                testDb, "../../../../Eventures.WebApp");
            this.baseUrl = this.testEventuresApp.ServerUri;

            // Setup the ChromeDriver
            var chromeOptions = new ChromeOptions();

            if (!Debugger.IsAttached)
            {
                chromeOptions.AddArguments("headless");
            }
            this.driver = new ChromeDriver(chromeOptions);

            // Set an implicit wait for the UI interaction
            this.driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
        }