public void AnimateMove(DeltaChange dc, Move move)
        {
            this.OnMoveAnimationPreview();
            this.SetupAnimationCount(move);

            while (dc.HasItems())
            {
                var change = dc.PopLast();

                switch (change.Action)
                {
                case MoveAction.Move:
                    this.InnerAnimateMove(new Move(change.Square, change.AdditionalSquare), Queem.Core.Figure.Nobody);
                    break;

                case MoveAction.Deletion:
                    if (change.Square != move.To)
                    {
                        // if not equal - passing capture
                        this.viewModel.RemoveFigure(change.Square);
                    }
                    break;

                case MoveAction.Creation:
                    this.viewModel.UpdateFigure(change.Square,
                                                change.FigureType, change.FigureColor);
                    break;
                }
            }
        }
        public void ResetProduct(string accessGroupName, string productName, DeltaChange deltaChange)
        {
            webDriver.FindElement(By.XPath("//div[@title='" + accessGroupName + "']/../..//input[@name='chkAccessGroup']")).SendKeys(Keys.Space);
            SettingsButton.SendKeys(Keys.Enter);
            webDriver.WaitForElementVisible(By.Id("ctl00_ContentPageHolder_ManageGroupsContainer_AccessGroupTab_ManageAccessGrps_uc_PublishAndUpdate_img_Update"), TimeSpan.FromMinutes(2));
            webDriver.FindElement(By.XPath("//table[@id='ctl00_ContentPageHolder_ManageGroupsContainer_AccessGroupTab_ManageAccessGrps_MyTable']//span[text()='Standard Configurations'][contains(@onclick,'return')]")).Click();

            IWebElement chkElement = ContentTable.FindElement(By.XPath("//tr[@title='" + productName + "']")).FindElement(By.XPath(".//input[contains(@id,'ctl00_ContentPageHolder_ManageGroupsContainer_AccessGroupTab_ManageAccessGrps_grpchk')]"));

            switch (deltaChange)
            {
            case DeltaChange.Add:
                if (chkElement.Selected)
                {
                    chkElement.SendKeys(Keys.Space);
                }
                break;

            case DeltaChange.Remove:
            case DeltaChange.Modify:
                if (!chkElement.Selected)
                {
                    chkElement.SendKeys(Keys.Space);
                }
                break;
            }

            AccessGroup_UpdateButton.SendKeys(Keys.Enter);
            webDriver.WaitForPageLoad(TimeSpan.FromMinutes(2));
        }
        public void AnimateCancelMove(DeltaChange dc, Move move)
        {
            this.OnMoveAnimationPreview();
            this.SetupAnimationCount(move);

            var figureDiedItems = dc.Filter((ch) =>
                                            (ch.Action == MoveAction.Deletion) &&
                                            (ch.FigureColor != this.viewModel.CurrentPlayerColor) &&
                                            (ch.Square == move.To));

            Queem.Core.Figure figureDied = Queem.Core.Figure.Nobody;
            if (figureDiedItems.Count() > 0)
            {
                figureDied = figureDiedItems.First().FigureType;
            }

            while (dc.HasItems())
            {
                var change = dc.PopLast();

                switch (change.Action)
                {
                case MoveAction.Move:
                    this.InnerAnimateMove(new Move(change.AdditionalSquare, change.Square), figureDied);
                    break;

                case MoveAction.Creation:
                    break;

                case MoveAction.Deletion:
                    if (move.To != change.Square)
                    {
                        this.viewModel.UpdateFigure(change.Square,
                                                    change.FigureType, change.FigureColor);
                    }
                    break;
                }
            }
        }
Exemple #4
0
        public void ResetAccessGroup(string accountName, string accessGroupName, string orderCode, DeltaChange deltaChange)
        {
            OstHomePage ostHomePage = new OstHomePage(webDriver);

            ostHomePage.OpenOSTHomePage();
            ostHomePage.GoToCatalogAndPricingPage(accountName);
            ostHomePage.ManageAccessGroupsLink.SendKeys(Keys.Enter);
            OSTManageAccessGroupPage ostManageAccessGroupPage = new OSTManageAccessGroupPage(webDriver);

            ostManageAccessGroupPage.ResetProduct(accessGroupName, orderCode, deltaChange);
        }