public static FilterBy CPUType(string cpuType) { if (cpuType == null) { throw new ArgumentNullException("storage", "Cannot filter when storageType is null."); } FilterBy b = new FilterBy(); b.Criteria = cpuType; b.Name = "CPU Type"; return(b); }
public static FilterBy DisplaySize(string displaySize) { if (displaySize == null) { throw new ArgumentNullException("storage", "Cannot filter when storageType is null."); } FilterBy b = new FilterBy(); b.Criteria = displaySize; b.Name = "Display Size"; return(b); }
public bool FilterBy(FilterBy b) { if (b == null) { throw new ArgumentNullException("FilterBy", "Cannot filter when FilterBy is null."); } string xpath = string.Format(b.Xpath, b.Criteria); IWebElement hMenuElem = _Driver.WaitUntil(_Timeout, ExpectedConditions.ElementToBeClickable(By.XPath(xpath))); bool result = hMenuElem.ClickSafe(); if (!result) { AddError($"Failed to filter products by '{b.Name}': {b.Criteria}"); return(false); } return(true); }