public void S_1_016_PromoteAnObjectTest() { // precondition, 2a OpenNavAndSelectChairs(); //2.b Actor.AttemptsTo(Set.PreviewMode(PreviewMode.Properties).InMainGrid); var propertiesPanel = Actor.AsksFor(SearchPanelContent.PropertiesPanel); Actor.ChecksThat(Displayed.Of(propertiesPanel), Is.True); //3. Promote item //a Actor.AttemptsTo(Select.Item.InMainGrid.WithValueInColumn(columnLabel, woodType)); Actor.ChecksThat(PropertiesPanelState.ValueOfProperty(PropertyType.State, propertiesPanel), Is.EqualTo("Start")); Actor.ChecksThat(PropertiesPanelState.Title(propertiesPanel), Is.EqualTo(propertiesPanelTitle)); //b,c,d PromoteTo(confirmingState); Actor.ChecksThat(PropertiesPanelState.ValueOfProperty(PropertyType.State, propertiesPanel), Is.EqualTo(confirmingState)); //e,f TryToPromoteAndLogout(); //g Actor.AttemptsTo(LogIn.ToInnovator.As(Actor2.ActorInfo)); //h, i OpenNavAndSelectChairs(); var dialogContainer = Actor.AsksFor(SearchPanelContent.DialogsContainer); //j, k, l Actor.AttemptsTo(Open.Dialog.Promote.ForItem.WithValue(woodType).InMainGridColumn(columnLabel).ByContextMenu); Actor.ChecksThat(TextContent.Of(PromoteDialogElements.Title(dialogContainer)), x => x.Contains(promoteDialogTitle)); Actor.AttemptsTo(Select.PromoteState.WithValue(creatingState).InDialog(dialogContainer).ByDoubleClick); //m, n var rowNumber = Actor.AsksFor(MainGridState.IndexOfSelectedRow); Actor.AttemptsTo(Open.Dialog.Properties.FromMainGrid.ByContextMenuOnRow(rowNumber)); propertiesPanel = PropertiesDialogElements.PropertiesPanel(dialogContainer); Actor.ChecksThat(PropertiesPanelState.ValueOfProperty(PropertyType.State, propertiesPanel), Is.EqualTo(creatingState)); Actor.AttemptsTo(Close.Dialog(dialogContainer).ByCloseButton); //o, p TryToPromoteAndLogout(); //q Actor.AttemptsTo(LogIn.ToInnovator.As(Actor.ActorInfo)); //r, s OpenNavAndSelectChairs(); //t, u, v Actor.AttemptsTo(Select.Item.InMainGrid.WithValueInColumn(columnLabel, woodType)); PromoteTo(completedState); Actor.AttemptsTo(Set.PreviewMode(PreviewMode.Properties).InMainGrid); propertiesPanel = Actor.AsksFor(SearchPanelContent.PropertiesPanel); Actor.ChecksThat(PropertiesPanelState.ValueOfProperty(PropertyType.State, propertiesPanel), Is.EqualTo(completedState)); }
internal void Invoke(IActorFacade <IUserInfo> actor, IInnovatorTestRunSettings settings) { //a actor.ChecksThat(ServerLogState.ServerFileInfo("VersionServer.xml"), Is.Empty); //c actor.AttemptsTo(Open.Application.By(settings.ClientUrl), Actions.Chains.WaitChains.Wait.ForLoginPageLoading); //c.i actor.ChecksThat(TextContent.Of(LoginPageElements.InnovatorVersion), Is.EqualTo(logonFormLabel)); //c.ii actor.ChecksThat(HtmlAttribute.Of(LoginPageElements.UserNameInputField).Named("placeholder"), Is.EqualTo(usernameTip)); actor.ChecksThat(HtmlAttribute.Of(LoginPageElements.PasswordInputField).Named("placeholder"), Is.EqualTo(passwordTip)); //d, e actor.AttemptsTo(LogIn.ToInnovator.As(actor.ActorInfo)); CheckLoginIsSuccessful(actor); actor.ChecksThat(Page.Url, Is.EqualTo(string.Concat(settings.ClientUrl, "/"))); //f actor.AttemptsTo(Select.UserMenuItem.ByPath(UserMenuItems.AboutId)); //f.i var dialogContainer = PageElements.DialogsContainer; actor.ChecksThat(Visibility.Of(ArasDialogElements.Dialog(dialogContainer)), Is.True); //f.ii actor.ChecksThat( TextContent.Of(AboutDialogElements.VersionAndBuildNumber(dialogContainer)), x => Assert.AreEqual( FormattableString.Invariant( $"Aras Innovator Version {settings.InnovatorVersion.GetDescription()} Build: {settings.BuildNumber}"), x.Replace(" ", " ")) ); //g actor.AttemptsTo(Click.On(AboutDialogElements.OkButton(dialogContainer))); //h actor.AttemptsTo( Open.NavigationPanel, Pin.NavigationPanel ); //i actor.AttemptsTo( Open.SearchPanel.OfTocItemWithPath("Administration/Variable").ByLoupeIcon, Search.Simple.InMainGrid.With(searchData) ); //i.i CheckVariableValue(actor, "VersionBuild", settings.BuildNumber); CheckServicePackVersion(actor, settings); CheckVariableValue(actor, "VersionMinor", "0"); CheckVariableValue(actor, "VersionServiceUpdate", "0"); //j actor.AttemptsTo(LogOut.FromInnovator); //j.i actor.ChecksThat(Displayed.Of(LoginPageElements.InfoContentDescription), Is.True); actor.ChecksThat(TextContent.Of(LoginPageElements.InfoContentDescription), Is.EqualTo(loggedOutLabel)); //k actor.AttemptsTo(Click.On(LoginPageElements.LoginAgainButton)); //k.i var link = LoginPageElements.ArasLink; actor.AttemptsTo( Wait.UntilTargetIsPresent(LoginPageElements.LoginButton), Wait.UntilTargetIsClickable(link)); //l.i actor.ChecksThat(ServerLogState.ServerFileInfo("VersionServer.xml"), Is.Not.Empty); //m var initialTabHandle = actor.AsksFor(Page.WindowHandle); var newTabHandle = actor.AttemptsTo(Open.NewBrowserTab.ByClickOnLink(link)); actor.AttemptsTo(Switch.ToBrowserTab.WithHandle(newTabHandle)); actor.AttemptsTo(Wait.UntilQuestionIsAnswered(Page.Url, url => url != "about:blank")); //m.i actor.ChecksThat(Page.Url, x => StringAssert.StartsWith(ArasUrl, x)); //n actor.AttemptsTo(Close.BrowserTab.Current.ByButton, Switch.ToBrowserTab.WithHandle(initialTabHandle)); //o actor.AttemptsTo( Enter.TheNewValue(actor.ActorInfo.LoginName).Into(LoginPageElements.UserNameInputField), Enter.TheNewValue(string.Empty).Into(LoginPageElements.PasswordInputField)); actor.ChecksThat(JsScriptResult.For(opacityQuerySelectorScript), Is.EqualTo("0")); actor.AttemptsTo(CoreSelect.TheText(actor.ActorInfo.DatabaseName) .Into(LoginPageElements.DatabaseSelectField)); //p actor.AttemptsTo(Click.On(LoginPageElements.LoginButton)); //p.i CheckLoginFailed(actor); //q actor.AttemptsTo( Enter.TheNewValue(userName).Into(LoginPageElements.UserNameInputField), Enter.TheNewValue(actor.ActorInfo.Password).Into(LoginPageElements.PasswordInputField), CoreSelect.TheText(actor.ActorInfo.DatabaseName).Into(LoginPageElements.DatabaseSelectField) ); //r actor.AttemptsTo(Click.On(LoginPageElements.LoginButton)); //r.i CheckErrorMessage(actor, authFailedMessage); //s actor.AttemptsTo(Enter.TheNewValue("Admin").Into(LoginPageElements.UserNameInputField)); //t actor.AttemptsTo(Clear.TheValueOf(LoginPageElements.PasswordInputField)); //u actor.AttemptsTo(Set.NewValue("true").ForHtmlAttribute("data-tooltip-show") .OfTarget(LoginPageElements.PasswordFieldTooltip)); actor.AttemptsTo(Wait.UntilQuestionIsAnswered(JsScriptResult.For(opacityQuerySelectorScript), a => a.ToString() == "1")); actor.ChecksThat(HtmlAttribute.Of(LoginPageElements.PasswordFieldTooltip).Named("data-tooltip-show"), Is.EqualTo("true")); actor.ChecksThat(HtmlAttribute.Of(LoginPageElements.PasswordFieldTooltip).Named("data-tooltip"), x => Assert.IsTrue(x.StartsWith(capsIsOnMessage, false, CultureInfo.CurrentCulture))); actor.ChecksThat(JsScriptResult.For(opacityQuerySelectorScript), Is.EqualTo("1")); //v actor.AttemptsTo(Set.NewValue("false").ForHtmlAttribute("data-tooltip-show") .OfTarget(LoginPageElements.PasswordFieldTooltip)); actor.ChecksThat(HtmlAttribute.Of(LoginPageElements.PasswordFieldTooltip).Named("data-tooltip-show"), Is.EqualTo("false")); actor.ChecksThat(Visibility.Of(LoginPageElements.DatabaseSelectField), Is.True); actor.ChecksThat(Visibility.Of(LoginPageElements.LoginButton), Is.True); actor.AttemptsTo(Wait.UntilQuestionIsAnswered(JsScriptResult.For(opacityQuerySelectorScript), a => a.ToString() == "0")); //w actor.AttemptsTo(LogIn.ToInnovator.As(actor.ActorInfo)); CheckLoginIsSuccessful(actor); }