Beispiel #1
0
        public void S_1_004_IdentitiesTest()
        {
            //Precondition
            Actor.AttemptsTo(
                Open.NavigationPanel,
                Pin.NavigationPanel
                );

            //1
            //a, b
            Actor.AttemptsTo(Create.Item.OfItemType("Administration/Identity").BySecondaryMenu());

            //c
            var itemForm = Actor.AsksFor(ItemPageContent.Form);

            foreach (var prop in itemProperties)
            {
                Actor.AttemptsTo(Set.NewValue(prop.Value).ForProperty(prop.Key).OnForm(itemForm));
            }

            //d - f
            var relationshipsPanel = Actor.AsksFor(ItemPageContent.RelationshipsPanel);

            Actor.AttemptsTo(Create.Relationship.InRelationshipsPanel(relationshipsPanel).ViaSelectItems(firstUserSearchCriteria).ByDoubleClick);

            //g, h
            Actor.AttemptsTo(Create.Relationship.InRelationshipsPanel(relationshipsPanel).ViaSelectItems(secondUserSearchCriteria).ByReturnSelected);

            //i
            Actor.AttemptsTo(
                Save.OpenedItem.ByDoneButton(),
                Close.ActiveItemPage.ByCloseButton
                );

            //j
            Actor.AttemptsTo(
                Open.SearchPanel.OfCurrentItemType.BySelectedSecondaryMenu,
                Search.Simple.InMainGrid.With(identitiesSearchCriteria),
                Open.Item.InMainGrid.WithRowNumber(1).ByDoubleClick
                );

            //j.i
            foreach (var prop in itemProperties)
            {
                Actor.ChecksThat(ItemPageState.FieldValue(prop.Key), Is.EqualTo(prop.Value));
            }

            var relationship = Actor.AsksFor(ItemPageContent.CurrentRelationship);

            foreach (var user in userList)
            {
                Actor.ChecksThat(RelationshipGridState.Unfrozen.HasItemWithValueInColumn(relationship, user, namePropLabel), Is.True);
            }

            //k
            Actor.AttemptsTo(
                Close.ActiveItemPage.ByCloseButton,
                Collapse.SecondaryMenu
                );
        }
 private void ChangeProps(ItemPageState pageState, string btnText, string pageTitle, bool isReadOnly)
 {
     if (pageState == ItemPageState.View)
     {
         CanCopy = CanDelete = true;
     }
     else if (pageState == ItemPageState.Edit)
     {
         CanCopy   = false;
         CanDelete = true;
     }
     else
     {
         CanCopy = CanDelete = false;
     }
     PageState     = pageState;
     ActionBtnText = btnText;
     PageTitle     = pageTitle;
     ReadOnly      = isReadOnly;
 }
Beispiel #3
0
 public CreatePage(ItemPageState pageState, int idForItem)
 {
     PageState = pageState;
     IdForItem = idForItem;
 }
Beispiel #4
0
        public void S_1_003_UsersTest()
        {
            //a
            Actor.AttemptsTo(
                Open.NavigationPanel,
                Pin.NavigationPanel
                );

            //b
            Actor.AttemptsTo(Create.Item.OfItemType("Administration/User").BySecondaryMenu());

            //f
            var userForm = Actor.AsksFor(ItemPageContent.Form);

            foreach (var property in itemProperties)
            {
                Actor.AttemptsTo(Set.NewValue(property.Value).ForProperty(property.Key).OnForm(userForm));
            }

            //f.i
            Actor.AttemptsTo(Set.ItemWithData(actorData).ForProperty("manager").OnForm(userForm).ByButton.AndDoubleClick);

            //g
            var commandBar = Actor.AsksFor(ItemPageContent.CommandBar);

            Actor.AttemptsTo(Click.On(ItemCommandBarElements.SaveButtonOf(commandBar)));

            //g.i
            Actor.ChecksThat(ItemPageState.SavingResult, Is.EqualTo(expectedSavingInfo));

            var messageBox = Actor.AsksFor(ItemPageContent.NotificationPopup);

            Actor.ChecksThat(Distance.From(PageElements.Header).To(Side.Bottom).Of(messageBox), CustomIs.InRangeFor(expectedDistance, expectedDistance));
            Actor.ChecksThat(Distance.From(messageBox).To(Side.Right).Of(PageElements.Body), CustomIs.InRangeFor(11, 11));

            //h
            Actor.AttemptsTo(Close.NotificationPopup.ByClickOnIt);

            //h.i
            Actor.ChecksThat(Presence.Of(messageBox), Is.False);

            //i
            Actor.AttemptsTo(
                Save.OpenedItem.ByDoneButton(),
                Close.ActiveItemPage.ByCloseButton
                );

            //j
            Actor.AttemptsTo(
                Open.SearchPanel.OfCurrentItemType.BySelectedSecondaryMenu,
                Clear.SearchCriteria.InMainGrid,
                Search.Simple.InMainGrid.With(new Dictionary <string, string> {
                [columnLabel] = userCarpenter.LoginName
            })
                );

            //k
            Actor.AttemptsTo(Open.Item.InMainGrid.WithValueInCell(columnLabel, userCarpenter.LoginName).ByContextMenu);

            //k.i
            itemProperties["password"]         = "******";
            itemProperties["confirm_password"] = "******";
            itemProperties["manager"]          = userWoods.FirstName + " " + userWoods.LastName;

            foreach (var property in itemProperties)
            {
                Actor.ChecksThat(ItemPageState.FieldValue(property.Key), a => Assert.AreEqual(a.ToString(), property.Value));
            }

            //l
            Actor.AttemptsTo(Close.ActiveItemPage.ByCloseButton);

            //m
            Actor.AttemptsTo(Collapse.SecondaryMenu);

            //n
            Actor.AttemptsTo(
                LogOut.FromInnovator,
                LogIn.ToInnovator.As(userCarpenter));
        }
