Esempio n. 1
0
        public ActionResult ArticleDetail(int id)
        {
            var       model   = new ArticleDetailViewModel();
            var       article = _articleManager.Get(x => x.Id == id);
            Displayed disp    = new Displayed();

            disp.ArticleId            = article.Id;
            disp.ArticleDisplayedDate = DateTime.Now;
            _displayedManager.Add(disp);

            model.Article = article;

            return(View(model));
        }
Esempio n. 2
0
        public MainWindow()
        {
            FileList.Add(new Tuple <string, string>("Assembly-CSharp-firstpass.dll", "Hook Dependency"));
            FileList.Add(new Tuple <string, string>("I18N.dll", "SQL Dependency"));
            FileList.Add(new Tuple <string, string>("I18N.West.dll", "SQL Dependency (West)"));
            FileList.Add(new Tuple <string, string>("System.Management.dll", "Management Dependency"));
            FileList.Add(new Tuple <string, string>("TsunamiHack.dll", "Function Dependency"));

            Manager = new InstallationManager(this);

            InitializeComponent();

            DbAccess = new db(this);
            DbAccess.GetData();

            //Disabled = true;

            if (Disabled)
            {
                grdContainer.IsEnabled = false;
                var win = new BlockedWindow(Reason);
                var ret = win.ShowDialog();
                if (ret != null)
                {
                    Environment.Exit(0);
                }
            }



            //set sidebar to out and set lengths
            sideBarState      = true;
            cgSidebar.Width   = new GridLength(2, GridUnitType.Star);
            cgContent.Width   = new GridLength(8, GridUnitType.Star);
            btnResize.Content = "<";

            current = Displayed.Home;
            //set container instance
        }
Esempio n. 3
0
 public void OnDisplayed(Action <ShapeDisplayContext> context)
 {
     Displayed = Displayed.Concat(new[] { context });
 }
Esempio n. 4
0
 /// <summary>
 /// Scroll to the UI object.
 /// </summary>
 /// <param name="timeout">The timeout to wait for the object to become visible between page downs.</param>
 public virtual void ScrollTo(TimeSpan timeout)
 {
     ScrollTo();
     Displayed.WaitFor(timeout);
 }
Esempio n. 5
0
 /// <inheritdoc />
 public void NotifyDisplayed()
 {
     Displayed?.Invoke(this, EventArgs.Empty);
 }
        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));
        }
 private void OnDisplay()
 {
     Displayed?.Invoke(this, new EventArgs());
 }
Esempio n. 8
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////////
        #region Event Handler

        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            Displayed?.Invoke(sender, e);
        }
            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);
            }