public void checkMyState() { FormState myState = EnumerationMatcher.StringToFormState(this.State); if (myState == FormState.Signed) { State = FormState.Signed.ToString(); return; } if (myState == FormState.Uploaded) { State = FormState.Uploaded.ToString(); return; } bool signable = true; foreach (FormPage page in FormPageList) { page.checkMyState(); FormPageState state = EnumerationMatcher.StringToFormPageState(page.State); if (state == FormPageState.Disabled || state == FormPageState.PartlyEdited) { signable = false; } } if (signable) { State = FormState.Signable.ToString(); return; } State = FormState.Open.ToString(); }
private void CheckFields() { Actor.ChecksThat(FormPageState.LayoutFieldNames, a => Assert.AreEqual(a.Take(propertiesInExpectedOrder.Count), propertiesInExpectedOrder.Keys)); foreach (var field in propertiesInExpectedOrder) { Actor.ChecksThat(FormPageState.FieldLabelFromLayout(field.Key), Is.EqualTo(field.Value)); } }
public static FormPageState StringToFormPageState(String s) { try { FormPageState state = (FormPageState)Enum.Parse(typeof(FormPageState), s, true); return(state); } catch { Debug.WriteLine("Fehler beim Parsen von String zu FormPageState"); return(FormPageState.Disabled); } }
public void S_1_011_EditingFormTest() { //Preconditions: Actor.AttemptsTo( Open.NavigationPanel, Pin.NavigationPanel ); //Scenario: //a Actor.AttemptsTo(Open.SearchPanel.OfTocItemWithPath("Administration/Form").BySecondaryMenu); //b Actor.AttemptsTo( Search.Simple.InMainGrid.With(simpleSearchCriteria), Open.Item.InMainGrid.WithValueInCell(formNamePropertyLabel, formName).ByDoubleClick ); //c Actor.AttemptsTo( Wait.ForFormsPageLoaded, Lock.OpenedItem.ByButton); //d Actor.AttemptsTo(Select.FormPageTab.WithName(tabTitle)); var itemPageContainer = Actor.AsksFor(PagesContent.CurrentPageContainer); var itemForm = FormPageTabElements.TabPropertiesForm(itemPageContainer); Actor.AttemptsTo(Set.NewValue(propertyValue).ForProperty(descriptionPropertyName).OnForm(itemForm)); var expectedDescriptionLabel = Actor.AsksFor(LocaleState.LabelOf.FieldOnForm("Form", "description")); Actor.ChecksThat(FormPageState.FieldLabelFromTab(descriptionPropertyName), Is.EqualTo(expectedDescriptionLabel)); //e CheckFields(); //f Actor.AttemptsTo(Close.ActiveItemPage.BySaveUnlockAndCloseButton); //g Actor.AttemptsTo(Open.Item.InMainGrid.WithRowNumber(1).ByContextMenu.ForView); //g.i Actor.AttemptsTo(Select.FormPageTab.WithName(tabTitle)); Actor.ChecksThat(FormPageState.TabInputFieldValue(descriptionPropertyName), Is.EqualTo(propertyValue)); Actor.AttemptsTo(Close.ActiveItemPage.ByCloseButton); //h Actor.AttemptsTo(Close.ActiveItemPage.ByCloseButton); }