Beispiel #1
0
        public void TestAddQuestion()
        {
            _loginPage.Navigate();

            _loginPage.PopulateUsername("TestAdmin");
            _loginPage.PopulatePassword("admin123");
            _loginPage.ClickLogin();

            Thread.Sleep(msTimeout);

            var numQuestions = _adminPage.QuestionTitles.Count;

            _adminPage.ClickAddQuestion();

            _adminPage.SetQuestion("Testfrage");

            _adminPage.SetAnswer(0, "Antwort 1");
            _adminPage.SetAnswer(1, "Antwort 2");
            _adminPage.SetAnswer(2, "Antwort 3");
            _adminPage.SetAnswer(3, "Antwort 4");

            _adminPage.SetCorrectAnswer(2);

            _adminPage.SubmitQuestion();

            Assert.Equal(numQuestions + 1, _adminPage.QuestionTitles.Count);

            Thread.Sleep(msTimeout);

            _adminPage.DeleteQuestion(_adminPage.QuestionTitles.Count - 1);

            Thread.Sleep(msTimeout);

            Assert.Equal(numQuestions, _adminPage.QuestionTitles.Count);
        }