コード例 #1
0
 public void BeginFixtureTests()
 {
     IsEachTestInNewBrowser = false;
     _admin2 = UserDirectoryApi.GetUserData(TestConfig.AdminUser2);
     TestConfig.AdminUser2.GivenName  = _admin2.GivenName;
     TestConfig.AdminUser2.FamilyName = _admin2.FamilyName;
     TestConfig.AdminUser2.Company    = _admin2.Company;
     TestConfig.AdminUser2.Phone      = _admin2.Phone;
 }
コード例 #2
0
 public void EndFixtureTests()
 {
     _admin2.Password = _oldPassword;
     UserDirectoryApi.SaveUser(_admin2);
     TestConfig.AdminUser2.Password = _oldPassword;
     if (IsEachFixtureInNewBrowser)
     {
         ClosePrimaryBrowser();
     }
 }
コード例 #3
0
        public void RT02310_UdAdminAssignsRoleWithLoginAndUserCanLogin()
        {
            UserDirectoryApi.AssignRolesToUser(TestConfig.ComposerOnlyUser, new [] { UserRole.ComposerAdmin, UserRole.CxmAdmin });
            Login(TestConfig.ComposerOnlyUser, isPressTenantButton: false);
            Assert.IsTrue(IsPageRedirectedTo(TestConfig.TenantsUrl),
                          @"Composer user with granted login permission and tenants cannot login to CX Manager");

            UserDirectoryApi.AssignRolesToUser(
                TestConfig.ComposerOnlyUser, new[] { UserRole.ComposerAdmin });
        }
コード例 #4
0
 public void RT01370_AddPermissionsToNewUserAndLogin()
 {
     if (!_isNewUserActivatedByAdmin)
     {
         RT01350_ActivateUserAndFindEmailUserActivated();
     }
     if (!_activationLinkClicked)
     {
         Assert.Warn("Cannot run because test method " +
                     "RT01350_ActivateUserAndFindEmailUserActivated has failed");
     }
     UserDirectoryApi.AssignRolesToUser(TestConfig.NewUser, new [] { UserRole.CxmAdmin });
     Login(TestConfig.NewUser, isPressTenantButton: false);
     Assert.IsTrue(IsElementNotFound(LoginPage.ErrorNoRolesAndPermissionsAssigned),
                   "Error 'You have no permissions assigned to you...' is displayed");
 }
コード例 #5
0
        public async Task EndFixtureTests()
        {
            var task1 = _mm.InboxHousekeepingAsync(_mm.ClientCxM);
            var task2 = _mm.InboxHousekeepingAsync(_mm.ClientUserDirectory);

            if (IsEachFixtureInNewBrowser)
            {
                ClosePrimaryBrowser();
            }
            if (_isConfirmationEmailHasSent)
            {
                UserDirectoryApi.DeleteUser(TestConfig.NewUser);
            }
            await task1.ConfigureAwait(false);

            await task2.ConfigureAwait(false);

            _mm.Dispose();
        }
コード例 #6
0
        public void RT01350_ActivateUserAndFindEmailUserActivated()
        {
            if (!_activationLinkClicked)
            {
                RT01320_NavigateToUserActivationPage();
            }

            if (!_activationLinkClicked)
            {
                Assert.Warn("Cannot run because test method "
                            + "RT01320_NavigateToUserActivationPage has failed");
            }
            UserDirectoryApi.SetUserStatus(TestConfig.NewUser, UserStatus.Active);
            WaitForNewMail(_mm.ClientCxM, _waitMailTimeoutSeconds);
            var isReceived = _mm.IsUserActivationEmailReceived();

            Assert.IsTrue(isReceived, "No user activated email received");
            _isNewUserActivatedByAdmin = true;
        }
コード例 #7
0
        /// <summary>
        /// Gets user SID for CX Manager web services and available tenants
        /// Results are stored to private properties Sid and Tenants.
        /// </summary>
        /// <param name="user">User object</param>
        internal static void GetSidAndTenants(User user)
        {
            var myIp          = RestController.MyIp();
            var formattedTime = DateTime.UtcNow.ToString("yyyy-MM-ddTHH:mm:ss.fffZ");
            var body          = new AuthorizationRequest
            {
                Email        = user.Email,
                DateTime     = formattedTime,
                Password     = RestController.GetSessionHash(formattedTime, user.Password),
                StayLoggedIn = true,
                ClientIp     = myIp
            };

            var response = RestController.HttpRequestJsonUnauthenticated(
                UriCxm.AccountLogin, Method.POST, body);
            var responseJson = JsonConvert.DeserializeObject <AuthorizationResponse>(response.Content);

            user.Id  = responseJson.UserId;
            user.Sid = responseJson.Sid;

            ActionManager.Tenants = new ConcurrentBag <Tenant>(UserDirectoryApi.GetTenantList());
        }
