public async Task Setup() { if (TestConfig.IsReportingEnabled) { await ReportManager.CreateTestAsync().ConfigureAwait(false); } CurrentTenant = TenantTitle.upload1; CurrentUser = TestConfig.AdminUser; await BackgroundTaskApi.DeleteAllTasksAsync(TestConfig.AdminUser).ConfigureAwait(false); AppApi.DeleteApps(true, new[] { AppTitle.Haribo, AppTitle.ComposerHq1, AppTitle.ComposerHq2, AppTitle.SapPorsche, AppTitle.Player }, TenantTitle.upload1); AppApi.DeleteApps(true, new[] { AppTitle.Haribo, AppTitle.ComposerHq1, AppTitle.ComposerHq2 }, TenantTitle.upload2); // page ready without "upload spinner" element check IsUseAllPageReadyChecks = false; }
public async Task EndFixtureTests() { if (TestContext.Parameters.Count == 0) { PlaceApi.DeletePlaces(); AppApi.DeleteApps(); ItemApi.DeleteItems(); } await _mm.InboxHousekeepingAsync(_mm.ClientCxM).ContinueWith(task => _mm.Dispose()); }
public void EndFixtureTests() { if (IsEachFixtureInNewBrowser) { ClosePrimaryBrowser(); } if (TestContext.Parameters.Count == 0) { AppApi.DeleteApps(); } }
public void EndFixtureTests() { if (IsEachFixtureInNewBrowser) { ClosePrimaryBrowser(); } if (TestContext.Parameters.Count == 0) { AppApi.DeleteApps(); PlaceApi.DeletePlaces(PlaceType.NoType); PlaceApi.DeletePlaces(PlaceType.Ibeacon); } }
public void EndFixtureTests() { IsUseAllPageReadyChecks = true; // use normal set of page readiness checks if (IsEachFixtureInNewBrowser) { ClosePrimaryBrowser(); } if (TestContext.Parameters.Count == 0) { PlaceApi.DeletePlaces(); AppApi.DeleteApps(); ItemApi.DeleteItems(); } }
public void RT08020_ItemReferenceToIbeaconApp1() { Item item1 = null, item2 = null, item3 = null; var app = AddAppIbeacon(TestConfig.IbeaconAppVersions[1], true); Parallel.Invoke( () => item1 = AddItem(ItemType.PorscheCar, isAddNew: true), () => item2 = AddItem(ItemType.EmailTemplate, isAddNew: true), () => item3 = AddItem(ItemType.EmailTemplate, isAddNew: true), () => ItemApi.DeleteItems(ItemType.ServiceBooking) ); TestStart(); OpenEntityPage(item2); Assert.IsTrue(IsElementNotFound(ItemsPage.ReferencesSectionPlaces), "Reference section in item should be absent by default"); OpenEntityPage(app); EditForm(); ClickUntilShown(AppsPage.TextsButton, AppsPage.EmailsButton); Click(AppsPage.EmailsButton); Click(AppsPage.WelcomeNewCustomerDetailsButton); Assert.IsTrue(AreAllElementsContainText(ItemsPage.TableRowStatus, StatusActive), $@"All items in 'Select item' dialog should be {StatusActive}"); Assert.IsTrue(IsElementNotFoundQuickly(string.Format(ItemsPage.TableRowByTitle, item1.LangJsonData.EnJson.Title)), $@"All items in 'Select item' dialog should be {ItemTypeEmailTemplate} type"); Click(AppsPage.CancelButton); ClickUntilShown(AppsPage.WelcomeNewCustomer, CommonElement.DropDownInput); Assert.IsTrue(IsElementFoundQuickly(AppsPage.WelcomeNewCustomerDetailsButton), @"Field 'Welcome new customer' should have details button"); SendText(CommonElement.DropDownInput, "Porsche"); Assert.IsTrue(IsElementNotFound(CommonElement.DropDownOptionList), @"Dropdown 'Welcome new customer' is not empty"); SendText(CommonElement.DropDownInput, "Auto"); Assert.IsTrue(IsElementFound(string.Format(CommonElement.DropDownOption, "Auto")), @"Field 'Welcome new customer' should show dropdown items"); Click(string.Format(CommonElement.DropDownOption, item2.JsonDataTitle), noScroll: true); Assert.IsTrue(AreElementsContainText(AppsPage.WelcomeNewCustomer, item2.JsonDataTitle), $@"Field 'Welcome new customer' should contain {item2.JsonDataTitle}"); ClickUntilShown(AppsPage.WelcomeNewCustomer, CommonElement.DropDownInput); SendText(CommonElement.DropDownInput, string.Empty); SubmitForm(); ClickUntilShown(AppsPage.TextsButton, AppsPage.EmailsButton); Click(AppsPage.EmailsButton); Assert.IsTrue(AreElementsContainText(AppsPage.WelcomeNewCustomerReadOnly, item2.JsonDataTitle), $@"Field 'Welcome new customer' should contain {item2.JsonDataTitle}"); OpenEntityPage(item2); Assert.IsTrue(IsElementFound( string.Format(ItemsPage.ReferencesSectionPlaceByTitle, AppTitle.Ibeacon)), $"References: Apps field should contain {AppTitle.Ibeacon} app"); EditForm(); Click(string.Format(ItemsPage.ReferencesSectionPlaceByTitle, AppTitle.Ibeacon)); Assert.IsTrue(IsPageContainsUri($"{TestConfig.AppUri}/{app.AppId}"), $"User should be redirected to app {AppTitle.Ibeacon} page"); ClickUntilShown(AppsPage.TextsButton, AppsPage.EmailsButton); Click(AppsPage.EmailsButton); Assert.IsTrue(IsElementNotFoundQuickly(AppsPage.WelcomeNewCustomerDetailsButton), @"Field 'Welcome new customer' still has details button"); EditForm(); Click(AppsPage.ProfileReportTemplateDropDownDetailsButton); Assert.IsTrue(IsElementFoundQuickly(string.Format(ItemsPage.TableRowByTitle, item2.JsonDataTitle)), $@"Item {item2.JsonDataTitle} should be shown in 'Select item' dialog"); Click(string.Format(ItemsPage.TableRowByTitle, item2.JsonDataTitle)); Assert.IsTrue(AreElementsContainText(AppsPage.ProfileReportTemplateDropDown, item2.JsonDataTitle), $"Field 'Profile report template' should contain {item2.JsonDataTitle}"); SubmitForm(); OpenEntityPage(item2); Assert.IsTrue(CountElements(string.Format(ItemsPage.ReferencesSectionPlaceByTitle, AppTitle.Ibeacon)) == 1, $"References: Apps field should contain 1 app {AppTitle.Ibeacon} record"); Click(PageFooter.DeleteButton); Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ItemIsReferencedDialog), @"Dialog 'item is referenced' should be displayed"); Click(ItemsPage.OkButton); Click(PageFooter.DuplicateButton); SendText(ItemsPage.Title, ItemTypeWelcomeEmailTemplate + " 2"); SendText(ItemsPage.Key, RandomNumber); SubmitForm(); Assert.IsTrue(IsElementNotFound(ItemsPage.ReferencesSectionPlaces), "There should be no References section for duplicated item"); OpenEntityPage(app); EditForm(); ClickUntilShown(AppsPage.TextsButton, AppsPage.EmailsButton); Click(AppsPage.EmailsButton); Click(AppsPage.WelcomeNewCustomerDetailsButton); Click(ItemsPage.ClearSelectionButton); Assert.IsTrue(IsElementEquals(AppsPage.WelcomeNewCustomer, string.Empty), @"Field 'Welcome new customer' should be empty"); ClickUntilShown(AppsPage.ProfileReportTemplateDropDown, CommonElement.DropDownInput); SendText(CommonElement.DropDownInput, item3.JsonDataTitle); Assert.IsTrue(IsElementFound(string.Format(CommonElement.DropDownOption, item3.JsonDataTitle)), @"Field 'Profile report template' should show dropdown items"); PressKeys(Keys.Enter); Assert.IsTrue(AreElementsContainText(AppsPage.ProfileReportTemplateDropDown, item3.JsonDataTitle), $@"Field 'Profile report template' should contain {item3.JsonDataTitle}"); SubmitForm(); EditForm(); ClickUntilShown(AppsPage.TextsButton, AppsPage.EmailsButton); Click(AppsPage.EmailsButton); Click(AppsPage.WelcomeNewCustomerDetailsButton); PressKeys(Keys.Escape); Assert.IsTrue(IsElementNotFoundQuickly(AppsPage.SelectItemDialog), @"'Select item' dialog should be closed on Esc button press"); Assert.IsTrue(IsEditMode(), "App page should be in edit mode"); Click(PageFooter.CancelButton); OpenEntityPage(item2); Assert.IsTrue(IsElementNotFound(ItemsPage.ReferencesSectionPlaces), $"There should be no References section for item {item2.JsonDataTitle}"); AppApi.DeleteApps(true, new [] { AppTitle.Ibeacon }, CurrentTenant); OpenEntityPage(item3); Assert.IsTrue(IsElementNotFound(ItemsPage.ReferencesSectionPlaces), $"There should be no References section for item {item3.JsonDataTitle}"); Click(PageFooter.DeleteButton); Click(ItemsPage.DeleteButton); Assert.IsTrue(IsPageContainsUri(TestConfig.ItemsUri), $"Item {item3.JsonDataTitle} cannot be deleted"); }
public void RT14070_UploadAppDuplicates() { DeleteAppVersion(AppTitle.Player, TestConfig.PlayerAppVersions[1], PlayerApp); AppApi.DeleteApps(true, new [] { AppTitle.Haribo }, CurrentTenant); AddAppPlayer(); TestStart(); OpenAppsPage(); Click(PageFooter.AddAppInAppsButton); FileManager.Upload(_playerPath); Click(PageFooter.AddAppInAppsButton); FileManager.Upload(_playerPath); Assert.IsTrue(IsElementFound(AppsPage.ErrorVersionAlreadyExistsDialog, TestConfig.AppImportTimeout), $@"Error 'version already exists' should be shown for app {_playerFile} because of " + "attempt to upload the same app version twice"); Click(AppsPage.OkButton); Click(string.Format(AppsPage.TableRowByText, AppTitle.Player)); Assert.IsTrue( CountElements(string.Format(AppsPage.Version, TestConfig.PlayerAppVersions[0])) == 1, $@"App '{AppTitle.Player}' v.{TestConfig.PlayerAppVersions[0]} should be shown 1 time"); Assert.IsTrue( CountElements(string.Format(AppsPage.Version, TestConfig.PlayerAppVersions[1])) == 1, $@"App '{AppTitle.Player}' v.{TestConfig.PlayerAppVersions[1]} should be shown 1 time"); OpenAppsPage(); Assert.IsTrue( CountElements(string.Format(AppsPage.TableRowByText, AppTitle.Player)) == 1, $@"App '{AppTitle.Player}' should be shown 1 time on Apps list page"); Click(PageHeader.UploadWarning); Click(PageHeader.CancelAllTasksButton); Click(PageFooter.AddAppInAppsButton); var pathFile1 = FileManager.GetFileByVersion(TestConfig.SapPorscheAppFolder, TestConfig.SapPorscheAppFile, TestConfig.SapPorscheAppVersions[0]); FileManager.UploadAsBackgroundTask(pathFile1); Click(PageFooter.AddAppInAppsButton); var pathFile2 = FileManager.GetFileByVersion(TestConfig.SapPorscheAppFolder, TestConfig.SapPorscheAppFile, TestConfig.SapPorscheAppVersions[1]); FileManager.Upload(pathFile2); Click(PageFooter.AddAppInAppsButton); FileManager.Upload(TestConfig.HariboApp); Assert.IsTrue(IsElementNotFound(PageHeader.UploadSpinner, TestConfig.AppImportTimeout), @"3 apps upload & import is timed out"); Assert.IsTrue(IsElementNotFound(PageHeader.UploadWarning), "After import of 3 apps there should be no upload warning on page header"); Assert.IsTrue(IsEditMode(), "After 3 apps import, the last imported app should be in edit mode"); Click(PageFooter.SubmitButton); Click(PageHeader.PageAppsButton); Assert.IsTrue( CountElements(string.Format(AppsPage.TableRowByText, AppTitle.Haribo)) == 1, $@"App '{AppTitle.Haribo}' should be shown 1 time on Apps list page"); Assert.IsTrue( CountElements(string.Format(AppsPage.TableRowByText, AppTitle.SapPorsche)) == 1, $@"App '{AppTitle.SapPorsche}' should be shown 1 time on Apps list page"); Click(string.Format(AppsPage.TableRowByText, AppTitle.SapPorsche)); Assert.IsTrue( CountElements(string.Format(AppsPage.Version, TestConfig.SapPorscheAppVersions[0])) == 1, $@"App version {TestConfig.SapPorscheAppVersions[0]} should be shown 1 time"); Assert.IsTrue( CountElements(string.Format(AppsPage.Version, TestConfig.SapPorscheAppVersions[1])) == 1, $@"App version {TestConfig.SapPorscheAppVersions[1]} should be shown 1 time"); }
public void RT14060_UploadAppVersions() { AppApi.DeleteApps( true, new [] { AppTitle.Player, AppTitle.Haribo, AppTitle.ComposerHq1, AppTitle.ComposerHq2 }, CurrentTenant); AddAppPlayer(); TestStart(); OpenAppsPage(); Click(PageFooter.AddAppInAppsButton); FileManager.Upload(_compHq1Path); CloseTab(GetCurrentTabHandle()); ReLogin(); Assert.IsTrue(IsElementFound(PageHeader.UploadWarning), "Red warning button should be in page header because of closed tab during app upload"); Click(PageHeader.UploadWarning); var progress = Convert.ToInt16( GetValue( string.Format(PageHeader.TasksTableRowByTextPercentage, TestConfig.ComposerHqApp1File)) .TrimEnd('%')); Click(string.Format(PageHeader.TasksTableRowByTextReuploadButton, TestConfig.ComposerHqApp1File)); FileManager.Upload(_compHq1Path); var progressNow = Convert.ToInt16( GetValue( string.Format( PageHeader.TasksTableRowByTextPercentage, TestConfig.ComposerHqApp1File), true) .TrimEnd('%')); Assert.IsTrue(progress <= progressNow, "Import percentage should not start from beginning on re-upload app"); Assert.IsTrue(IsElementNotFound(PageHeader.TasksDialog), $"Tasks dialog should be closed on app {AppTitle.ComposerHq1} re-upload and import " + "complete"); Click(string.Format(TenantsPage.TableRowByTitle, TenantTitle.upload1)); OpenAppsPage(); Assert.IsTrue( IsElementFound(string.Format(AppsPage.TableRowByTwoParams, AppTitle.ComposerHq1, StatusNew)), $"App {AppTitle.ComposerHq1} should be shown on App list page in {StatusNew} status"); Click(PageFooter.AddAppInAppsButton); FileManager.Upload(TestConfig.HariboApp); Click(PageFooter.AddAppInAppsButton); FileManager.Upload(_compHq2Path); Click(PageFooter.AddAppInAppsButton); FileManager.Upload(_playerPath); Click(PageHeader.UploadSpinner); Click(string.Format(PageHeader.TasksTableRowByTextDeleteButton, TestConfig.ComposerHqApp2File)); Assert.IsTrue(IsElementNotFound( string.Format(PageHeader.TasksTableRowByText, TestConfig.ComposerHqApp2File)), $@"App {TestConfig.ComposerHqApp2File} should be deleted from task list on Delete press"); Assert.IsTrue(IsElementFound( string.Format(PageHeader.TasksTableRowByText, _hariboAppFileName)), $@"App {_hariboAppFileName} should continue on other task removal from the tasks list"); Assert.IsTrue(IsElementFound( string.Format(PageHeader.TasksTableRowByText, _playerFile)), $@"App {_playerFile} should continue on other task removal from the tasks list"); bool isImport; var sw = new Stopwatch(); sw.Start(); do { isImport = IsElementFound(string.Format( PageHeader.TasksTableRowByTwoParams, _hariboAppFileName, "Importing..."), 0.5) || IsElementFound(string.Format( PageHeader.TasksTableRowByTwoParams, _playerFile, "Importing..."), 0.5); }while (sw.Elapsed < TimeSpan.FromSeconds(TestConfig.AppImportTimeout) && !isImport); sw.Stop(); Assert.IsTrue(isImport, $@"Upload of apps '{AppTitle.Haribo}' and '{AppTitle.Player}' is timed out"); Click(PageHeader.CancelAllTasksButton); Assert.IsTrue(IsElementNotFound(PageHeader.TasksDialog), @"Tasks dialog should be closed on 'Cancel All Tasks' button press"); WaitTime(30); RefreshPage(); Assert.IsTrue(IsElementNotFound( string.Format(AppsPage.TableRowByText, AppTitle.ComposerHq2)), $@"App {AppTitle.ComposerHq2} should be not shown on Apps list page (task canceled)"); Assert.IsTrue(IsElementNotFound( string.Format(AppsPage.TableRowByText, AppTitle.Haribo)), $@"App {AppTitle.Haribo} should be not shown on Apps list page (task canceled)"); Click(string.Format(AppsPage.TableRowByText, AppTitle.Player)); Assert.IsTrue(IsElementNotFound(string.Format(AppsPage.Version, TestConfig.PlayerAppVersions[1])), $@"App {AppTitle.Player} v.{TestConfig.PlayerAppVersions[1]} should be not shown " + "(task canceled)"); }