public void HomePageTest()
        {
            // TODO: Add your test code here
            var homePage = new InternetPage(this.DriverContext);

            homePage.OpenHomePage();
        }
Beispiel #2
0
        //[TestMethod]
        public void UnTickCheckboxTest()
        {
            // TODO: Add your test code here
            var checkboxes = new InternetPage(this.DriverContext);

            checkboxes.OpenHomePage();
        }
Beispiel #3
0
        public void BasicAuthTest()
        {
            // TODO: Add your test code here
            var basicAuthPage = new InternetPage(this.DriverContext);

            basicAuthPage.OpenHomePage();
        }
Beispiel #4
0
        public void HerokuappPerfTests1()
        {
            this.DriverContext.PerformanceMeasures.StartMeasure();
            InternetPage internet = new InternetPage(this.DriverContext);

            internet.OpenHomePage();
            this.DriverContext.PerformanceMeasures.StopMeasure(TestContext.CurrentContext.Test.Name + "LoadingMainPage");
            this.DriverContext.PerformanceMeasures.StartMeasure();
            internet.GoToCheckboxesPage();
            this.DriverContext.PerformanceMeasures.StopMeasure(TestContext.CurrentContext.Test.Name + "LoadingCheckboxesPage");
        }
Beispiel #5
0
        public void CountLinksAtShiftingContentTest(IDictionary <string, string> parameters)
        {
            InternetPage internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToShiftingContentPage();

            var links = new ShiftingContentPage(this.DriverContext);

            Verify.That(this.DriverContext, () => Assert.AreEqual(parameters["number"], links.CountLinks()));
        }
        public void Exercise_11_Test()
        {
            // TODO: Add your test code here
            var internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToPage("status_codes");
            var statuscodesPage = new StatusCodesPage(this.DriverContext);

            Assert.True(statuscodesPage.IsElementPresent());
        }
        public void Exercise_4_Test()
        {
            // TODO: Add your test code here
            var internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToPage("login");
            var loginPage = new LoginPage(this.DriverContext);

            Assert.AreEqual("Login Page", loginPage.GetHeader());
            Assert.AreEqual("Login", loginPage.GetLoginButton());
        }
        public void Exercise_6_Test()
        {
            // TODO: Add your test code here
            var internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToPage("dropdown");
            var dropdownPage = new DropdownPage(this.DriverContext);

            Assert.AreEqual("Dropdown List", dropdownPage.GetHeader());
            Assert.False(dropdownPage.GetOptionProperty());
        }
Beispiel #9
0
        public void Exercise_File_Upload_Test()
        {
            var internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToPage("upload");
            var fileUpload = new FileUploadPage(this.DriverContext);

            Verify.That(
                this.DriverContext,
                () => Assert.AreEqual("File Uploader", fileUpload.GetHeader()));
            fileUpload.UploadFile("file-uploaded.txt");
        }
        public void SaveWebDriverScreenShotTest()
        {
            InternetPage internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToFileDownloader();
            var          screenShotNumber = FilesHelper.CountFiles(this.DriverContext.ScreenShotFolder, FileType.Png);
            DownloadPage downloadPage     = new DownloadPage(this.DriverContext);

            downloadPage.SaveWebDriverScreenShot();
            var nameOfScreenShot = downloadPage.CheckIfScreenShotIsSaved(screenShotNumber);

            Assert.IsTrue(nameOfScreenShot.Contains(this.DriverContext.TestTitle), "Name of screenshot doesn't contain Test Title");
        }
Beispiel #11
0
        public void Exercise_Checkboxes_Deselect_Test()
        {
            // TODO: Add your test code here
            var internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToPage("checkboxes");
            var checkBoxesPage = new CheckboxesPage(this.DriverContext);

            Verify.That(
                this.DriverContext,
                () => Assert.AreEqual("Checkboxes", checkBoxesPage.GetHeader()),
                () => Assert.IsFalse(checkBoxesPage.SelectCheckBox(2)));
        }
        public void Exercise_5_Test()
        {
            // TODO: Add your test code here
            var internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToPage("login");
            var formFormAuthentication = new FormAuthenticationPage(this.DriverContext);

            formFormAuthentication.EnterUserName(BaseConfiguration.Username);
            formFormAuthentication.EnterPassword(BaseConfiguration.Password);
            formFormAuthentication.LogIn();
            Assert.AreEqual("You logged into a secure area!", formFormAuthentication.GetMessageSecure());
        }
