Example #1
0
        public BaseNugetPackageTests()
        {
            Driver = new OpenQA.Selenium.IE.InternetExplorerDriver();
            Driver.Manage().Timeouts().ImplicitlyWait(new TimeSpan(0, 0, 10));
            verificationErrors = new StringBuilder();
            var rotativaDemoUrl = ConfigurationManager.AppSettings["RotativaDemoUrl"];

            Driver.Navigate().GoToUrl(rotativaDemoUrl);
            WebClient = new WebClient();
            PdfTester = new PdfTester();
        }
Example #2
0
        public void ValidPdf()
        {
            var rotativaDemoUrl = ConfigurationManager.AppSettings["RotativaDemoUrl"];
            var pdfLink         = rotativaDemoUrl + "/Home/ScriptJs";

            using (var webClient = new WebClient())
            {
                var pdf       = webClient.DownloadData(new Uri(pdfLink));
                var pdfTester = new PdfTester();
                pdfTester.LoadPdf(pdf);
                Assert.True(pdfTester.PdfIsValid, "it's not a valid pdf");
                Assert.True(pdfTester.PdfContains("whooah"), "it doesn't contain searched text");
            }
        }
Example #3
0
 public BaseWebClientTest()
 {
     pdfTester = new PdfTester();
 }