コード例 #8
0
        public void RT08010_AssignItemToPlace()
        {
            Place place1 = null, place2 = null, place3 = null, rootPlace = null;
            Item  item = null;

            UserDirectoryApi.AssignRolesToUser(TestConfig.AdminUser, new [] { UserRole.CxmAdmin });
            Parallel.Invoke(
                () => AddAppIbeacon(TestConfig.IbeaconAppVersions[1], true),
                () => place1    = AddPlaceIbeacon(PlaceStatus.Any, pageToBeOpened: 0, isCreateNewPlace: true),
                () => place2    = AddPlaceIbeacon(PlaceStatus.Any, pageToBeOpened: 0, isCreateNewPlace: true),
                () => place3    = AddPlaceWw(PlaceStatus.Any, pageToBeOpened: 0, isCreateNewPlace: true),
                () => rootPlace = AddPlaceNoType(PlaceStatus.Any, pageToBeOpened: 0, isCreateNewPlace: true),
                () => item      = AddItem(ItemType.PorscheCar, isAddNew: true)
                );
            TestStart();

            OpenEntityPage(item);
            EditForm();
            ClickUntilShown(ItemsPage.AssignedPlacesAddButton, ItemsPage.AssignedPlacesPlaceDropDown);
            ClickUntilShown(ItemsPage.AssignedPlacesPlaceDropDown, CommonElement.DropDownOptionList);
            Assert.IsTrue(IsElementFoundQuickly(string.Format(CommonElement.DropDownOption, place1.Title)),
                          $"Assigned places: dropdown should contain place {place1.Title}");
            Assert.IsTrue(IsElementFoundQuickly(string.Format(CommonElement.DropDownOption, place2.Title)),
                          $"Assigned places: dropdown should contain place {place2.Title}");
            Assert.IsTrue(IsElementNotFoundQuickly(string.Format(CommonElement.DropDownOption, place3.Title)),
                          $"Assigned places: dropdown should not contain WW place {place3.Title}");
            if (rootPlace != null)
            {
                Assert.IsTrue(IsElementNotFoundQuickly(string.Format(CommonElement.DropDownOption, rootPlace.Title)),
                              $"Assigned places: dropdown should not contain root place {rootPlace.Title}");
            }

            DropDownSelect(ItemsPage.AssignedPlacesPlaceDropDown, place1.Title);
            SubmitForm();
            Assert.IsTrue(AreElementsContainText(ItemsPage.ReferencesSectionPlaces, place1.Title),
                          $"References: Field Places should contain place {place1.Title}");

            Click(string.Format(ItemsPage.ReferencesSectionPlaceByTitle, place1.Title));
            Assert.IsTrue(IsPageContainsUri($"{TestConfig.PlaceUri}/{place1.Id}"),
                          $"Place {place1.Title} page should be opened");
            Assert.IsTrue(IsElementFoundQuickly(string.Format(PlacesPage.ItemsSectionItemByTitle, item.LangJsonData.EnJson.Title)),
                          $"Items section: place should contain item {item.LangJsonData.EnJson.Title}");

            Click(string.Format(PlacesPage.ItemsSectionItemByTitle, item.LangJsonData.EnJson.Title));
            Assert.IsTrue(IsViewMode(), "Place should stay in view mode");

            Click(PageFooter.DeleteButton);
            Click(PlacesPage.DeleteButton);
            OpenEntityPage(item);
            Assert.IsTrue(AreElementsContainText(ItemsPage.ReferencesSectionPlaces, place1.Title),
                          $"References: Field Places should contain place {place1.Title}");

            Click(string.Format(ItemsPage.ReferencesSectionPlaceByTitle, place1.Title));
            Click(PageFooter.RestoreButton);
            SubmitForm();
            OpenEntityPage(item);
            Assert.IsTrue(AreElementsContainText(ItemsPage.ReferencesSectionPlaces, place1.Title),
                          $"References: Field Places should contain place {place1.Title}");

            EditForm();
            ClickUntilConditionMet(ItemsPage.AssignedPlacesAddButton,
                                   () => CountElements(ItemsPage.AssignedPlacesPlaceDropDown) == 2);
            ClickUntilShown(ItemsPage.AssignedPlacesPlaceLastDropDown, CommonElement.DropDownOptionList);
            Assert.IsTrue(AreElementsContainText(CommonElement.DropDownOptionList, place2.Title),
                          $"Assigned places: last dropdown should contain place {place2.Title}");

            DropDownSelect(ItemsPage.AssignedPlacesPlaceLastDropDown, place2.Title);
            ClickUntilConditionMet(ItemsPage.AssignedPlacesAddButton,
                                   () => CountElements(ItemsPage.AssignedPlacesPlaceDropDown) == 3);
            Click(ItemsPage.AssignedPlacesPlaceLastDropDown);
            Assert.IsTrue(IsElementNotFoundQuickly(CommonElement.DropDownOptionList) ||
                          (!AreElementsContainText(CommonElement.DropDownOptionList, place2.Title) &&
                           !AreElementsContainText(CommonElement.DropDownOptionList, place1.Title)),
                          $"Assigned places: last dropdown should not contain places {place2.Title} and {place1.Title}");

            Click(ItemsPage.AssignedPlacesDeleteLastButton);
            SubmitForm();
            Assert.IsTrue(AreElementsContainText(ItemsPage.ReferencesSectionPlaces, place1.Title),
                          $"References: Field Places should contain place {place1.Title}");
            Assert.IsTrue(AreElementsContainText(ItemsPage.ReferencesSectionPlaces, place2.Title),
                          $"References: Field Places should contain place {place2.Title}");

            EditForm();
            Click(ItemsPage.AssignedPlacesDeleteButton);
            SubmitForm();
            Assert.IsTrue(!AreElementsContainText(ItemsPage.ReferencesSectionPlaces, place1.Title),
                          $"References: Field Places should not contain place {place1.Title}");
            Assert.IsTrue(AreElementsContainText(ItemsPage.ReferencesSectionPlaces, place2.Title),
                          $"References: Field Places should contain place {place2.Title}");

            Click(PageFooter.DeleteButton);
            Assert.IsTrue(IsElementFound(ItemsPage.ItemIsReferencedDialog),
                          $@"'This item is referenced in {place2.Title}...' dialog should be displayed");

            Click(ItemsPage.OkButton);
            Assert.IsTrue(IsElementNotFound(ItemsPage.ItemIsReferencedDialog),
                          $@"'This item is referenced in {place2.Title}...' dialog should be closed");
            Assert.IsTrue(IsElementNotFoundQuickly(PageFooter.RestoreButton),
                          "Item should not be deleted");

            Click(string.Format(ItemsPage.ReferencesSectionPlaceByTitle, place2.Title));
            EditForm();
            var itemTitle = item.LangJsonData.EnJson.Title;

            Assert.IsTrue(IsElementFoundQuickly(
                              string.Format(PlacesPage.ItemsSectionItemByTitleUnassignButton, itemTitle)),
                          @"Items section: All items should have text 'Unassign'");

            Click(string.Format(PlacesPage.ItemsSectionItemByTitleUnassignButton, itemTitle));
            Assert.IsTrue(IsElementFoundQuickly(PlacesPage.DoYouWantToUnassignDialog),
                          @"Dialog 'Do you really want to unassign this item?' should be displayed");

            Click(PlacesPage.UnassignButton);
            Assert.IsTrue(IsElementNotFoundQuickly(PlacesPage.DoYouWantToUnassignDialog),
                          @"Dialog 'Do you really want to unassign this item?' should be closed");
            Assert.IsTrue(IsElementNotFoundQuickly(
                              string.Format(PlacesPage.ItemsSectionItemByTitleUnassignButton, place2.Title)),
                          $"Items section: item {itemTitle} should be unassigned (absent)");
            Assert.IsTrue(IsEditMode(), "Place should stay in edit mode");

            SubmitForm();
            OpenEntityPage(item);
            Assert.IsTrue(IsElementNotFound(ItemsPage.ReferencesSectionPlaces),
                          "Reference section should be absent");

            Click(PageFooter.DeleteButton);
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.DeleteConfirmationDialog),
                          "Item delete confirmation dialog should be displayed");

            Click(ItemsPage.DeleteButton);
            Assert.IsTrue(IsPageContainsUri(TestConfig.ItemsUri), "Page Items should be opened");
        }
