protected void CheckVariableValue(IActorFacade <IUserInfo> actor, string varName, string varValue) { var rowNumber = actor.AsksFor(MainGridState.Unfrozen.IndexOfRowByValueInColumn(varName, columnLabel)); actor.ChecksThat(MainGridState.Unfrozen.CellValue(rowNumber, 2), Is.EqualTo(varValue)); }
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); }