private void CheckLabels(bool isItemLocked) { var selectedActivity = Actor.AttemptsTo(Select.WorkflowActivity(planningActivity)); var expectedLabel = isItemLocked ? planningActivity.Name : planningActivity.Label; CheckLabelOfElement(selectedActivity, expectedLabel); var selectedPath = Actor.AttemptsTo(Select.WorkflowPath(confirmPath)); expectedLabel = isItemLocked ? confirmPath.Name : confirmPath.Label; CheckLabelOfElement(selectedPath, expectedLabel); }
public void S_1_015_DeletingObjectsTest() { //Precondition Actor.AttemptsTo(Open.NavigationPanel, Pin.NavigationPanel); //a Actor.AttemptsTo(Open.SearchPanel.OfTocItemWithPath(ItemTypeName).ByLoupeIcon, Search.WithCurrentSearchCriteria.InMainGrid); Actor.ChecksThat(MainGridState.VisibleRowsCount, Is.EqualTo(6)); //b,c,d Actor.AttemptsTo(Delete.Item.InMainGrid.WithValueInCell(chairNumberColumnLabel, "1K3A").ByContextMenu, Search.WithCurrentSearchCriteria.InMainGrid); Actor.ChecksThat(MainGridState.VisibleRowsCount, Is.EqualTo(5)); Actor.ChecksThat(MainGridState.Unfrozen.HasItemWithValueInColumn("1K3A", chairNumberColumnLabel), Is.False); //e, f Actor.AttemptsTo(Select.Item.InMainGrid.WithValueInColumn(chairNumberColumnLabel, "1K9A")); var rowNumber = Actor.AsksFor(MainGridState.IndexOfSelectedRow); var dialogContainer = Actor.AsksFor(SearchPanelContent.DialogsContainer); Actor.AttemptsTo(Select.ContextMenuOption(deleteAllVersions).OnMainGridRow(rowNumber), Close.Dialog(dialogContainer).ByCancelButton); Actor.ChecksThat(MainGridState.VisibleRowsCount, Is.EqualTo(5)); //g, h Actor.AttemptsTo(Select.MultipleItems.InMainGrid.ByCtrlA, Delete.SelectedItems.InMainGrid.ByContextMenu.ConfirmingAll, Search.WithCurrentSearchCriteria.InMainGrid); Actor.ChecksThat(MainGridState.VisibleRowsCount, Is.EqualTo(0)); //i Actor.AttemptsTo(Close.Tab.Current); }
public void S_1_013_VaultTest() { //a. Actor.AttemptsTo(Create.Item.OfItemType("S013 Chair").ByContextMenu); //b var form = Actor.AsksFor(ItemPageContent.Form); Actor.AttemptsTo(Set.NewValue(typeOfWoodValue).ForProperty("wood_type").OnForm(form), Select.Option(colorValue).ForDropdownProperty("paint_color").OnForm(form), Set.NewValue(dateValue).ForProperty("date_created").OnForm(form)); //b.v. Actor.AttemptsTo(Select.NewFile(uploadFilePath). WithSettings(Settings.MachineExecutionContext). ForProperty("blueprint"). ByLinkOnForm(form)); //c. Actor.AttemptsTo(Save.OpenedItem.ByDoneButton(), Close.ActiveItemPage.ByCloseButton); //d. Actor.AttemptsTo(Open.NavigationPanel, Open.SearchPanel.OfTocItemWithPath("S013 Chair").ByLoupeIcon, Search.Simple.InMainGrid.With(simpleSearchCriteria)); //e. In main grid check that link text in Blueprint cell is equal selected file. var columnNumberOfBlueprint = Actor.AsksFor(MainGridState.Unfrozen.IndexOfColumn(blueprintColumnLabel)); Actor.ChecksThat(MainGridState.Unfrozen.CellValue(1, columnNumberOfBlueprint), Is.EqualTo(fileName)); //f. var cell = Actor.AsksFor(MainGridContent.Unfrozen.Cell(1, columnNumberOfBlueprint)); var dialogContainer = Actor.AsksFor(SearchPanelContent.DialogsContainer); Actor.AttemptsTo(Open.Dialog.ManageFile.FromMainGrid.ByManageFilePropertyIconInCell(cell)); //f.i. Actor.VerifiesThat(Visibility.Of(ManageFileDialogElements.Title(dialogContainer)), Is.True); //ii. Actor.ChecksThat( ManageFileDialogState.IsButtonEnabled(ManageFileDialogElements.SelectNewFileButton(dialogContainer)), Is.False); Actor.ChecksThat( ManageFileDialogState.IsButtonEnabled(ManageFileDialogElements.DeleteFileButton(dialogContainer)), Is.False); //g. var targetFilePath = Path.Combine(workDirPath, fileName); Actor.AttemptsTo(Download.File.InManageFileDialog(Settings.MachineExecutionContext, dialogContainer, targetFilePath)); //g.i. Actor.ChecksThat(FileState.ExistsAndNotEmpty(targetFilePath), Is.True); Actor.AttemptsTo(Delete.File(targetFilePath)); //h. Actor.AttemptsTo(Close.Dialog(dialogContainer).ByCloseButton); //h.i. Actor.AttemptsTo(Close.Tab.Current); }
public void S_1_009_WorkflowTest() { //Precondition: Actor.AttemptsTo( Open.NavigationPanel, Pin.NavigationPanel ); //Scenario: //a - b Actor.AttemptsTo(Create.Item.OfItemType("Administration/Workflow Map").BySecondaryMenu()); //c Actor.AttemptsTo(Fill.WorkflowMapProperties.With(workflowMap)); Actor.AttemptsTo(Move.WorkflowActivity(endActivity).Into(600, 20)); //d - h var selectedPath = Actor.AttemptsTo(Select.WorkflowPath(defaultPath)); var selectedPathLine = Actor.AsksFor(Children.Of(selectedPath).Located(By.XPath("./*"))).First(); Actor.ChecksThat(HtmlAttribute.Of(selectedPathLine).Named("stroke"), Is.EqualTo("rgb(255, 0, 0)")); Actor.AttemptsTo(Add.WorkflowActivity(planningActivity).IntoWorkflowPath(defaultPath).AndFillProperties); var relationshipsPanel = Actor.AsksFor(WorkflowPageContent.RelationshipsPanel); Actor.AttemptsTo(Create.Relationship.InRelationshipsPanel(relationshipsPanel).ViaSelectItems(assignmentCriteria).ByDoubleClick); CheckRelationship(); Actor.AttemptsTo(Add.WorkflowActivity(confirmingActivity).IntoWorkflowPath(intermediatePath).AndFillProperties); //i - j Actor.AttemptsTo(Select.WorkflowPath(confirmPath)); Actor.AttemptsTo(Fill.WorkflowPathProperties.With(confirmPath)); Actor.AttemptsTo(Select.WorkflowPath(finishPath)); Actor.AttemptsTo(Fill.WorkflowPathProperties.With(finishPath)); CheckLabels(true); //k Actor.AttemptsTo(Save.OpenedItem.BySaveUnlockAndCloseButton); //l Actor.AttemptsTo( Open.SearchPanel.OfCurrentItemType.BySelectedSecondaryMenu, Search.Simple.InMainGrid.With(workflowSearchCriteria), Open.Item.InMainGrid.WithRowNumber(1).ByContextMenu.ForView ); //l.i var savedData = Actor.AsksFor(WorkflowPageState.SavedData); Actor.ChecksThat(savedData.Label, Is.EqualTo(workflowMap.Label), "Label is equal to expected"); Actor.ChecksThat(savedData.Description, Is.EqualTo(workflowMap.Description), "Description is equal to expected"); Actor.ChecksThat(savedData.Name, Is.EqualTo(workflowMap.Name), "Name is equal to expected"); Actor.ChecksThat(savedData.ProcessOwner, Is.EqualTo(workflowMap.ProcessOwner), "Process Owner is equal to expected"); Actor.ChecksThat(savedData.Activities, Is.EqualTo(workflowMap.Activities), "Activities are equal to expected"); Actor.ChecksThat(savedData.Paths, Is.EqualTo(workflowMap.Paths), "Paths are equal to expected"); CheckLabels(false); Actor.AttemptsTo(Select.WorkflowActivity(planningActivity)); CheckRelationship(); //m Actor.AttemptsTo( Close.ActiveItemPage.ByCloseButton, Collapse.SecondaryMenu ); }