コード例 #9
0
        public void RT04450_CheckPlaceTimestamps()
        {
            TestStart();
            var place = AddPlaceNoType(PlaceStatus.Active, isCreateNewPlace: true);

            EditForm();
            Click(PlacesPage.PlaceMapUploadButton);
            FileManager.Upload(TestConfig.Image138);
            SendText(PlacesPage.PlaceWidth, "10");
            SendText(PlacesPage.ToleranceRadius, "20");
            SendText(PlacesPage.Position, "50.3333, 40.5555");
            SubmitForm();
            var positionParent        = GetValue(PlacesPage.PositionReadOnly);
            var toleranceRadiusParent = GetValue(PlacesPage.ToleranceRadiusReadOnly);

            OpenPlacesPage();
            Click(PageFooter.AddPlaceButton);
            DropDownSelect(PlacesPage.DeviceTypeDropDown, DeviceTypeIbeacon);
            var placeIbeaconTitle = $"Auto test {RandomNumber}";

            SendText(PlacesPage.Title, placeIbeaconTitle);
            DropDownSelect(PlacesPage.TimezoneDropDown, TimezoneKiev);
            OpenDevicesFromPlace();
            Click(Devices.TableRow); // any existing device
            SubmitForm();
            var created1  = GetTimestamp(PlacesPage.Created, true);
            var modified1 = GetTimestamp(PlacesPage.Modified);
            var since1    = GetTimestamp(PlacesPage.Since);

            Assert.IsTrue(Math.Abs((created1.Item1 - modified1.Item1).Seconds) <= 10,
                          "Created timestamp data should be equal to Modified field data");
            Assert.IsTrue(Math.Abs((created1.Item1 - since1.Item1).Seconds) <= 10,
                          "Since should display a timestamp that equals Created and Modified");
            var userProperties = UserDirectoryApi.GetUserData(TestConfig.AdminUser);
            var userName       = $" ({userProperties.GivenName} {userProperties.FamilyName})";

            Assert.IsTrue(created1.Item2.Contains(userName),
                          "Created should contain current user firstname and lastname");
            Assert.IsTrue(modified1.Item2.Contains(userName),
                          "Modified should contain current user firstname and lastname");

            WaitTime(2);
            EditForm();
            var newTitle = $"Auto test {RandomNumber}";

            SendText(PlacesPage.Title, newTitle);
            SubmitForm();
            var created2  = GetTimestamp(PlacesPage.Created, true);
            var modified2 = GetTimestamp(PlacesPage.Modified);
            var since2    = GetTimestamp(PlacesPage.Since);

            Assert.IsTrue(created1.Equals(created2), "Created timestamp and user data should never change");
            Assert.IsTrue(since1.Item1 == since2.Item1, "Since should not change after this submit");
            Assert.IsTrue(modified2.Item1 > modified1.Item1,
                          "After submit Modified should be equal to current time");

            WaitTime(2);
            EditForm();
            OpenDevicesFromPlace();
            Click(Devices.ClearSelectionButton);
            SubmitForm();
            var created3  = GetTimestamp(PlacesPage.Created, true);
            var modified3 = GetTimestamp(PlacesPage.Modified);
            var since3    = GetTimestamp(PlacesPage.Since);

            Assert.IsTrue(created1.Equals(created3), "Created timestamp and user data should never change");
            Assert.IsTrue(modified3.Item1 > modified2.Item1,
                          "After submit Modified should be equal to current time");
            Assert.IsTrue(Math.Abs((modified3.Item1 - since3.Item1).Seconds) <= 10,
                          "After submit Since should be equal to current time");
            Assert.IsTrue(modified3.Item2.Contains(userName),
                          "Modified should contain current user firstname and lastname");

            WaitTime(2);
            EditForm();
            OpenDevicesFromPlace();
            Click(Devices.TableRow); // any existing device
            SubmitForm();
            var created4  = GetTimestamp(PlacesPage.Created, true);
            var modified4 = GetTimestamp(PlacesPage.Modified);
            var since4    = GetTimestamp(PlacesPage.Since);

            Assert.IsTrue(created1.Equals(created4), "Created timestamp and user data should never change");
            Assert.IsTrue(modified4.Item1 > modified3.Item1,
                          "After submit Modified should be equal to current time");
            Assert.IsTrue(since4.Item1 > since3.Item1, "After submit Since should be equal to current time");
            Assert.IsTrue(modified4.Item2.Contains(userName),
                          "Modified should contain current user firstname and lastname");

            WaitTime(2);
            EditForm();
            DropDownSelect(PlacesPage.TimezoneDropDown, TimezoneLondon);
            SubmitForm();
            var since     = CleanUpString(GetValue(PlacesPage.Since, true));
            var created5  = GetTimestamp(PlacesPage.Created);
            var modified5 = GetTimestamp(PlacesPage.Modified);
            var since5    = GetTimestamp(PlacesPage.Since);
            var timeSince = ((DateTimeOffset)Convert.ToDateTime(since.Substring(since.IndexOf(' '))))
                            .ToOffset(TimeZoneInfo.Local.BaseUtcOffset.Subtract(
                                          TimeSpan.FromHours(DateTime.Now.IsDaylightSavingTime() ? 0 : 1)));

            Assert.IsTrue(created1.Equals(created5), "Created timestamp and user data should never change");
            Assert.IsTrue(modified5.Item1 > modified4.Item1, "After submit Modified should be equal to current time");
            Assert.IsTrue(Math.Abs((since5.Item1 - timeSince).Seconds) <= 10,
                          "After submit Since should be equal to London time");
            Assert.IsTrue(modified5.Item2.Contains(userName), "Modified should contain current user firstname and lastname");

            OpenEntityPage(place);
            MouseOver(PageFooter.AddPlaceSubMenu);
            Click(PageFooter.AddExistingPlaceAsChildButton);
            Click(string.Format(PlacesPage.TableRowByTitle, newTitle));
            SubmitForm();
            OpenPlacesPage();
            SetFilter(newTitle);
            Click(string.Format(PlacesPage.TableRowByTitle, newTitle));
            var created6  = GetTimestamp(PlacesPage.Created, true);
            var modified6 = GetTimestamp(PlacesPage.Modified);
            var since6    = GetTimestamp(PlacesPage.Since);

            Assert.IsTrue(created1.Equals(created6), $"Created for iBeacon place {newTitle} has changed");
            Assert.IsTrue(modified6.Item1 == modified5.Item1, $"Modified for iBeacon place {newTitle} has changed");
            Assert.IsTrue(since6.Item1 == since5.Item1, $"Since for iBeacon place {newTitle} has changed");
            Assert.IsTrue(GetValue(PlacesPage.TimezoneReadOnly).Contains(TimezoneLondon),
                          $"Timezone for iBeacon place {newTitle} has changed");

            Click(PageFooter.DuplicateButton);
            var titleDuplicate = $"Auto test {RandomNumber}";

            SendText(PlacesPage.Title, titleDuplicate);
            SubmitForm();
            since = CleanUpString(GetValue(PlacesPage.Since, true));
            var created7  = GetTimestamp(PlacesPage.Created);
            var modified7 = GetTimestamp(PlacesPage.Modified);
            var since7    = GetTimestamp(PlacesPage.Since);

            timeSince = ((DateTimeOffset)Convert.ToDateTime(since.Substring(since.IndexOf(' '))))
                        .ToOffset(TimeZoneInfo.Local.BaseUtcOffset.Subtract(
                                      TimeSpan.FromHours(DateTime.Now.IsDaylightSavingTime() ? 0 : 1)));
            Assert.IsTrue(Math.Abs((created7.Item1 - modified7.Item1).Seconds) <= 10,
                          "Duplicate place Created timestamp and user data should be equal to Modified field data");
            Assert.IsTrue(Math.Abs((since7.Item1 - timeSince).Seconds) <= 10,
                          $"Duplicate place Since should be equal to its timezone time: {timeSince}");
            Assert.IsTrue(IsElementNotFoundQuickly(PlacesPage.ChildPlacesSectionTableHeader),
                          "Duplicate place should not have any children");

            OpenEntityPage(place);
            Assert.IsFalse(AreElementsContainText(PlacesPage.ChildPlacesSectionTableRowsColumnTitle, titleDuplicate),
                           $@"Duplicate place '{titleDuplicate}' should not be a child of parent '{place.Title}'");
            Assert.IsTrue(IsElementFoundQuickly(PlacesPage.PlaceMapImageInline),
                          "Place Map in duplicate place should have a pre-loaded map");
            Assert.IsTrue(IsElementEquals(PlacesPage.PositionReadOnly, positionParent),
                          "Position field has changed in duplicate place");
            Assert.IsTrue(GetValue(PlacesPage.ToleranceRadiusReadOnly) == toleranceRadiusParent,
                          "Tolerance Radius field has changed in duplicate place");
        }
