Exemple #1
0
        public void DownloadVSComunity2017()
        {
            WebDriverAPI.ClickOnElement(downloadVSlink);
            string        userPath      = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
            string        downloadPath  = Path.Combine(userPath, "Downloads");
            ChromeOptions chromeOptions = new ChromeOptions();

            chromeOptions.AddUserProfilePreference("download.default_directory", downloadPath);
            DirectoryInfo dirInfo = new DirectoryInfo(downloadPath);

            dirInfo = new DirectoryInfo(downloadPath);
            int         directoryFiles = dirInfo.EnumerateFiles().Count();
            Actions     action         = new Actions(driver);
            IWebElement elem           = driver.FindElement(downloadVSForWindows);

            action.MoveToElement(elem).Perform();
            WebDriverAPI.ClickOnElement(downloadComunity2017);
            Thread.Sleep(10000);
            dirInfo = new DirectoryInfo(downloadPath);
            int currentFiles = dirInfo.EnumerateFiles().Count();

            Assert.Greater(currentFiles, directoryFiles);
        }
Exemple #2
0
        public static void ClickOnWebElement(By element)
        {
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);

            WebDriverAPI.ClickOnElement(element);
        }
Exemple #3
0
 public DownloadsPage GoToDownloadsPage()
 {
     WebDriverAPI.NavigateByLink(downloadsLink);
     return(new DownloadsPage());
 }
Exemple #4
0
 public HostingPage GoToHostingLinkPage()
 {
     WebDriverAPI.NavigateByLink(homeLink);
     return(new HostingPage());
 }
Exemple #5
0
 public LearnPage GoToLearnLinkPage()
 {
     WebDriverAPI.NavigateByLink(learnLink);
     return(new LearnPage());
 }
Exemple #6
0
 public GetStartedPage ClickOnGetStartedLink()
 {
     WebDriverAPI.NavigateByLink(getStartedLink);
     return(new GetStartedPage());
 }
Exemple #7
0
 public void ClickOnHomeLink()
 {
     WebDriverAPI.NavigateByLink(homeLink);
 }
Exemple #8
0
 public void ClickOnSignUpLink()
 {
     WebDriverAPI.NavigateByLink(signUpLink);
 }
Exemple #9
0
 public void OpenHomePageByURL()
 {
     WebDriverAPI.NavigateToURL(homePageURL);
 }
Exemple #10
0
        public BasePage()
        {
            WebDriverAPI api = new WebDriverAPI();

            driver = api.StartChromeDriver();
        }