Exemple #1
0
        /// <summary>
        /// get the answer's line item
        /// </summary>
        /// <param name="choice">the answer choice</param>
        /// <returns>the Draggable Line Item</returns>
        public DraggableLineItem GetAnswerLineItem(string choice)
        {
            DraggableLineItem draggableLineItem = null;

            foreach (var answerChoice in AnswerChoiceList)
            {
                if (answerChoice.ChoiceContent.Equals(choice))
                {
                    draggableLineItem = answerChoice;
                    break;
                }
            }
            return(draggableLineItem);
        }
Exemple #2
0
        /// <summary>
        /// sets the answer choice list
        /// </summary>
        public void SetAnswerChoiceList()
        {
            AnswerChoiceList = new List <DraggableLineItem>();
            AnswerChoiceGrid.Wait(3);
            AnswerChoiceWebElementList = AnswerChoiceRows.WaitForElements(5);

            if (Driver.WrappedDriver.GetType() == typeof(DummyDriver))
            {
                AnswerChoiceWebElementList = GetDummyIdentifiers();
            }

            foreach (var webElement in AnswerChoiceWebElementList)
            {
                string key    = webElement.GetAttribute("data-key");
                string answer = webElement.Text.Trim();
                Report.Write("DraggableLineItem data-key: '" + key + "'; answer: '" + answer);
                var draggableLineItem = new DraggableLineItem(key, answer);
                AnswerChoiceList.Add(draggableLineItem);
            }
        }
Exemple #3
0
 /// <summary>
 /// is the question dropped on the answer?
 /// </summary>
 /// <param name="dragQuestion">the dragged question</param>
 public void IsQuestionDroppedOnAnswer(DraggableLineItem dragQuestion)
 {
     QuestionChoice = new WebElementWrapper(ByQuestionChoice(dragQuestion.Key));
     Assert.IsNotNull(QuestionChoice.WaitUntilVisible(3), "The question element is null, but should have been found.");
 }