コード例 #10
0
        public void RT12010_ItemTypesModels()
        {
            TestStart();

            OpenAppsPage();
            Click(PageFooter.AddAppInAppsButton);
            var pathFile = FileManager.GetFileByVersion(TestConfig.DptMobileAppFolder,
                                                        TestConfig.DptMobileAppFile, TestConfig.DptAppVersions[1]);

            FileManager.Upload(pathFile);
            Assert.IsTrue(IsEditMode(),
                          $"DPT app v.{TestConfig.DptAppVersions[1]} should be imported without {AppTitle.IpadPlayer} " +
                          "and in edit mode");
            var allPermissions = UserDirectoryApi.GetSupportedPermissions();
            var role           = UserDirectoryApi.GetRole((long)UserRole.CxmAdmin);

            UserDirectoryApi.SetRolePermissions(role, allPermissions);
            RefreshPage();
            SendText(AppsPage.Market, "AA");
            SubmitForm();
            Assert.IsTrue(IsViewMode(),
                          $"DPT app v.{TestConfig.DptAppVersions[1]} should be in view mode");

            OpenItemsPage();
            Click(PageFooter.AddItemButton);
            DropDownSelect(ItemsPage.TypeDropDown, ItemTypePorscheCar);
            SendText(ItemsPage.Vin, $"{RandomNumber}55");
            SendText(ItemsPage.Title, $"Auto test {RandomNumber}");
            ClickUntilShown(ItemsPage.FinanceOfferButton, ItemsPage.FinanceOfferOptionDropDown);
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.FinanceOfferOptionDropDown),
                          "Finance Offer > Option drop-down should be shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.FinanceOfferPrepayment),
                          "Finance Offer > Prepayment should be shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.FinanceOfferTerm),
                          "Finance Offer > Term should be shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.FinanceOfferMonthlyRate),
                          "Finance Offer > Monthly Rate should be shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.FinanceOfferDisclaimer),
                          "Finance Offer > Disclaimer should be shown");
            Assert.IsTrue(IsElementNotFoundQuickly(CommonElement.ValidationError),
                          "Finance Offer > No validation errors should be shown");

            DropDownSelect(ItemsPage.FinanceOfferOptionDropDown, "Porsche Value S");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ErrorFinanceOfferPrepaymentRequired),
                          @"Finance Offer > Error 'Prepayment required' should be shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ErrorFinanceOfferTermRequired),
                          @"Finance Offer > Error 'Term required' should be shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ErrorFinanceOfferMonthlyRateRequired),
                          @"Finance Offer > Error 'Monthly required' Rate should be shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ErrorFinanceOfferDisclaimerRequired),
                          @"Finance Offer > Error 'Disclaimer required' should be shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferOptionRequired),
                          @"Finance Offer > Error for Option drop-down should be not shown");

            SendText(ItemsPage.FinanceOfferPrepayment, "A");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferPrepaymentRequired),
                          @"Finance Offer > Error 'Prepayment required' should be not shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ErrorFinanceOfferTermRequired),
                          @"Finance Offer > Error 'Term required' should be shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ErrorFinanceOfferMonthlyRateRequired),
                          @"Finance Offer > Error 'Monthly required' Rate should be shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ErrorFinanceOfferDisclaimerRequired),
                          @"Finance Offer > Error 'Disclaimer required' should be shown");

            SendText(ItemsPage.FinanceOfferTerm, "A");
            SendText(ItemsPage.FinanceOfferMonthlyRate, "A");
            SendText(ItemsPage.FinanceOfferDisclaimer, "A");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferPrepaymentRequired),
                          @"Finance Offer > Error 'Prepayment required' should be shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferTermRequired),
                          @"Finance Offer > Error 'Term required' should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferMonthlyRateRequired),
                          @"Finance Offer > Error 'Monthly required' Rate should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferDisclaimerRequired),
                          @"Finance Offer > Error 'Disclaimer required' should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferOptionRequired),
                          @"Finance Offer > Error for Option drop-down should be not shown");

            ClearTextInElement(ItemsPage.FinanceOfferTerm);
            ClearTextInElement(ItemsPage.FinanceOfferDisclaimer);
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ErrorFinanceOfferTermRequired),
                          @"Finance Offer > Error 'Term required' should be shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ErrorFinanceOfferDisclaimerRequired),
                          @"Finance Offer > Error 'Disclaimer required' should be shown");

            ClearTextInElement(ItemsPage.FinanceOfferPrepayment);
            ClearTextInElement(ItemsPage.FinanceOfferMonthlyRate);
            DropDownSelect(ItemsPage.FinanceOfferOptionDropDown, string.Empty);
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferPrepaymentRequired),
                          @"Finance Offer > Error 'Prepayment required' should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferTermRequired),
                          @"Finance Offer > Error 'Term required' should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferMonthlyRateRequired),
                          @"Finance Offer > Error 'Monthly required' Rate should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferDisclaimerRequired),
                          @"Finance Offer > Error 'Disclaimer required' should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferOptionRequired),
                          @"Finance Offer > Error for Option drop-down should be not shown");

            SendText(ItemsPage.FinanceOfferDisclaimer, "A");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferPrepaymentRequired),
                          @"Finance Offer > Error 'Prepayment required' should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferTermRequired),
                          @"Finance Offer > Error 'Term required' should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferMonthlyRateRequired),
                          @"Finance Offer > Error 'Monthly required' Rate should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferDisclaimerRequired),
                          @"Finance Offer > Error 'Disclaimer required' should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferOptionRequired),
                          @"Finance Offer > Error for Option drop-down should be not shown");

            SubmitForm();
            Assert.IsTrue(IsViewMode(), "Item should be successfully saved");
            var itemId = GetEntityIdFromUrl();

            OpenAppsPage();
            Click(PageFooter.AddAppInAppsButton);
            pathFile = FileManager.GetFileByVersion(TestConfig.DptMobileAppFolder,
                                                    TestConfig.DptMobileAppFile, TestConfig.DptAppVersions[2]);
            FileManager.UploadAsBackgroundTask(pathFile);
            SubmitForm();
            Assert.IsTrue(IsViewMode(),
                          $"DPT app v.{TestConfig.DptAppVersions[2]} should be in view mode");

            RefreshPage();
            OpenEntityPage <Item>(itemId);
            EditForm();
            ClickUntilShown(ItemsPage.FinanceOfferButton, ItemsPage.FinanceOfferOptionDropDown);
            DropDownSelect(ItemsPage.FinanceOfferOptionDropDown, "Porsche Value S");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferPrepaymentRequired),
                          @"Finance Offer > Error 'Prepayment required' should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferTermRequired),
                          @"Finance Offer > Error 'Term required' should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferMonthlyRateRequired),
                          @"Finance Offer > Error 'Monthly required' Rate should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferDisclaimerRequired),
                          @"Finance Offer > Error 'Disclaimer required' should be not shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferOptionRequired),
                          @"Finance Offer > Error for Option drop-down should be not shown");

            SendText(ItemsPage.FinanceOfferPrepayment, "A");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferPrepaymentRequired),
                          @"Finance Offer > Error 'Prepayment required' should be not shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ErrorFinanceOfferTermRequired),
                          @"Finance Offer > Error 'Term required' should be shown");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ErrorFinanceOfferMonthlyRateRequired),
                          @"Finance Offer > Error 'Monthly required' Rate should be shown");
            Assert.IsTrue(IsElementNotFoundQuickly(ItemsPage.ErrorFinanceOfferDisclaimerRequired),
                          @"Finance Offer > Error 'Disclaimer required' should be not shown");

            Click(PageFooter.CancelButton);
        }
