public static void ToDate(IWebDriver driver, int day, string month, string year)
        {
            var currentMonth = CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(DateTime.Today.Month);
            var currentYear  = DateTime.Today.Year.ToString();

            Click.Button(driver, OrdersPage.ToDateOpenCalendarSelector());
            Click.Element(driver, OrdersPage.ToDateMonthYearSelector($"{currentMonth} {currentYear}"));
            Click.Element(driver, OrdersPage.ToDateMonthYearSelector($"{currentYear}"));

            SelectYearToDate(driver, year);
            SelectMonthToDate(driver, month);
            SelectDayToDate(driver, day);
        }
        public static void OpenOrderDetailsPage(IWebDriver driver)
        {
            int i = 0;
            // By OrderDetailsPageLink = By.XPath($"//div[text()='DMI Order ID']/following::a[contains(text(),'{i}')]");
            By OrderDetailsPageLink = OrdersPage.OrderDetailsLink(i);

            while (Find.ElementIfExists(driver, OrderDetailsPageLink) == false && i < 10)
            {
                LogR.Info($"Attempt to find an order on the page with a DMI Order ID containing the digit: {i}");
                OrderDetailsPageLink = By.XPath($"//div[text()='DMI Order ID']/following::a[contains(text(),'{i}')]");
                LogR.Info($"Attempting to look for: {OrderDetailsPageLink}");

                i += 1;
            }
            Click.Element(driver, OrderDetailsPageLink);
        }
Exemplo n.º 3
0
 public static void NavigateToPreviousMonth(IWebDriver driver)
 {
     Click.Element(driver, DMICalendarScreen.ToggleLeft);
 }
Exemplo n.º 4
0
 public static void NavigateToNextMonth(IWebDriver driver)
 {
     Click.Element(driver, DMICalendarScreen.ToggleRight);
 }
 static void SelectDayFromDate(IWebDriver driver, int day)
 {
     Click.Element(driver, OrdersPage.FromDateDaySelector($"{day}")); // eg 9
 }
 static void SelectMonthFromDate(IWebDriver driver, string month)
 {
     Click.Element(driver, OrdersPage.FromDateMonthYearSelector(month)); // eg Nov
 }
 static void SelectYearFromDate(IWebDriver driver, string year)
 {
     Click.Element(driver, OrdersPage.FromDateMonthYearSelector(year)); // eg 2010
 }
Exemplo n.º 8
0
 public static void OpenOrderDetailsPage(IWebDriver driver, string dmiOrderId)
 {
     Click.Element(driver, By.XPath($"//a[contains(text(),'{dmiOrderId}')]"));
 }