/// <summary>
        /// Looping over all the main dishes, pizzas and drinks comparing against the provided order from the excel sheet
        /// and adding the desired order
        /// </summary>
        /// <param name="dishes"></param>
        public void AddingTheOrderToBasket(Dictionary <string, int> orderList)
        {
            Thread.Sleep(400);
            allMeals  = _mealsList.GetActualWebElements();
            mealNames = _mealNameList.GetActualWebElements();

            foreach (var orderName in orderList) //looping over either Drinks or Pizza dictonary
            {
                for (int j = 0; j < allMeals.Count; j++)
                {
                    //getting the order name and checking if it's the current selected on the UI
                    // here "Duck Breast" is special case as it comes with customized options
                    if (allMeals.ElementAt(j).Text.ToLower().Equals(orderName.Key.ToLower()))
                    {
                        //looping over the desired quantities to add the item accordingly
                        for (int k = 0; k < orderName.Value; k++)
                        {
                            mealNames.ElementAt(j).Click();
                        }

                        break;
                    }
                }
            }
        }
Пример #2
0
        public void ClickOnAddToCartBtn()
        {
            AutomatedActions.WaitActions.WaitForWebElementToBeClickable(_addToCartBtn, 120);
            IReadOnlyCollection <IWebElement> addToCartBtns = _addToCartBtn.GetActualWebElements();

            addToCartBtns.ElementAt(0).Click();
        }