コード例 #11
0
        public void RT12020_AppMasterData()
        {
            AddAppIpadPlayer();
            var app = AddAppDpt(AppStatus.Any, TestConfig.DptAppVersions[1]);

            TestStart();

            OpenAppsPage();
            Click(PageFooter.AddAppInAppsButton);
            var pathFile = FileManager.GetFileByVersion(TestConfig.TestDependenciesDptAppFolder,
                                                        TestConfig.TestDependenciesDptAppFile,
                                                        TestConfig.TestDependenciesMdVersions[0]);

            FileManager.UploadAsBackgroundTask(pathFile);
            Assert.IsTrue(IsElementFound(AppsPage.AppTitle),
                          $@"App '{AppTitle.TestDependenciesMd}' has not been imported");
            var allPermissions = UserDirectoryApi.GetSupportedPermissions();
            var role           = UserDirectoryApi.GetRole((long)UserRole.CxmAdmin);

            UserDirectoryApi.SetRolePermissions(role, allPermissions);
            RefreshPage();

            const string market = "CC";

            SendText(AppsPage.Market, market);
            SubmitForm();
            Assert.IsTrue(IsViewMode(),
                          $@"'{AppTitle.TestDependenciesMd}' app should be in view mode on submit");

            Click(PageFooter.AddVersionButton);
            pathFile = FileManager.GetFileByVersion(TestConfig.TestDependenciesDptAppFolder,
                                                    TestConfig.TestDependenciesDptAppFile,
                                                    TestConfig.TestDependenciesMdVersions[1]);
            FileManager.UploadAsBackgroundTask(pathFile);
            Assert.IsTrue(IsElementEquals(AppsPage.Market, market),
                          $@"Market field should kept value '{market}' on 2nd app version upload");
            Assert.IsTrue(IsElementNotFoundQuickly(CommonElement.ValidationError),
                          "Page should have no validation errors on 2nd app version upload");

            SendText(AppsPage.Area, "a");
            Assert.IsTrue(IsElementNotFoundQuickly(AppsPage.ErrorArea),
                          "Area should have no validation errors");
            Assert.IsTrue(IsElementFoundQuickly(AppsPage.ErrorRegion),
                          "Region should have validation error");
            Assert.IsTrue(IsElementNotFoundQuickly(AppsPage.ErrorMarket),
                          "Market should have no validation errors");

            ClearTextInElement(AppsPage.Market);
            Assert.IsTrue(IsElementNotFoundQuickly(AppsPage.ErrorArea),
                          "Area should have no validation errors");
            Assert.IsTrue(IsElementFoundQuickly(AppsPage.ErrorRegion),
                          "Region should have validation error");
            Assert.IsTrue(IsElementFoundQuickly(AppsPage.ErrorMarket),
                          "Market should have validation error");

            ClearTextInElement(AppsPage.Area);
            Assert.IsTrue(IsElementNotFoundQuickly(AppsPage.ErrorArea),
                          "Area should have no validation errors");
            Assert.IsTrue(IsElementNotFoundQuickly(AppsPage.ErrorRegion),
                          "Region should have no validation errors");
            Assert.IsTrue(IsElementFoundQuickly(AppsPage.ErrorMarket),
                          "Market should have validation error");

            SendText(AppsPage.Market, market);
            SendText(AppsPage.Area, "a");
            SendText(AppsPage.Region, "a");
            SubmitForm();
            Assert.IsTrue(IsViewMode(),
                          $"{AppTitle.TestDependenciesMd} app should be in view mode on submit");
            var appId = GetEntityIdFromUrl();

            OpenEntityPage(app);
            EditForm();
            SendText(AppsPage.Area, "a");
            Assert.IsTrue(IsElementNotFoundQuickly(CommonElement.ValidationError),
                          $"App {AppTitle.Dpt} page should have no validation errors");

            Click(PageFooter.CancelButton);
            OpenEntityPage <AppResponse>(appId);
            Click(AppsPage.Versions);
            Click(string.Format(AppsPage.TableRowByText, TestConfig.TestDependenciesMdVersions[1]));
            Click(PageFooter.DeleteButton);
            Click(AppsPage.DeleteButton);
            Click(PageHeader.NavigateBackButton);
            EditForm();
            ClearTextInElement(AppsPage.Region);
            Assert.IsTrue(IsElementNotFoundQuickly(CommonElement.ValidationError),
                          $"App {AppTitle.Dpt} page should have no validation errors after the latest version delete");

            SubmitForm();
            Assert.IsTrue(IsViewMode(),
                          $"{AppTitle.TestDependenciesMd} app should be in view mode after the latest version delete and submit");
        }