Beispiel #13
0
        public void Exercise_Uploaded_File_Download_Test()
        {
            // TODO: Add your test code here
            var internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToPage("download");
            var fileDownload = new FileDownloadPage(this.DriverContext);

            Verify.That(
                this.DriverContext,
                () => Assert.AreEqual("File Downloader", fileDownload.GetHeader()));
            fileDownload.SaveFile("file-uploaded.txt", "file-uploaded-downloaded.txt");
            fileDownload.DeleteFile("file-uploaded-downloaded.txt");
        }
Beispiel #14
0
        public void FormAuthenticationPageTest(IDictionary <string, string> parameters)
        {
            InternetPage internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToFormAuthenticationPage();
            var formFormAuthentication = new FormAuthenticationPage(this.DriverContext);

            formFormAuthentication.EnterUserName(parameters["user"]);
            formFormAuthentication.EnterPassword(parameters["password"]);
            formFormAuthentication.LogOn();
            Verify.That(
                this.DriverContext,
                () => Assert.AreEqual(parameters["message"], formFormAuthentication.GetMessage));
        }
Beispiel #15
0
        public void FormAuthenticationPageTestCSV(IDictionary <string, string> parameters)
        {
            var basicAuthPage = new InternetPage(this.DriverContext);

            basicAuthPage.OpenHomePage();
            basicAuthPage.GoToPage("login");
            var formFormAuthentication = new FormAuthenticationPage(this.DriverContext);

            formFormAuthentication.EnterUserName(parameters["user"]);
            formFormAuthentication.EnterPassword(parameters["password"]);
            formFormAuthentication.LogIn();
            Verify.That(
                this.DriverContext,
                () => Assert.AreEqual(parameters["message"], formFormAuthentication.GetMessageSecure()));
        }
Beispiel #16
0
        public void MultipleWindowsTest()
        {
            const string PageTitle = "New Window";

            InternetPage internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToMultipleWindowsPage();
            MultipleWindowsPage multipleWindowsPage = new MultipleWindowsPage(this.DriverContext);

            multipleWindowsPage.OpenNewWindowPage();
            NewWindowPage newWindowPage = new NewWindowPage(this.DriverContext);

            Assert.True(newWindowPage.IsPageTile(PageTitle), "wrong page title, should be {0}", PageTitle);
            Assert.True(newWindowPage.IsNewWindowH3TextVisible(PageTitle), "text is not equal to {0}", PageTitle);
        }
        public void Exercise_7_Test()
        {
            // TODO: Add your test code here
            var internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToPage("tables");
            var sortablePage = new SortablePage(this.DriverContext);

            Assert.AreEqual("Data Tables", sortablePage.GetHeader());
            var lastNames = new Collection <string> {
                "Smith", "Bach", "Doe", "Conway"
            };

            CollectionAssert.AreEqual(lastNames, sortablePage.GetValues());
        }
Beispiel #18
0
        public void Exercise_File_Download_Secure_Test()
        {
            // TODO: Add your test code here
            var internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToPage("download_secure");
            var fileDownloadSecurePage = new FileDownloadSecurePage(this.DriverContext);

            fileDownloadSecurePage.SignIn("admin", "admin");
            Verify.That(
                this.DriverContext,
                () => Assert.AreEqual("Secure File Downloader", fileDownloadSecurePage.GetHeader()));
            fileDownloadSecurePage.SaveFile("some-file.txt", "new-file.txt");
            fileDownloadSecurePage.DeleteFile("new-file.txt");
        }
Beispiel #19
0
        public void Exercise_12_Test_Example2()
        {
            // TODO: Add your test code here
            var internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToPage("dynamic_loading");
            var example2 = new DynamicLoadingPage(this.DriverContext);

            example2.ClickOnExampleLink("2");
            var start = new DynamicLoadingPage(this.DriverContext);

            start.ClickOnStartButtonExample2("start");
            var finish = new DynamicLoadingPage(this.DriverContext).GetText("finish");

            Assert.AreEqual("Hello World!", finish);
        }
        public void Exercise_10_Test()
        {
            // TODO: Add your test code here
            var internetPage = new InternetPage(this.DriverContext);

            internetPage.OpenHomePage();
            internetPage.GoToPage("drag_and_drop");
            var dragAndDropPageHeader = new DragAndDropPage(this.DriverContext);

            Assert.AreEqual("Drag and Drop", dragAndDropPageHeader.GetHeader());
            var moveElementAtoElementB = new DragAndDropPage(this.DriverContext);

            moveElementAtoElementB.MoveElementAtoElementB();
            var draganddropPage = new DragAndDropPage(this.DriverContext);

            Assert.AreEqual("A", draganddropPage.GetText());
        }