Пример #1
0
        public void DismissJsPromptTest()
        {
            var internetPage = new InternetPage(this.DriverContext).OpenHomePage();
            var jsAlertsPage = internetPage.GoToJavaScriptAlerts();

            jsAlertsPage.OpenJsPrompt();
            jsAlertsPage.DismissAlert();
            Assert.AreEqual("You entered: null", jsAlertsPage.ResultText);
        }
Пример #2
0
        public void DismissJsConfirmTest()
        {
            var internetPage = new InternetPage(this.DriverContext).OpenHomePage();
            var jsAlertsPage = internetPage.GoToJavaScriptAlerts();

            jsAlertsPage.OpenJsConfirm();
            jsAlertsPage.DismissAlert();
            Assert.AreEqual("You clicked: Cancel", jsAlertsPage.ResultText);
        }
Пример #3
0
        public void ClickJsAlertTest()
        {
            var internetPage = new InternetPage(this.DriverContext).OpenHomePage();
            var jsAlertsPage = internetPage.GoToJavaScriptAlerts();

            jsAlertsPage.OpenJsAlert();
            jsAlertsPage.AcceptAlert();
            Assert.AreEqual("You successfuly clicked an alert", jsAlertsPage.ResultText);
        }
Пример #4
0
        public void TypeTextAndAcceptJsPromptTest()
        {
            var text         = "Sample text";
            var internetPage = new InternetPage(this.DriverContext).OpenHomePage();
            var jsAlertsPage = internetPage.GoToJavaScriptAlerts();

            jsAlertsPage.OpenJsPrompt();
            jsAlertsPage.TypeTextOnAlert(text);
            jsAlertsPage.AcceptAlert();
            Assert.AreEqual("You entered: " + text, jsAlertsPage.ResultText);
        }