コード例 #12
0
        // daily report emails send at 8:00 AM (Europe/Kiev),
        // this test needs some time to prepare environment, so run it before 7:59 AM
        public void RT07310_FollowItemsEmailReport()
        {
            if (DateTime.Now.TimeOfDay > new TimeSpan(07, 59, 00))
            {
                Assert.Inconclusive("Canceled run. The test should be started before 07:59 AM");
            }
            CurrentTenant = TenantTitle.reportitems;
            var userProperties = UserDirectoryApi.GetUserData(TestConfig.NewUser);

            if (userProperties == null)
            {
                AccountApi.CreateNewAccount(TestConfig.NewUser);
                UserDirectoryApi.SetUserStatus(TestConfig.NewUser, UserStatus.Active);
                UserDirectoryApi.AssignRolesToUser(TestConfig.NewUser,
                                                   new [] { UserRole.CxmAdmin });
                userProperties = UserDirectoryApi.GetUserData(TestConfig.NewUser);
            }
            CurrentUser = TestConfig.NewUser;
            const string itemTitle = "Daily report template";
            var          itemsReportEmailSubject = $"Items report {CurrentTenantCode}";
            Item         item = null, custItem1 = null, custItem2 = null;
            var          app       = AddAppIbeacon(TestConfig.IbeaconAppVersions[1], true);

            Parallel.Invoke(
                () => item = ItemApi.SearchItem(itemTitle),
                () => AddPlaceNoType(PlaceStatus.NoDevice, isAddChild: false, pageToBeOpened: 0,
                                     isCreateNewPlace: true),
                () => AddItem(ItemType.Employee),
                () => AddItem(ItemType.CustomerProfile, isAddNew: true),
                () => AddItem(ItemType.Car),
                () => custItem1 = AddItem(ItemType.CustomerProfile, isAddNew: true),
                () => custItem2 = AddItem(ItemType.CustomerProfile, isAddNew: true),
                () => ItemApi.FollowItems(ItemType.CustomerProfile),
                () => ItemApi.FollowItems(ItemType.Car),
                () => ItemApi.FollowItems(ItemType.Employee)
                );
            Assert.IsNotNull(item,
                             $@"Item '{itemTitle}' not found. Is iBeacon app imported and available on tenant " +
                             $"{CurrentTenantCode}?");
            AddItemToIbeaconApp(app, "$.texts.emails.itemsFollowReportTemplate", item);

            Parallel.Invoke(
                () => _mm.InboxHousekeeping(_mm.ClientCxM),
                () => ItemApi.DeleteItem(custItem1.Id),
                () => ItemApi.SaveItem(custItem2),
                () => AddItem(ItemType.PorscheCar, isAddNew: true),
                () => AddItem(ItemType.CustomerProfile, isAddNew: true),
                () => AddItem(ItemType.UsedCar, isAddNew: true),
                () => AddItem(ItemType.ServiceBooking, isAddNew: true)
                );

            // it's time to start checking mail box
            WaitForTimeOfDay(new TimeSpan(08, 00, 00));
            // expects a new email within 600 seconds
            var gotNewMail         = WaitForNewMail(_mm.ClientCxM, 600);

            Assert.IsTrue(gotNewMail, $"There is no new daily report found in mailbox {TestConfig.MailServerLogin}");

            var hasUserName        = _mm.IsMailBodyContainsText(
                _mm.ClientCxM,
                itemsReportEmailSubject,
                $"{userProperties.GivenName} {userProperties.FamilyName}");

            Assert.IsTrue(hasUserName, "Item report email has no user firstname or lastname");

            var tenantTitle        = CurrentTenant.ToString();
            var hasTenantTitle     = _mm.IsMailBodyContainsText(
                _mm.ClientCxM,
                itemsReportEmailSubject,
                tenantTitle);

            Assert.IsTrue(hasTenantTitle, $@"Item report email has no tenant title '{tenantTitle}'");

            var custProfileContent = $"{ItemTypeCustomerProfile}: 1 new {ItemTypeCustomerProfile}, " +
                                     $"1 updated {ItemTypeCustomerProfile}, 1 deleted {ItemTypeCustomerProfile}";
            var hasCustProfileInfo = _mm.IsMailBodyContainsText(
                _mm.ClientCxM,
                itemsReportEmailSubject,
                custProfileContent);

            Assert.IsTrue(hasCustProfileInfo, $@"Item report email has no text: '{custProfileContent}'");

            var hasPorscheCarsAndUsedCars = _mm.IsMailBodyContainsText(
                _mm.ClientCxM,
                itemsReportEmailSubject,
                $"{ItemTypePorscheCar}s, {ItemTypeUsedCar}s");

            Assert.IsTrue(hasPorscheCarsAndUsedCars,
                          "Item report email has no info about updated item types: " +
                          $@"'{ItemTypePorscheCar}s, {ItemTypeUsedCar}s'");

            var hasPorscheCarsInfo = _mm.IsMailBodyContainsText(
                _mm.ClientCxM,
                itemsReportEmailSubject,
                $"{ItemTypePorscheCar}: 1 new {ItemTypePorscheCar}");

            Assert.IsTrue(hasPorscheCarsInfo,
                          $@"Item report email has no info about followed item: '{ItemTypePorscheCar}: 1 new " +
                          $@"{ItemTypePorscheCar}'");

            var hasUsedCarsInfo = _mm.IsMailBodyContainsText(
                _mm.ClientCxM,
                itemsReportEmailSubject,
                $"{ItemTypeUsedCar}: 1 new {ItemTypeUsedCar}");

            Assert.IsTrue(hasUsedCarsInfo,
                          $@"Item report email has no info about followed item: '{ItemTypeUsedCar}: 1 new " +
                          $@"{ItemTypeUsedCar}'");

            var hasNoEmployeeInfo = _mm.IsMailBodyContainsText(
                _mm.ClientCxM,
                itemsReportEmailSubject,
                ItemTypeEmployee);

            Assert.IsTrue(hasNoEmployeeInfo,
                          $"Item report email must contain no {ItemTypeEmployee} items info");

            var hasNoServiceBookingInfo = _mm.IsMailBodyContainsText(
                _mm.ClientCxM,
                itemsReportEmailSubject,
                ItemTypeServiceBooking);

            Assert.IsTrue(hasNoServiceBookingInfo,
                          $"Item report email must contain no {ItemTypeServiceBooking} items info");
        }
