public void WaitForInventoryInSearchResult(DateTime createdTime, CatalogStatus catalogStatus) { DateTime lastStatusDate; double timeOutInSecs = CatalogTimeOuts.CatalogSearchTimeOut.TotalSeconds; CatalogStatus status = catalogStatus; while (timeOutInSecs > 0) { lastStatusDate = Convert.ToDateTime(CatalogsTable.GetCellValueForInventory(1, "Last Status Date"), System.Globalization.CultureInfo.InvariantCulture); if (CatalogsTable.GetCellValueForInventory(1, "Status") != null) { status = UtilityMethods.ConvertToEnum <CatalogStatus>(CatalogsTable.GetCellValueForInventory(1, "Status")); } if (lastStatusDate.AddMinutes(1) > createdTime && (status == catalogStatus || status == CatalogStatus.Failed || status == CatalogStatus.FailedInstant)) { break; } else { SearchRecordsLink.Click(); Thread.Sleep(TimeSpan.FromSeconds(5)); timeOutInSecs -= 5; } } }
public void SearchCatalogs(Region region, string profileName, string identityName) { SelectOption(SelectRegionSpan, region.ConvertToString().ToUpper()); SelectOption(SelectCustomerNameSpan, profileName.ToUpper()); SelectOption(SelectIdentityNameSpan, identityName.ToUpper()); SearchRecordsLink.Click(); CatalogsTable.WaitForElementVisible(TimeSpan.FromSeconds(30)); }
public void WaitForCatalogInSearchResult(DateTime createdTime, CatalogStatus catalogStatus) { DateTime lastStatusDate; double timeOutInSecs = CatalogTimeOuts.CatalogSearchTimeOut.TotalSeconds; string threadId = string.Empty; CatalogStatus status = catalogStatus; while (timeOutInSecs > 0) { lastStatusDate = Convert.ToDateTime(CatalogsTable.GetCellValue(1, "Last Status Date"), System.Globalization.CultureInfo.InvariantCulture); if (CatalogsTable.GetCellValue(1, "Status") != null) { status = UtilityMethods.ConvertToEnum <CatalogStatus>(CatalogsTable.GetCellValue(1, "Status")); } if (lastStatusDate.AddMinutes(1) > createdTime) { if (catalogStatus == CatalogStatus.Created && (status == CatalogStatus.Created || status == CatalogStatus.CreatedWarning || status == CatalogStatus.Failed)) { break; } else if (catalogStatus == CatalogStatus.CreatedWarning && (status == CatalogStatus.Created || status == CatalogStatus.CreatedWarning || status == CatalogStatus.Failed)) { break; } else if (catalogStatus == CatalogStatus.Published && (status == CatalogStatus.Published || status == CatalogStatus.PublishedWarning || status == CatalogStatus.Failed)) { break; } else if (catalogStatus == CatalogStatus.CreatedInstant && (status == CatalogStatus.CreatedInstant || status == CatalogStatus.CreatedWarningInstant || status == CatalogStatus.FailedInstant)) { break; } else if (catalogStatus == CatalogStatus.Failed && (status == CatalogStatus.Created || status == CatalogStatus.CreatedWarning || status == CatalogStatus.Failed)) { break; } else if (catalogStatus == CatalogStatus.Failed && (status == CatalogStatus.Published || status == CatalogStatus.PublishedWarning || status == CatalogStatus.Failed)) { break; } } SearchRecordsLink.Click(); Thread.Sleep(TimeSpan.FromSeconds(5)); timeOutInSecs -= 5; } //threadId = CatalogsTable.GetCellValue(1, "Thread Id"); //Console.WriteLine("Thread Id: " + threadId); //return threadId; }
public void SearchInventoryRecords(Region region, string profileName = "", string identityName = "") { InventoryCheckbox.Click(); SelectOption(SelectRegionSpan, region.ConvertToString().ToUpper()); if (!string.IsNullOrEmpty(profileName)) { SelectOption(SelectCustomerNameSpan, profileName.ToUpper()); } if (!string.IsNullOrEmpty(identityName)) { SelectOption(SelectIdentityNameSpan, identityName.ToUpper()); } SearchRecordsLink.Click(); CatalogsTable.WaitForElementVisible(TimeSpan.FromSeconds(30)); }