public void TestTwoPages() { var scopeId = Guid.NewGuid().ToString(); CreateFtpUsers(21, scopeId); using var browser = new BrowserForTests(); var businessObjectsPage = browser.SwitchTo <BusinessObjectsPage>(); businessObjectsPage.FilterInput.ClearAndInputText("FtpUser"); var ftpUsersLink = businessObjectsPage.ObjectGroups[0].ObjectsList.GetItemWithText(x => x.ObjectLink.Text, "FtpUser"); var ftpUsersPage = ftpUsersLink.ObjectLink.ClickAndGoTo <BusinessObjectTablePage>(); ftpUsersPage.OpenFilter.Click(); ftpUsersPage.FilterModal.GetFilter("Login").Input.ClearAndInputText(scopeId); ftpUsersPage.FilterModal.Apply.Click(); ftpUsersPage = browser.RefreshUntil(ftpUsersPage, page => page.ItemsCountInfo.Text.Get().Contains("Всего 21")); ftpUsersPage.ItemsCountInfo.WaitTextContains("Записи с 0 по 20", "Всего 21"); ftpUsersPage.BusinessObjectItems.WaitCount(20); ftpUsersPage.Paging.PagesCount.Wait().That(Is.EqualTo(2)); ftpUsersPage.Paging.GoToPage(2); ftpUsersPage.ItemsCountInfo.WaitTextContains("Записи с 20 по 21", "Всего 21"); ftpUsersPage.BusinessObjectItems.WaitCount(1); }
public void TestFindDocumentWithDifferentColumnTypes() { var document = CqlDocumentsForTests.GetCqlConnectorDeliveryContext(serializer); var document2 = CqlDocumentsForTests.GetCqlConnectorDeliveryContext(serializer); using (var context = new CqlDbContext()) context.InsertDocuments(new[] { document, document2 }); using var browser = new BrowserForTests(); var showTableEntriesPage = browser.LoginAsSuperUser().SwitchTo <BusinessObjectTablePage>("CqlConnectorDeliveryContext"); showTableEntriesPage.OpenFilter.Click(); showTableEntriesPage.FilterModal.GetFilter("TimeSliceId").DateTimeInTicks.ClearAndInputText(document.TimeSliceId.UtcTicks.ToString()); showTableEntriesPage.FilterModal.GetFilter("TimeSliceShardNumber").Input.ClearAndInputText(document.TimeSliceShardNumber.ToString()); showTableEntriesPage.FilterModal.GetFilter("ContextId").Input.ClearAndInputText(document.ContextId.ToString()); showTableEntriesPage.FilterModal.Apply.Click(); showTableEntriesPage.BusinessObjectItems.WaitCount(1); var row = showTableEntriesPage.BusinessObjectItems[0]; row.FindColumn("TimeSliceId").WaitText(document.TimeSliceId.ToString("yyyy-MM-ddTHH:mm:ss.ffK")); row.FindColumn("TimeSliceShardNumber").WaitText(document.TimeSliceShardNumber.ToString()); row.FindColumn("ContextId").WaitText(document.ContextId.ToString()); row.Delete.Click(); showTableEntriesPage.ConfirmDeleteObjectModal.Delete.Click(); browser.RefreshUntil(showTableEntriesPage, x => x.NothingFound.IsPresent.Get()); GetConnectorDeliveryContext(document).Length.Should().Be(0); GetConnectorDeliveryContext(document2).Single().Should().BeEquivalentTo(document2); }
public void TestAllowSort() { using (var context = new EntityFrameworkDbContext()) { var serializer = new Serializer(new AllPropertiesExtractor()); var customer = new Customer { Age = 1, Name = "13" }; context.Tests.Add(new TestTable { Id = 1, CompositeKey = Guid.NewGuid().ToString(), String = "123", Customer = customer, CustomerSerialized = serializer.Serialize(customer), }); context.Users.Add(new UsersTable { Email = "123", Id = Guid.NewGuid(), Patronymic = "1", Surname = "2", FirstName = "3", ScopeId = "scopeId", }); context.SaveChanges(); } using var browser = new BrowserForTests(); var usersPage = browser.LoginAsSuperUser().SwitchTo <BusinessObjectTablePage>("UsersTable"); usersPage = browser.RefreshUntil(usersPage, x => x.BusinessObjectItems.IsPresent.Get()); usersPage.TableHeader.WaitPresence(); usersPage.TableHeader.SortByColumn("Header_Id"); var largeObjectPage = browser.SwitchTo <BusinessObjectTablePage>("TestTable"); largeObjectPage = browser.RefreshUntil(largeObjectPage, x => x.BusinessObjectItems.IsPresent.Get()); largeObjectPage.TableHeader.WaitPresence(); largeObjectPage.TableHeader.WaitNotSortable("Header_Index"); largeObjectPage.TableHeader.WaitNotSortable("Header_String"); largeObjectPage.TableHeader.WaitNotSortable("Header_DateTime"); }
public void DeleteViaSearchPageRequiresGodAccess() { var ftpUser = CreateFtpUser(); using var browser = new BrowserForTests(); var businessObjectPage = browser.SwitchTo <BusinessObjectTablePage>("FtpUser"); businessObjectPage.OpenFilter.Click(); businessObjectPage.FilterModal.GetFilter("Login").Input.ClearAndInputText(ftpUser.Login); businessObjectPage.FilterModal.Apply.Click(); businessObjectPage = browser.RefreshUntil(businessObjectPage, x => x.BusinessObjectItems.IsPresent.Get()); businessObjectPage.BusinessObjectItems.WaitCount(1); businessObjectPage.BusinessObjectItems[0].Delete.IsPresent.Wait().That(Is.False, "Delete link should only be present for gods"); }
public void TestDeleteDocumentWithClusteringKeyPart() { var documents = CqlDocumentsForTests.GetCqlDocumentBindingMetaEntries(serializer); var firstPartnerPartyId = documents[0].FirstPartnerPartyId; var secondPartnerPartyId = documents[0].SecondPartnerPartyId; var documentType = documents[0].DocumentType; var documentCirculationId = documents[0].DocumentCirculationId.ToString(); using (var context = new CqlDbContext()) context.InsertDocuments(documents); using var browser = new BrowserForTests(); var showTableEntriesPage = browser.LoginAsSuperUser().SwitchTo <BusinessObjectTablePage>("DocumentBindingsMeta"); showTableEntriesPage.OpenFilter.Click(); showTableEntriesPage.FilterModal.GetFilter("BindingType").EnumSelect.SelectValueByText("ByPriceList"); showTableEntriesPage.FilterModal.GetFilter("FirstPartnerPartyId").Input.ClearAndInputText(firstPartnerPartyId); showTableEntriesPage.FilterModal.GetFilter("SecondPartnerPartyId").Input.ClearAndInputText(secondPartnerPartyId); showTableEntriesPage.FilterModal.GetFilter("DocumentNumber").Input.ClearAndInputText("0"); showTableEntriesPage.FilterModal.GetFilter("DocumentDate").Date.ClearAndInputText("10.10.2000"); showTableEntriesPage.FilterModal.GetFilter("DocumentTime").DateTimeInTicks.ClearAndInputText(new DateTime(2020, 10, 10, 13, 12, 11, DateTimeKind.Utc).Ticks.ToString()); showTableEntriesPage.FilterModal.GetFilter("DocumentType").Input.ClearAndInputText(documentType); showTableEntriesPage.FilterModal.GetFilter("DocumentCirculationId").Input.ClearAndInputText(documentCirculationId); showTableEntriesPage.FilterModal.Apply.Click(); showTableEntriesPage.BusinessObjectItems.WaitCount(1); showTableEntriesPage.BusinessObjectItems[0].FindColumn("DocumentCirculationId").WaitText(documentCirculationId); showTableEntriesPage.BusinessObjectItems[0].Delete.Click(); showTableEntriesPage.ConfirmDeleteObjectModal.Delete.Click(); showTableEntriesPage = browser.RefreshUntil(showTableEntriesPage, x => x.NothingFound.IsPresent.Get()); showTableEntriesPage.OpenFilter.Click(); showTableEntriesPage.FilterModal.GetFilter("DocumentType").Input.Clear(); showTableEntriesPage.FilterModal.GetFilter("DocumentCirculationId").Input.Clear(); showTableEntriesPage.FilterModal.Apply.Click(); showTableEntriesPage.BusinessObjectItems.WaitCount(9); GetBindingMeta(documents[0]).Length.Should().Be(0); }
public void DeleteViaSearchPage(bool confirmDeletion) { var ftpUser = CreateFtpUser(); using var browser = new BrowserForTests(); var businessObjectPage = browser.LoginAsSuperUser().SwitchTo <BusinessObjectTablePage>("FtpUser"); businessObjectPage.OpenFilter.Click(); businessObjectPage.FilterModal.GetFilter("Login").Input.ClearAndInputText(ftpUser.Login); businessObjectPage.FilterModal.Apply.Click(); businessObjectPage = browser.RefreshUntil(businessObjectPage, x => x.BusinessObjectItems.IsPresent.Get()); businessObjectPage.BusinessObjectItems.WaitCount(1); businessObjectPage.BusinessObjectItems[0].Delete.Click(); ConfirmDeletion(businessObjectPage.ConfirmDeleteObjectModal, confirmDeletion); if (confirmDeletion) { businessObjectPage.BusinessObjectItems.WaitAbsence(); } AssertFtpUserExistence(ftpUser.Id, confirmDeletion); }
public void TestThreePages() { var scopeId = Guid.NewGuid().ToString(); CreateFtpUsers(51, scopeId); using var browser = new BrowserForTests(); var ftpUsersPage = browser.SwitchTo <BusinessObjectTablePage>("FtpUser"); ftpUsersPage.OpenFilter.Click(); ftpUsersPage.FilterModal.GetFilter("Login").Input.ClearAndInputText(scopeId); ftpUsersPage.FilterModal.Apply.Click(); ftpUsersPage = browser.RefreshUntil(ftpUsersPage, page => page.ItemsCountInfo.Text.Get().Contains("Всего 51")); ftpUsersPage.ItemsCountInfo.WaitTextContains("Записи с 0 по 20", "Всего 51"); ftpUsersPage.BusinessObjectItems.WaitCount(20); ftpUsersPage.Paging.PagesCount.Wait().That(Is.EqualTo(3)); ftpUsersPage.Paging.GoToPage(2); ftpUsersPage.ItemsCountInfo.WaitTextContains("Записи с 20 по 40", "Всего 51"); ftpUsersPage.BusinessObjectItems.WaitCount(20); ftpUsersPage.Paging.GoToPage(3); ftpUsersPage.ItemsCountInfo.WaitTextContains("Записи с 40 по 51", "Всего 51"); ftpUsersPage.BusinessObjectItems.WaitCount(11); ftpUsersPage.Paging.GoToPage(1); ftpUsersPage.ItemsCountInfo.WaitTextContains("Записи с 0 по 20", "Всего 51"); ftpUsersPage.CountDropdown.CurrentCount.Click(); ftpUsersPage.CountDropdown.Menu.GetItemByUniqueTid("##50Items").Click(); ftpUsersPage.ItemsCountInfo.WaitTextContains("Записи с 0 по 50", "Всего 51"); ftpUsersPage.BusinessObjectItems.WaitCount(50); ftpUsersPage.Paging.PagesCount.Wait().That(Is.EqualTo(2)); ftpUsersPage.Paging.GoToPage(2); ftpUsersPage.ItemsCountInfo.WaitTextContains("Записи с 50 по 51", "Всего 51"); ftpUsersPage.BusinessObjectItems.WaitCount(1); }