Beispiel #5
0
        public void S_1_005_ListsTest()
        {
            //Precondition:
            Actor.AttemptsTo(Open.NavigationPanel);
            Actor.AttemptsTo(Pin.NavigationPanel);

            //1
            //a, b
            Actor.AttemptsTo(Create.Item.OfItemType("Administration/List").BySecondaryMenu());

            //i
            var form = Actor.AsksFor(ItemPageContent.Form);

            Actor.AttemptsTo(
                Set.NewValue(listName).ForProperty(PropertyName).OnForm(form),
                Set.NewValue(listDescription).ForProperty(PropertyDescription).OnForm(form)
                );

            //j
            var relationshipsPanel = Actor.AsksFor(ItemPageContent.RelationshipsPanel);

            Actor.AttemptsTo(Select.RelationshipTab.WithName(tabValueName).InRelationshipsPanel(relationshipsPanel));

            var relationship = Actor.AsksFor(ItemPageContent.CurrentRelationship);

            for (var i = 0; i < gridValues.Count; i++)
            {
                Actor.AttemptsTo(Create.Relationship.InRelationshipsPanel(relationshipsPanel).ViaAddRow());
            }

            //k
            for (var i = 0; i < gridValues.Count; i++)
            {
                Actor.AttemptsTo(Select.Item.InRelationshipGrid(relationship).WithRowNumber(i + 1));
                Actor.AttemptsTo(Set.NewValue(gridValues[i][columnLabelName]).ForStringPropertyInCell(i + 1, columnLabelName).OfRelationshipGrid(relationshipsPanel));
                Actor.AttemptsTo(Set.NewValue(gridValues[i][columnValueName]).ForStringPropertyInCell(i + 1, columnValueName).OfRelationshipGrid(relationshipsPanel));
            }

            //l
            Actor.AttemptsTo(Save.OpenedItem.BySaveButton);

            for (var i = 0; i < gridValues.Count; i++)
            {
                Actor.ChecksThat(RelationshipGridState.Unfrozen.CellValue(relationship, i + 1, columnSortOrderName), Is.EqualTo(gridValues[i][columnSortOrderName]));
            }

            Actor.ChecksThat(RelationshipGridState.GridData(relationship), Is.EquivalentTo(gridValues));

            Actor.AttemptsTo(
                Save.OpenedItem.ByDoneButton(),
                Close.ActiveItemPage.ByCloseButton
                );

            //m
            Actor.AttemptsTo(
                Open.SearchPanel.OfCurrentItemType.BySelectedSecondaryMenu,
                Search.Simple.InMainGrid.With(new Dictionary <string, string> {
                [columnName] = listName
            }),
                Open.Item.InMainGrid.WithRowNumber(1).ByDoubleClick
                );

            Actor.ChecksThat(ItemPageState.FieldValue(PropertyName), Is.EqualTo(listName));
            Actor.ChecksThat(ItemPageState.FieldValue(PropertyDescription), Is.EqualTo(listDescription));
            Actor.ChecksThat(RelationshipGridState.GridData(relationship), Is.EquivalentTo(gridValues));

            //n
            Actor.AttemptsTo(
                Close.ActiveItemPage.ByCloseButton,
                Collapse.SecondaryMenu
                );
        }