コード例 #13
0
        public void RT09010_Models()
        {
            var newUser = new User
            {
                Email    = $"Auto{RandomNumber}@ameria.de",
                Password = CurrentUser.Password
            };

            Parallel.Invoke(
                () => AccountApi.CreateNewAccount(newUser),
                () => _role = UserDirectoryApi.SetRolePermissions(
                    _role,
                    "Login",
                    "GetAnyLocation",
                    "ImportApp",
                    "GetAnyApp",
                    "ModifyOwnApp",
                    "ModifyAnyApp",
                    "ImportAppVersion",
                    "DeleteOwnAppVersion",
                    "DeleteAnyAppVersion",
                    "ChangePorscheCar",
                    "ModifyPorschePdfCar",
                    "ModifyPorscheUsedCar",
                    "ViewPorscheCar",
                    "ViewPorschePdfCar",
                    "ViewPorscheUsedCar"),
                () => AddAppDpt(AppStatus.Any, TestConfig.DptAppVersions[0])
                );
            UserDirectoryApi.SetUserStatus(newUser, UserStatus.Active);
            UserDirectoryApi.AddRoleToUser(newUser, _role, TenantTitle.import);
            CurrentUser = newUser;
            TestStart(isSelectTenant: false);

            OpenItemsPage();
            Click(PageFooter.AddItemButton);
            ClickUntilShown(ItemsPage.TypeDropDown, CommonElement.DropDownOptionList);
            var availableTypes = new List <string>
            {
                ItemTypeCars, ItemTypePorscheCar, ItemTypeUsedCar, ItemTypePdfCar
            };

            Assert.IsTrue(AreCollectionsEqual(GetElementsText(CommonElement.DropDownOptionList), availableTypes),
                          "Only following item types should be available: " + string.Join(", ", availableTypes));

            OpenAppsPage();
            Click(PageFooter.AddAppInAppsButton);
            var name = FileManager.GetFileByVersion(TestConfig.DptMobileAppFolderRt09010,
                                                    TestConfig.DptMobileAppFileRt09010, TestConfig.DptAppEarliestVersionRt09010);

            FileManager.Upload(name);
            Assert.IsTrue(IsElementFound(AppsPage.YouDontHavePermissionsDialog),
                          @"Error dialog 'You don't have permissions to modify models' should be shown");

            Click(AppsPage.OkButton);
            Assert.IsTrue(IsElementNotFoundQuickly(AppsPage.YouDontHavePermissionsDialog),
                          @"Error dialog 'You don't have permissions to modify models' should be closed");
            Assert.IsTrue(IsPageContainsUri(TestConfig.AppsUri), $@"App '{AppName}' should not be uploaded");

            OpenItemsPage();
            Click(PageFooter.AddItemButton);
            ClickUntilShown(ItemsPage.TypeDropDown, CommonElement.DropDownOptionList);
            Assert.IsFalse(AreElementsContainText(CommonElement.DropDownOptionList, AppName),
                           $@"Dropdown Type should not contain '{AppName}'");
            Assert.IsTrue(AreCollectionsEqual(GetElementsText(CommonElement.DropDownOptionList), availableTypes),
                          "Only following item types should be available: " + string.Join(", ", availableTypes));

            UserDirectoryApi.SetRolePermissions(
                _role,
                "Login",
                "GetAnyLocation",
                "ImportApp",
                "GetAnyApp",
                "ModifyOwnApp",
                "ModifyAnyApp",
                "ImportAppVersion",
                "DeleteOwnAppVersion",
                "DeleteAnyAppVersion",
                "ChangePorscheCar",
                "ModifyPorschePdfCar",
                "ModifyPorscheUsedCar",
                "ViewPorscheCar",
                "ViewPorschePdfCar",
                "ViewPorscheUsedCar",
                "ModifyModel");
            OpenAppsPage();
            RefreshPage();
            Click(PageFooter.AddAppInAppsButton);
            FileManager.Upload(name);
            Assert.IsTrue(IsElementFound(AppsPage.YouDontHavePermissionsDialog),
                          @"Error dialog 'You don't have permissions to create models' should be shown");

            Click(AppsPage.OkButton);
            Assert.IsTrue(IsPageContainsUri(TestConfig.AppsUri), $@"App '{AppName}' should not be uploaded");

            OpenItemsPage();
            Click(PageFooter.AddItemButton);
            ClickUntilShown(ItemsPage.TypeDropDown, CommonElement.DropDownOptionList);
            Assert.IsFalse(AreElementsContainText(CommonElement.DropDownOptionList, AppName),
                           $@"Dropdown Type should not contain '{AppName}'");
            Assert.IsTrue(AreCollectionsEqual(GetElementsText(CommonElement.DropDownOptionList), availableTypes),
                          "Only following item types should be available: " + string.Join(", ", availableTypes));

            UserDirectoryApi.SetRolePermissions(
                _role,
                "Login",
                "GetAnyLocation",
                "ImportApp",
                "GetAnyApp",
                "ModifyOwnApp",
                "ModifyAnyApp",
                "ImportAppVersion",
                "DeleteOwnAppVersion",
                "DeleteAnyAppVersion",
                "ChangePorscheCar",
                "ModifyPorschePdfCar",
                "ModifyPorscheUsedCar",
                "ViewPorscheCar",
                "ViewPorschePdfCar",
                "ViewPorscheUsedCar",
                "CreateModel");
            OpenAppsPage();
            RefreshPage();
            Click(PageFooter.AddAppInAppsButton);
            FileManager.Upload(name);
            Assert.IsTrue(IsElementFound(AppsPage.AppTitle) && AreElementsContainText(AppsPage.AppTitle, AppName),
                          $@"App '{AppName}' should be uploaded");

            OpenItemsPage();
            Click(PageFooter.AddItemButton);
            ClickUntilShown(ItemsPage.TypeDropDown, CommonElement.DropDownOptionList);
            Assert.IsFalse(AreElementsContainText(CommonElement.DropDownOptionList, AppName),
                           $@"Dropdown Type should not contain '{AppName}'");
            Assert.IsTrue(AreCollectionsEqual(GetElementsText(CommonElement.DropDownOptionList), availableTypes),
                          "Only following item types should be available: " + string.Join(", ", availableTypes));

            UserDirectoryApi.SetRolePermissions(
                _role,
                "Login",
                "GetAnyLocation",
                "ImportApp",
                "GetAnyApp",
                "ModifyOwnApp",
                "ModifyAnyApp",
                "ImportAppVersion",
                "DeleteOwnAppVersion",
                "DeleteAnyAppVersion",
                "ChangePorscheCar",
                "ModifyPorschePdfCar",
                "ModifyPorscheUsedCar",
                "ViewPorscheCar",
                "ViewPorschePdfCar",
                "ViewPorscheUsedCar",
                "CreateModel",
                "ViewTestmodel1",
                "ModifyTestmodel1");
            OpenItemsPage();
            RefreshPage();
            Click(PageFooter.AddItemButton);
            ClickUntilShown(ItemsPage.TypeDropDown, CommonElement.DropDownOptionList);
            availableTypes.Add(ItemTypeTestModel1);
            Assert.IsTrue(AreCollectionsEqual(GetElementsText(CommonElement.DropDownOptionList), availableTypes),
                          "Only following item types should be available: " + string.Join(", ", availableTypes));

            DropDownSelect(ItemsPage.TypeDropDown, ItemTypeTestModel1);
            Assert.IsTrue(CountElements(ItemsPage.ErrorPlaceholder) == 2,
                          "Title and Picture fields must have validation errors");

            SendText(ItemsPage.Title, "12345678901");
            Assert.IsTrue(IsElementFoundQuickly(ItemsPage.ErrorNotMore10Chars),
                          @"Error 'Not more than 10 characters are allowed' should be shown");

            Click(PageFooter.CancelButton);
            OpenAppsPage();
            Click(PageFooter.AddAppInAppsButton);
            name = FileManager.GetFileByVersion(TestConfig.DptMobileAppFolderRt09010,
                                                TestConfig.DptMobileAppFileRt09010, TestConfig.DptAppLatestVersionRt09010);
            FileManager.Upload(name);
            Assert.IsTrue(IsElementFound(AppsPage.YouDontHavePermissionsDialog),
                          @"Error dialog 'You don't have permissions to create/modify models' should be shown");

            Click(AppsPage.OkButton);
            Assert.IsTrue(IsElementNotFoundQuickly(AppsPage.YouDontHavePermissionsDialog),
                          @"Error dialog 'You don't have permissions to create/modify models' should be closed");
            Assert.IsTrue(IsPageContainsUri(TestConfig.AppsUri), $@"App '{AppName}' should not be uploaded");

            OpenItemsPage();
            Click(PageFooter.AddItemButton);
            DropDownSelect(ItemsPage.TypeDropDown, ItemTypeTestModel1);
            Assert.IsTrue(CountElements(ItemsPage.ErrorPlaceholder) == 2,
                          "Title and Picture fields must have validation errors");

            UserDirectoryApi.SetRolePermissions(
                _role,
                "Login",
                "GetAnyLocation",
                "ImportApp",
                "GetAnyApp",
                "ModifyOwnApp",
                "ModifyAnyApp",
                "ImportAppVersion",
                "DeleteOwnAppVersion",
                "DeleteAnyAppVersion",
                "ChangePorscheCar",
                "ModifyPorschePdfCar",
                "ModifyPorscheUsedCar",
                "ViewPorscheCar",
                "ViewPorschePdfCar",
                "ViewPorscheUsedCar",
                "CreateModel",
                "ViewTestmodel1",
                "ModifyTestmodel1",
                "ModifyModel");
            Click(PageHeader.PageAppsButton);
            Click(ItemsPage.OkButton);
            Click(PageFooter.AddAppInAppsButton);
            FileManager.Upload(name);
            Assert.IsTrue(IsElementFound(AppsPage.AppTitle) && AreElementsContainText(AppsPage.AppTitle, AppName),
                          $@"App '{AppName}' should be uploaded");

            OpenItemsPage();
            RefreshPage();
            Click(PageFooter.AddItemButton);
            DropDownSelect(ItemsPage.TypeDropDown, ItemTypeTestModel1);
            Assert.IsTrue(CountElements(ItemsPage.ErrorPlaceholder) == 1,
                          "AppTitle field only must have validation error");

            SendText(ItemsPage.Title, "12345678901");
            Assert.IsTrue(IsElementNotFoundQuickly(CommonElement.ValidationError), "No validation errors should be shown");

            SubmitForm();
            Assert.IsTrue(IsViewMode(), "Item should be saved successfully");

            OpenItemsPage();
            ClickUntilShown(PageHeader.FilterDropDown, CommonElement.DropDownOptionList);
            Assert.IsTrue(AreElementsContainText(CommonElement.DropDownOptionList, ItemTypeTestModel1),
                          $@"Filter dropdown should contain '{ItemTypeTestModel1}'");
        }