Exemple #1
0
 public void Bugdet_FundFromReciepts_WS_1196()
 {
     if (!DataParser.ReturnExecution("WS_1196"))
     {
         Assert.Ignore();
     }
     else
     {
         _file = "Resources\\" + client + "\\TestsData\\WS_1196.xml";
         string user = AwardData.GetAwardUserName(_file), msg = AwardData.GetAwardMessage(_file),
                award = AwardData.GetAwardName(_file), value = AwardData.GetAwardValue(_file), amountvalue = AwardData.GetAwardAmountValue(_file),
                proxy_name = ProxyData.GetProxyUserName(_file), proxy_name2 = ProxyData.GetProxySecondUserName(_file);
         MainHomePage       proxyPage       = InitialPage.Go().Logon().ClickLogin().NavigateToAdminHomePage().LoginProxyAsuser().EnterUserNameHealthAlliance(proxy_name).ProxyToMainHomePage();
         NominationHomePage recognitionPage = proxyPage.NavigateToHomePage().NavigateToNomination();
         Thread.Sleep(1500);
         recognitionPage
         .SearchEmployeeFound(user)
         .SelectAward(award)
         .SelectValueOfAward(amountvalue)
         .SelectValues(value)
         .FillMsg(msg)
         .ClickNext()
         .EmailReward();
         recognitionPage.ClickSendRecognition();
         var proxypage = recognitionPage.ExitProxy().NavigateToAdminHomePage().LoginProxyAsuser().EnterUserNameHealthAlliance(proxy_name2)
                         .ProxyToMainHomePage().ClosePopUp();
         Thread.Sleep(300);
         var amount = proxypage.GetBudget();
         //Fail cannot appear link to switch to see the budget
         PendingApprovals pending = proxypage.NavigateToPendingApprovals();
         Thread.Sleep(300);
     }
 }
Exemple #2
0
 public void Approval_StandardMonAppvTextron_WS_927()
 {
     if (!DataParser.ReturnExecution("WS_927"))
     {
         Assert.Ignore();
     }
     else
     {
         _file = "Resources\\" + client + "\\TestsData\\WS_927.xml";
         string user = AwardData.GetAwardUserName(_file),
                award = AwardData.GetAwardName(_file), secondAward = AwardData.GetSecondAwardName(_file),
                populationImpact = AwardData.GetAwardPopulationImpact(_file),
                financialImpact = AwardData.GetAwardFinancialImpact(_file),
                bussinesImpact = AwardData.GetAwardBussinesImpact(_file),
                amount = AwardData.GetAwardAmountValue(_file), objetives = AwardData.GetAwardObjetives(_file),
                printype = AwardData.GetAwardDeliverType(_file),
                msg = AwardData.GetAwardMessage(_file), projectTask = AwardData.GetAwardProjectTask(_file),
                reason           = AwardData.GetAwardReason(_file),
                proxy_name       = ProxyData.GetProxyUserName(_file),
                approval_name    = AwardData.GetApprovalUserName(_file);
         ProxyHomePage proxyPage = InitialPage.Go().Logon().ClickLogin().NavigateToAdminHomePage()
                                   .LoginProxyAsuser().EnterUserName(user);
         MainHomePage home = proxyPage.ProxyToMainHomePage();
         Assert.AreEqual("You are proxied in under: " + user, home.GetProxyLoginMsg(),
                         "The message of proxy login is not correct");
         Step2 step2 = home.NavigateToNomination()
                       .SearchEmployeeFound(proxy_name)
                       .SelectAward(award)
                       .SelectValues(populationImpact)
                       .SelectValues(financialImpact)
                       .SelectValues(bussinesImpact)
                       .ClickNextSameStep();
         Assert.AreEqual("Appreciation Award", step2.GetAwardName("Appreciation Award"), "Award is not the same as expected");
         Assert.AreEqual("Honors Award", step2.GetAwardName("Honors Award"), "Award is not the same as expected");
         Assert.AreEqual("Excellence Award", step2.GetAwardName("Excellence Award"), "Award is not the same as expected");
         Assert.AreEqual("Distinction Award", step2.GetAwardName("Distinction Award"), "Award is not the same as expected");
         NominationHomePage recognitionPage = step2.SelectSecondAward(secondAward).SelectValueOfAward(amount)
                                              .SelectProjectTask(projectTask)
                                              .CheckProjectApproval()
                                              .SelectValues(objetives)
                                              .FillMsg(msg)
                                              .FillReason(reason)
                                              .ClickNext();
         recognitionPage.DeliverType(printype);
         Assert.AreEqual(2, recognitionPage.GetCountEditLnk(), "Edit links are not two");
         recognitionPage.ClickSendRecognition();
         Assert.AreEqual("Success!", recognitionPage.GetSuccesMsg(), "Message its not success");
         AdminHomePage proxy = recognitionPage.ExitProxy();
         home = proxy.LoginProxyAsuser().EnterUserName(approval_name).ProxyToMainHomePage();
         Assert.IsTrue(home.IsPopUpRecognitionShow(), "Pop up recognition is not showing up");
         PendingApprovals pending = home.ClickHereAwardPopUp();
         Assert.AreEqual("Pending Approvals", pending.GetTitleMenu(), "Title is not pending approval");
         pending.ApproveAward().ClickApprove();
         proxy = pending.ExitProxy();
         home  = proxy.LoginProxyAsuser().EnterUserName(proxy_name).ProxyToMainHomePage();
         MyAwards awards = home.ClosePopUp().NavigateToMyAwards();
         Assert.AreEqual(secondAward, awards.GetAwardName(1, 6), "The last award that someone gave you is not present");
         awards.OpenDetailsAward(1, 7);
     }
 }
Exemple #3
0
 public void EventCalendar_Anniversaries_WS_1084()
 {
     if (!DataParser.ReturnExecution("WS_1084"))
     {
         Assert.Ignore();
     }
     else
     {
         _file    = "Resources\\" + client + "\\TestsData\\WS_1084.xml";
         username = ProxyData.GetProxyUserName(_file);
         string username2        = ProxyData.GetProxySecondUserName(_file),
                award            = AwardData.GetAwardName(_file),
                msg              = AwardData.GetAwardMessage(_file);
         MainHomePage  home      = InitialPage.Go().Logon().ClickLogin();
         ProxyHomePage proxyPage = home.NavigateToAdminHomePage().LoginProxyAsuser();
         proxyPage.EnterUserName(username);
         home = proxyPage.ProxyToMainHomePage();
         Assert.AreEqual("You are proxied in under: " + username, home.GetProxyLoginMsg(),
                         "The message of proxy login is not correct");
         Assert.AreEqual("Exit Proxy", home.GetExitMsg(), "The exit proxy link is not present");
         EventCalendar eventPage = home.NavigateToEventCalendar();
         eventPage.ClickRecent();
         Assert.AreEqual(username2 + "\r\n12 year Anniversary", eventPage.GetNameList(6),
                         username2 + " is not present");
         NominationHomePage nomination =
             eventPage.clickSendAniversaryCard().SelectAward(award).FillMsg(msg).SelectImgs();
         nomination.EmailReward().ClickSendRecognition();
         Assert.AreEqual("Success!", nomination.GetSuccesMsg(), "Message its not success");
         Assert.AreEqual("FINISH", nomination.GetBtnFinishLabel(), "Button finish its not correct write");
         Assert.AreEqual("RECOGNIZE", nomination.GetBtnRecognizOtherLabel(),
                         "Button finish its not correct write");
     }
 }
Exemple #4
0
 public void Recognition_ApprovalMon_WS_924()
 {
     if (!DataParser.ReturnExecution("WS_924"))
     {
         Assert.Ignore();
     }
     else
     {
         _file = "Resources\\" + client + "\\TestsData\\WS_924.xml";
         string user             = AwardData.GetAwardUserName(_file),
                award            = AwardData.GetAwardName(_file),
                secondAward      = AwardData.GetSecondAwardName(_file),
                populationImpact = AwardData.GetAwardPopulationImpact(_file),
                financialImpact  = AwardData.GetAwardFinancialImpact(_file),
                bussinesImpact   = AwardData.GetAwardBussinesImpact(_file);
         int    amount           = AwardData.GetAwardAmountValueNumbers(_file);
         string printype         = AwardData.GetAwardDeliverType(_file),
                msg              = AwardData.GetAwardMessage(_file),
                reason           = AwardData.GetAwardReason(_file),
                companyValue     = AwardData.GetAwardCompanyValue(_file),
                proxy_name       = ProxyData.GetProxyUserName(_file),
                approval_name    = AwardData.GetApprovalUserName(_file);
         ProxyHomePage proxyPage = InitialPage.Go().Logon().ClickLogin().NavigateToAdminHomePage()
                                   .LoginProxyAsuser().EnterUserName(proxy_name);
         MainHomePage home = proxyPage.ProxyToMainHomePage();
         Assert.AreEqual("You are proxied in under: " + proxy_name, home.GetProxyLoginMsg(),
                         "The message of proxy login is not correct");
         NominationHomePage recognitionPage = home.NavigateToNomination()
                                              .SearchEmployeeFound(user)
                                              .SelectAward(award)
                                              .EnterValueAmount(amount)
                                              .FillReason(reason)
                                              .ChkCompanyValues(companyValue)
                                              .SelectValues(populationImpact)
                                              .SelectValues(bussinesImpact)
                                              .SelectValues(financialImpact)
                                              .FillMsg(msg)
                                              .ClickNext();
         recognitionPage.DeliverType(printype);
         Assert.AreEqual(2, recognitionPage.GetCountEditLnk(), "Edit links are not two");
         recognitionPage.ClickSendRecognition();
         Assert.AreEqual("Success!", recognitionPage.GetSuccesMsg(), "Message its not success");
         AdminHomePage proxy = recognitionPage.ExitProxy();
         home = proxy.LoginProxyAsuser().EnterUserName(approval_name).ProxyToMainHomePage();
         Assert.AreEqual("You are proxied in under: " + approval_name, home.GetProxyLoginMsg(),
                         "The message of proxy login is not correct");
         Assert.IsTrue(home.IsPopUpRecognitionShow(), "Pop up recognition is not showing up");
         PendingApprovals pending = home.ClickHereAwardPopUp();
         Assert.AreEqual("Pending Approvals", pending.GetTitleMenu(), "Title is not pending approval");
         pending.ApproveAward().ClickApprove();
         proxy = pending.ExitProxy();
         home  = proxy.LoginProxyAsuser().EnterUserName(user).ProxyToMainHomePage();
         Assert.AreEqual("You are proxied in under: " + user, home.GetProxyLoginMsg(),
                         "The message of proxy login is not correct");
         MyAwards awards = home.ClosePopUp().NavigateToMyAwards();
         Assert.AreEqual(secondAward, awards.GetAwardName(1, 4),
                         "The last award that someone gave you is not present");
         awards.OpenDetailsAward(1, 7);
     }
 }
Exemple #5
0
    /// <summary>
    /// 日期过程
    /// </summary>
    void DayProcess(float deltaTime)
    {
        float theProcessAdd = (100 / dayProcessSpeed) * deltaTime;

        _CurTimeData.DayProcess += (theProcessAdd);
        EventCenter.Broadcast(TheEventType.DayTimeProcess, _CurTimeData.DayProcess);

        //一天过去了 结算
        if (_CurTimeData.DayProcess >= 100)
        {
            _CurTimeData.DayProcess = 100;
            startMove = false;
            List <AwardData> awardList = new List <AwardData>();
            int       num       = (RoleManager.Instance.playerPeople.protoData.PropertyData.Level * 160 + 1290) / 7;
            AwardData awardData = new AwardData(AwardType.Property, (int)PropertyIdType.Study, num);
            awardList.Add(awardData);
            RoleManager.Instance.GetAwardAndResult(awardList, EndDay);
            //EndDay();
            //DayPlus();
        }
        else
        {
            int curDayPhaseIndex = CommonUtil.GetPhaseIndex((int)_CurTimeData.DayProcess, dayPhaseRangeArr);
            if (curDayPhaseIndex > 0)
            {
                if (curDayPhaseIndex > lastDayPhaseIndex)
                {
                    lastDayPhaseIndex = curDayPhaseIndex;
                    //得到分数
                    addScoreTime++;
                    RoleManager.Instance.GetStudyScore();
                }
            }
        }
    }
Exemple #6
0
    public void Battle()
    {
        var       winner = GameEventMgr.Instance.Battle(PlayerMgr.Instance.GetPlayerInfo(), GameEventMgr.Instance.GetMoster(rank));
        AwardData award;

        if (winner == E_Winner.player)
        {
            award = GameEventMgr.Instance.GetAward(true, rank);
            //PlayerMgr.Instance.SetAwardOrDefeat(award);
        }
        else
        {
            //award = GameEventMgr.Instance.GetAward(false, rank);
            award = new AwardData()
            {
                HP = -GameEventMgr.Instance.GetMoster(rank).Damage
            };
        }
        UIMgr.Instance.ShowPanel <AwardPanel>("AwardPanel", E_UI_layer.Top, (panel) =>
        {
            panel.closeBg         = panel.GetComponent <Image>();
            panel.VectoryOrDefeat = (winner == E_Winner.player);
            panel.data            = award;
            panel.event_Type      = E_Gmae_Event_Type.Battle;
        });
        UIMgr.Instance.ClosePanel(this.name);
    }
Exemple #7
0
    public void Buy()
    {
        AwardData award = new AwardData();

        switch (index)
        {
        case 0:
            award.LER = data[index].val;
            break;

        case 1:
            award.DEF = data[index].val;
            break;

        case 2:
            award.ATK = data[index].val;
            break;

        case 3:
            award.HP = data[index].val;
            break;
        }
        award.Money -= data[index].Price;
        PlayerMgr.Instance.SetAwardOrDefeat(award);
        Close();
    }
Exemple #8
0
 public void Recognition_EmployeeLookUp_WS_69()
 {
     if (false)
     {
         Assert.Ignore();
     }
     else
     {
         _file    = "Resources\\" + client + "\\TestsData\\WS_69.xml";
         username = AwardData.GetAwardUserName(_file);
         MainHomePage       home            = InitialPage.Go().Logon().ClickLogin();
         NominationHomePage recognitionPage = home.NavigateToNomination();
         //SCENARIO 1
         recognitionPage.SearchEmployeeFound(username);
         recognitionPage.ClickEdit();
         Assert.IsTrue(recognitionPage.BringToStep1(), "You didnt go back to step 1");
         //SCENARIO 2
         recognitionPage = home.NavigateToNomination();
         recognitionPage.ClickMultipleRecipients()
         .SearchEmployeeFoundMultiple(username)
         .SearchEmployeeFoundMultiple("John");
         recognitionPage.ClickNextGeneric().ClickEdit().ClickRemove(0);
         Assert.IsFalse(recognitionPage.IsFirstUserAddedPresent(username),
                        "First User still in the list selected");
     }
 }
Exemple #9
0
 public void SocialStream_Recognition_WS_1391()
 {
     if (!DataParser.ReturnExecution("WS_1391"))
     {
         Assert.Ignore();
     }
     else
     {
         _file = "Resources\\" + client + "\\TestsData\\WS_1391.xml";
         string user     = AwardData.GetAwardUserName(_file),
                award    = AwardData.GetAwardName(_file),
                value    = AwardData.GetAwardValue(_file),
                printype = AwardData.GetAwardDeliverType(_file),
                msg      = AwardData.GetAwardMessage(_file);
         NominationHomePage recognitionPage =
             InitialPage.Go().EnterId(client).Logon().ClickLogin().NavigateToNominationSpan();
         recognitionPage
         .SearchEmployeeFoundAngular(user)
         .SelectAward(award)
         .SelectValues(value)
         .FillMsg(msg)
         .ClickNextSprint();
         Assert.AreEqual("I want to Email this award.", recognitionPage.GetDeliverLabel("email"),
                         "Label is not correct");
         Assert.AreEqual("I want to Print this award", recognitionPage.GetDeliverLabel("print"),
                         "Label is not correct");
         recognitionPage.DeliverTypeAngular(printype).ClickNextGeneric();
         Assert.AreEqual("Ready to send?", recognitionPage.GetReadyToSendMsg(),
                         "The message is not ready to send");
         recognitionPage.ClickSendRecognition();
         Assert.AreEqual("Success!", recognitionPage.GetSuccesMsg(), "Message its not success");
         MainHomePage home = recognitionPage.ClickFinish();
         Assert.IsTrue(home.WasUserRewarded(user), user + "was not rewarded");
     }
 }
Exemple #10
0
 public void Recognition_NonMonAndMon_WS_1157_Sample6()
 {
     if (!DataParser.ReturnExecution("WS_1157_Sample6"))
     {
         Assert.Ignore();
     }
     else
     {
         _file = "Resources\\" + client + "\\TestsData\\WS_1157_Sample6.xml";
         string user = AwardData.GetAwardUserName(_file), value = AwardData.GetAwardValue(_file),
                amountvalue = AwardData.GetAwardAmountValue(_file), reason = AwardData.GetAwardReason(_file),
                award     = AwardData.GetAwardName(_file),
                printype  = AwardData.GetAwardDeliverType(_file),
                proxyname = ProxyData.GetProxyUserName(_file),
                msg       = AwardData.GetAwardMessage(_file);
         NominationHomePage recognitionPage = InitialPage.Go().EnterId(client).Logon().ClickLogin().
                                              NavigateToAdminHomePageSpan().ClickOptionProxy("Proxy1").EnterUserNameProxySprint2(proxyname).ClickProxyBtn().NavigateToNominationSpan();
         recognitionPage
         .SearchEmployeeFoundAngular(user)
         .SelectAward(award).SelectValueOfAward(amountvalue).SelectValues(value)
         .FillMsg(msg).FillReason(reason)
         .ClickNextSprint();
         Assert.AreEqual("I want to Email this award.", recognitionPage.GetDeliverLabel("email"),
                         "Label is not correct");
         Assert.AreEqual("I want to Print this award", recognitionPage.GetDeliverLabel("print"),
                         "Label is not correct");
         recognitionPage.DeliverTypeAngular(printype).ClickNextGeneric();
         Assert.AreEqual("Ready to send?", recognitionPage.GetReadyToSendMsg(),
                         "The message is not ready to send");
         recognitionPage.ClickSendRecognition();
         Assert.AreEqual("Success!", recognitionPage.GetSuccesMsg(), "Message its not success");
     }
 }
Exemple #11
0
    public void ClearAward()
    {
        bool isCleraed = SaveSystem.ClearAwardData();

        if (isCleraed)
        {
            allLevelsAward = new AwardData(6, 5, 4);
        }
    }
    /// <summary>
    /// 生成Award预制件
    /// </summary>
    /// <param name="bonusData">签到奖励表一条数据</param>
    /// <param name="tittle">预制件标题Text</param>
    /// <param name="layout">挂载点</param>
    /// <returns></returns>
    private AwardData CreatAwardData(LoginbonusTemplate bonusData, string tittle, Transform layout, bool isContinuous, bool isClaimed = false)
    {
        AwardData data;
        int       _awardId = bonusData.getRewardAndNum()[0];

        data = new AwardData(InstantiateObject(m_OriginAwardObject, layout));
        data.Init(tittle, _awardId, bonusData.getShowNum(), isContinuous, isClaimed);
        return(data);
    }
Exemple #13
0
    public static void SaveAwardInfo(AwardData singleAward)
    {
        BinaryFormatter formatter = new BinaryFormatter();
        string          path      = Application.persistentDataPath + "/award.fun";
        FileStream      stream    = new FileStream(path, FileMode.Create);

        formatter.Serialize(stream, singleAward);
        stream.Close();
    }
Exemple #14
0
    public void LoadAward()
    {
        AwardData ad = SaveSystem.LoadAwardInfo();

        allLevelsAward = new AwardData(6, 5, 4);
        if (ad != null)
        {
            allLevelsAward.awardCellsInfo = ad.awardCellsInfo;
        }
    }
    public void CalcPanelSize()
    {
        foreach (Transform child in imgPicture.transform)
        {
            GameObject.Destroy(child.gameObject);
        }
        realPictureWidth   = imgPicture.sprite.rect.width;
        realPictureHeight  = imgPicture.sprite.rect.height;
        framePictureWidth  = imgPicture.rectTransform.rect.width;
        framePictureHeight = imgPicture.rectTransform.rect.height;
        float widthCoof  = framePictureWidth / realPictureWidth;
        float heightCoof = framePictureHeight / realPictureHeight;
        float finalCoof  = 0.0f;

        if (widthCoof <= heightCoof)
        {
            finalCoof = widthCoof;
        }
        else
        {
            finalCoof = heightCoof;
        }
        float offsetWidthLeft           = (framePictureWidth - (realPictureWidth * finalCoof)) / 2;
        float offsetHeightTop           = (framePictureHeight - (realPictureHeight * finalCoof)) / 2;
        float panelToCoverWidth         = realPictureWidth * finalCoof;
        float panelToCoverHeight        = realPictureHeight * finalCoof;
        Image instantionOfPanleForCover = Instantiate(panelForCover) as Image;

        instantionOfPanleForCover.GetComponent <RectTransform>().sizeDelta = new Vector2(panelToCoverWidth, panelToCoverHeight);
        instantionOfPanleForCover.transform.position = new Vector3(offsetWidthLeft, offsetHeightTop);
        instantionOfPanleForCover.transform.SetParent(imgPicture.transform, false);
        float     fBasicTileScaleWidth  = panelToCoverWidth / numberOfColumns;
        float     fBasicTileScaleHeight = panelToCoverHeight / numberOfRows;
        AwardData tempAD = GameObject.Find("LevelsData").GetComponent <ManageOfSave>().GetAllAwardData();

        for (int i = 0; i < numberOfRows; i++)
        {
            for (int j = 0; j < numberOfColumns; j++)
            {
                if (!tempAD.awardCellsInfo[indexOfSave, j, i])
                {
                    Button tmpBut = Instantiate(buttonToCover) as Button;
                    tmpBut.name = imgPicture.name + "_" + j.ToString() + "_" + i.ToString();
                    tmpBut.onClick.AddListener(delegate { ClickButton(tmpBut.name); });
                    tmpBut.transform.position = new Vector3(fBasicTileScaleWidth * j, fBasicTileScaleHeight * i);
                    tmpBut.GetComponent <RectTransform>().sizeDelta = new Vector2(fBasicTileScaleWidth, fBasicTileScaleHeight);
                    tmpBut.transform.SetParent(instantionOfPanleForCover.transform, false);
                }
            }
        }
        CheckForDescription();
    }
Exemple #16
0
 public void Recognition_ApprovalNonMon_WS_921()
 {
     if (!DataParser.ReturnExecution("WS_921"))
     {
         Assert.Ignore();
     }
     else
     {
         _file = "Resources\\" + client + "\\TestsData\\WS_921.xml";
         string user             = AwardData.GetAwardUserName(_file),
                award            = AwardData.GetAwardName(_file),
                value            = AwardData.GetAwardValue(_file),
                amount           = AwardData.GetAwardAmountValue(_file),
                impact           = AwardData.GetAwardImpact(_file),
                printype         = AwardData.GetAwardDeliverType(_file),
                msg              = AwardData.GetAwardMessage(_file),
                reason           = AwardData.GetAwardReason(_file),
                proxy_name       = ProxyData.GetProxyUserName(_file);
         ProxyHomePage proxyPage = InitialPage.Go().Logon().ClickLogin().NavigateToAdminHomePage()
                                   .LoginProxyAsuser().EnterUserName(proxy_name);
         MainHomePage home = proxyPage.ProxyToMainHomePage();
         Assert.AreEqual("You are proxied in under: " + proxy_name, home.GetProxyLoginMsg(),
                         "The message of proxy login is not correct");
         NominationHomePage recognitionPage = home.NavigateToNomination();
         recognitionPage
         .SearchEmployeeFound(user)
         .SelectAward(award)
         .SelectValues(value)
         .FillMsg(msg);
         if (reason != "")
         {
             recognitionPage.FillReason(reason);
         }
         recognitionPage.ClickNext();
         recognitionPage.DeliverType(printype);
         Assert.AreEqual(2, recognitionPage.GetCountEditLnk(), "Edit links are not two");
         Assert.AreEqual("Ready to send?", recognitionPage.GetReadyToSendMsg(),
                         "The message is not ready to send");
         recognitionPage.ClickSendRecognition();
         Assert.AreEqual("Success!", recognitionPage.GetSuccesMsg(), "Message its not success");
         Assert.AreEqual("FINISH", recognitionPage.GetBtnFinishLabel(), "Button finish its not correct write");
         Assert.AreEqual("RECOGNIZE", recognitionPage.GetBtnRecognizOtherLabel(),
                         "Button finish its not correct write");
         AdminHomePage proxy = recognitionPage.ExitProxy();
         home = proxy.LoginProxyAsuser().EnterUserName(user).ProxyToMainHomePage();
         Assert.IsTrue(home.IsPopUpRecognitionShow(), "Pop up recognition is not showing up");
         MyAwards awards = home.ClosePopUp().NavigateToMyAwards();
         Assert.AreEqual(award, awards.GetAwardName(1, 4), "The last award that someone gave you is not present");
         awards.OpenDetailsAward(1, 7);
     }
 }
Exemple #17
0
        public void Recognition_RealTimeValidation_WS_1161()
        {
            if (!DataParser.ReturnExecution("WS_1161"))
            {
                Assert.Ignore();
            }
            else
            {
                _file = "Resources\\" + client + "\\TestsData\\WS_1161.xml";
                string user  = AwardData.GetAwardUserName(_file),
                       user1 = AwardData.GetAwardUserName1(_file)
                ,
                       user2      = AwardData.GetAwardUserName2(_file),
                       user3      = AwardData.GetAwardUserName3(_file),
                       user4      = AwardData.GetAwardUserName4(_file),
                       user5      = AwardData.GetAwardUserName5(_file),
                       proxy_name = ProxyData.GetProxyUserName(_file);

                //Scenario 1
                NominationHomePage recognitionPage =
                    InitialPage.Go().EnterId(client).EnterId(client).Logon().ClickLogin().NavigateToNominationSpan();
                recognitionPage.ClickMultipleRecipients()
                .SearchEmployeeFoundMultiple(user)
                .SearchEmployeeFoundMultiple(user1)
                .SearchEmployeeFoundMultiple(user2).SearchEmployeeFoundMultiple(user3).ClickNextGeneric();
                Assert.IsTrue(recognitionPage.IsStep2Block(), "Step2 is not blocked");

                //Scenario 2
                MainHomePage mainPage =
                    recognitionPage.NavigateToAdminHomePage()
                    .LoginProxyAsuser()
                    .EnterUserName(proxy_name)
                    .ProxyToMainHomePage();
                Step2 ste2 = mainPage.NavigateToNominationSpan().SearchEmployeeFound(user4);
                Assert.AreEqual("Rave", ste2.GetAwardName("Rave"), "Rave Award is not present");
                Assert.AreEqual("Pioneer Award", ste2.GetAwardName("Pioneer Award"), "Pioneer Award is not present");
                Assert.AreEqual("Pathfinder Award", ste2.GetAwardName("Pathfinder Award"),
                                "Pathfinder Award is not present");
                Assert.AreEqual("Trailblazer Award", ste2.GetAwardName("Trailblazer Award"),
                                "Trailblazer Award is not present");

                //Scenario 3
                ste2.Refresh();
                ste2 = recognitionPage.SearchEmployeeFound(user5);
                Assert.AreEqual("Rave", ste2.GetAwardName("Rave"), "Rave Award is not present");
                Assert.IsFalse(ste2.IsAwardPresent("Pioneer Award"), "Pioneer Award is  present");
                Assert.IsFalse(ste2.IsAwardPresent("Pathfinder Award"), "Pathfinder Award not present");
                Assert.IsFalse(ste2.IsAwardPresent("Trailblazer Award"), "Trailblazer Award not present");
            }
        }
Exemple #18
0
    /// <summary>
    /// Callback called for every award given.
    /// </summary>
    /// <param name="jsonVars"> Award data, for example extra health.</param>
    private void onAwardReceived(string jsonVars)
    {
        print("City: onAwardReceived");

        AwardData objVars = ScriptableObject.CreateInstance <AwardData>();

        JsonUtility.FromJsonOverwrite(jsonVars, objVars);

        // Hanlde health awards only.
        if (objVars.subType == "health")
        {
            SetHealth(objVars.award);
        }
    }
    /// <summary>
    /// Callback called for every award given.
    /// </summary>
    /// <param name="jsonVars"> Award data. </param>
    private void onAwardReceived(string jsonVars)
    {
        print("GM:onAwardReceived");

        AwardData objVars = ScriptableObject.CreateInstance <AwardData>();

        JsonUtility.FromJsonOverwrite(jsonVars, objVars);

        // Hanlde score awards only.
        if ((objVars.type == "bomb") || (objVars.type == "booster" && objVars.subType == "score"))
        {
            UserModel.Instance.CurrentScore += objVars.award;
            SetScoreUI();
        }
    }
        private async void AssembleAwardDetails()
        {
            awardDetails.Text = "";
            var awards = await gameSvc.GetAwardsByActivity();

            if (awards != null && awards.Data != null)
            {
                if (awards.Data.Count > 0)
                {
                    awardInfo = awards.Data[0];
                }
                foreach (var award in awards.Data)
                {
                    awardDetails.Text += $"Award:{award.Name}--AwardId:{award.Id}----{award.AwardProduct}" + Environment.NewLine;
                }
            }
        }
Exemple #21
0
    // 选择完成之后会被回调这个函数
    public void OnHandleChangeAns(E_Game_Event_Ans ans)
    {
        bool vd = data.ans == (int)ans;

        UIMgr.Instance.ClosePanel(this.name);
        //jiangli
        AwardData awardData = GameEventMgr.Instance.GetAward(vd, data.rank);

        UIMgr.Instance.ShowPanel <AwardPanel>("AwardPanel", E_UI_layer.Top, (panel) =>
        {
            panel.closeBg         = panel.GetComponent <Image>();
            panel.VectoryOrDefeat = vd;
            awardData.LER         = 0;
            panel.data            = awardData;
            panel.event_Type      = E_Gmae_Event_Type.Qa;
        });
    }
Exemple #22
0
    public static AwardData LoadAwardInfo()
    {
        string path = Application.persistentDataPath + "/award.fun";

        if (File.Exists(path))
        {
            BinaryFormatter formatter = new BinaryFormatter();
            FileStream      stream    = new FileStream(path, FileMode.Open);
            AwardData       data      = formatter.Deserialize(stream) as AwardData;
            stream.Close();
            return(data);
        }
        else
        {
            Debug.LogError("Save file not found in " + path);
            return(null);
        }
    }
Exemple #23
0
    // 设置状态
    public void SetAwardOrDefeat(AwardData data)
    {
        playerInfo.HP    = Mathf.Clamp(playerInfo.HP += data.HP, 0, 100);
        playerInfo.ATK   = Mathf.Clamp(playerInfo.ATK += data.ATK, 0, 999);
        playerInfo.DEF   = Mathf.Clamp(playerInfo.DEF += data.DEF, 0, 999);
        playerInfo.LER   = Mathf.Clamp(playerInfo.LER += data.LER, 0, int.MaxValue);
        playerInfo.Money = Mathf.Clamp(playerInfo.Money += data.Money, 0, int.MaxValue);

        // 死
        if (playerInfo.HP == 0)
        {
            player.playerFSM.ChangeState(E_FSM_State_Type.PlayerDead);
            Evencenter.Instance.EventTrigger <bool>(EventName.GAME_OVER, false);
            return;
        }
        // 状态改变
        Evencenter.Instance.EventTrigger <PlayerInfo> (EventName.PLAYER_PROPERTY_CHANGE, playerInfo);
    }
Exemple #24
0
 public void Admin_NoPermissionNoAccess_WS_1206()
 {
     if (!DataParser.ReturnExecution("WS_1206"))
     {
         Assert.Ignore();
     }
     else
     {
         _file = "Resources\\" + client + "\\TestsData\\WS_1206.xml";
         string       user  = AwardData.GetAwardUserName(_file);
         MainHomePage proxy = InitialPage.Go().Logon().ClickLogin().NavigateToAdminHomePageSpan().
                              ClickOptionProxy("Proxy").EnterUserNameProxySprint2(user).ProxyToMainHomePageSprint().ClosePopUp();
         Assert.AreEqual("You are proxied in as:" + user, proxy.GetProxyLoginMsgSprint(),
                         "The message of proxy login is not correct");
         Assert.AreEqual("Exit Proxy", proxy.GetExitMsg(), "The exit proxy link is not present");
         Assert.IsFalse(proxy.IsAdmLnkPresent(), "Admin link is present");
     }
 }
Exemple #25
0
 public void Recognition_DistributionList_WS_1024()
 {
     if (!DataParser.ReturnExecution("WS_1024"))
     {
         Assert.Ignore();
     }
     else
     {
         _file = "Resources\\" + client + "\\TestsData\\WS_1024.xml";
         string user       = AwardData.GetAwardUserName(_file),
                msg        = AwardData.GetAwardMessage(_file),
                award      = AwardData.GetAwardName(_file),
                subAward1  = AwardData.GetAwardSubType1(_file),
                subAward2  = AwardData.GetAwardSubType2(_file),
                ccEmail    = AwardData.GetAwardCCEmail(_file),
                futureDate = AwardData.GetAwardFutureDate(_file);
         NominationHomePage recognitionPage =
             InitialPage.GoSpecial(_file)
             .Logon()
             .EnterId(client)
             .ClickLogin()
             .NavigateToNominationSprint();
         recognitionPage
         .SelectRecipientType("multiple")
         .SearchEmployeeFoundMultiple(user)
         .ClickNextStep2()
         .SelectAwardMultiple(award, 0)
         .SelectSubAwardTypeSprint(subAward1, subAward2)
         .ClickNextFillCard()
         .FillEditCardEditor(msg)
         .ClickNextStep()
         .EnterUserCCEmail(ccEmail).EnterFutureDate(futureDate).ClickNextGeneric();
         Assert.AreEqual("Ready to send?", recognitionPage.GetReadyToSendMsg(),
                         "The message is not ready to send");
         Assert.AreEqual("SEND RECOGNITION", recognitionPage.GetBtnSendRecognition(),
                         "Submit button is not well written");
         recognitionPage.ClickSendRecognition();
         Assert.AreEqual("Success!", recognitionPage.GetSuccesMsg(), "Message its not success");
         Assert.AreEqual("FINISH", recognitionPage.GetBtnFinishLabel(), "Button finish its not correct write");
         Assert.AreEqual("RECOGNIZE SOMEONE ELSE", recognitionPage.GetBtnRecognizOtherLabelSprint(),
                         "Button finish its not correct write");
         Assert.Fail("Missing steps DUE to bug, ticket name SPRIN-91");
     }
 }
Exemple #26
0
 //WS_1057
 public void WS_1057()
 {
     if (!DataParser.ReturnExecution("WS_1057"))
     {
         Assert.Ignore();
     }
     else
     {
         _file = "Resources\\" + client + "\\TestsData\\WS_1057.xml";
         string user = AwardData.GetAwardUserName(_file), msg = AwardData.GetAwardMessage(_file),
                award = AwardData.GetAwardName(_file), value = AwardData.GetAwardValue(_file);
         NominationHomePage recognitionPage = InitialPage.Go().Logon().ClickLogin().NavigateToNominationSpan();
         Thread.Sleep(1500);
         recognitionPage
         .SearchEmployeeFound(user)
         .SelectAward(award)
         .SelectValues(value)
         .FillMsg(msg)
         .ClickNext()
         .EmailReward();
         Assert.AreEqual("Ready to send?", recognitionPage.GetReadyToSendMsg(),
                         "The message is not ready to send");
         Assert.AreEqual("SEND RECOGNITION", recognitionPage.GetBtnSendRecognitionAward(), "Submit button is not well written");
         recognitionPage.ClickSendRecognition();
         Assert.AreEqual("Success!", recognitionPage.GetSuccesMsg(), "Message its not success");
         Assert.AreEqual("FINISH", recognitionPage.GetBtnFinishLabel(), "Button finish its not correct write");
         Assert.AreEqual("RECOGNIZE SOMEONE ELSE", recognitionPage.GetBtnRecognizOtherLabelXpath(),
                         "Button finish its not correct write");
         ReportsPage details = recognitionPage.NavigateToReportsSpan().NavigateToReports();
         Assert.AreEqual(award, details.GetAwardTable(1, 6), award + "award was not given");
         Assert.AreEqual(user, details.GetAwardTable(1, 3), user + "user was not given or present");
         var proxypage =
             details.NavigateToAdminHomePageSpan()
             .ClickOptionProxy("Proxy")
             .EnterUserName(user)
             .ProxyToMainHomePage().ClosePopUp();
         Thread.Sleep(300);
         var myawards = proxypage.NavigateToMyAwards();
         Assert.AreEqual(award, myawards.GetAwardName(1, 5), award + "award was not given");
     }
 }
Exemple #27
0
    public void Close()
    {
        UIMgr.Instance.ClosePanel(this.name);
        AwardData awardData = GameEventMgr.Instance.GetAward(false, rank);
        AwardData newdata   = new AwardData()
        {
            ATK   = awardData.ATK / 2,
            DEF   = awardData.DEF / 2,
            LER   = awardData.LER / 2,
            Money = awardData.Money / 2,
            HP    = awardData.HP / 2
        };

        UIMgr.Instance.ShowPanel <AwardPanel>("AwardPanel", E_UI_layer.Top, (panel) =>
        {
            panel.closeBg         = panel.GetComponent <Image>();
            panel.VectoryOrDefeat = false;
            panel.data            = newdata;
            panel.event_Type      = E_Gmae_Event_Type.Battle;
        });
    }
            public AwardValueData RandomAwardValueData()
            {
                AwardData selData = awardData[awardData.Length - 1];
                int       value   = FTLibrary.Command.FTRandom.Next(100);
                int       total   = 0;

                for (int i = 0; i < awardData.Length; i++)
                {
                    total += awardData[i].rate;
                    if (value < total)
                    {
                        selData = awardData[i];
                        break;
                    }
                }
                AwardValueData ret = new AwardValueData();

                ret.type  = selData.type;
                ret.value = (selData.minvalue + FTLibrary.Command.FTRandom.Next(selData.maxvalue - selData.minvalue + 1)) * selData.multiple;
                return(ret);
            }
Exemple #29
0
 public void Award_Wizard_WS_1345_Sample1()
 {
     if (!DataParser.ReturnExecution("WS_1345_Sample1"))
     {
         Assert.Ignore();
     }
     else
     {
         _file = "Resources\\" + client + "\\TestsData\\WS_1345_Sample1.xml";
         string user = AwardData.GetAwardUserName(_file),
                award = AwardData.GetAwardName(_file), financialImpact = AwardData.GetAwardFinancialImpact(_file),
                bussinesImpact = AwardData.GetAwardBussinesImpact(_file);
         NominationHomePage recognitionPage = InitialPage.GoSpecial(_file).Logon().ClickLogin()
                                              .NavigateToNominationSpan();
         recognitionPage
         .SearchEmployeeFoundAngular(user)
         .SelectAward(award).SelectValues(bussinesImpact).SelectValues(financialImpact);
         Assert.AreEqual("I want to Email this award.", recognitionPage.GetDeliverLabel("email"),
                         "Label is not correct");
     }
 }
Exemple #30
0
 public void Awards_RemoveFromOtherAppQueue_WS_1111()
 {
     if (!DataParser.ReturnExecution("WS_1111"))
     {
         Assert.Ignore();
     }
     else
     {
         _file = "Resources\\" + client + "\\TestsData\\WS_1111.xml";
         string user = AwardData.GetAwardUserName(_file),
                award = AwardData.GetAwardName(_file), customerImpact = AwardData.GetAwardCustomerImpact(_file),
                bussinesImpact = AwardData.GetAwardBussinesImpact(_file),
                printype       = AwardData.GetAwardDeliverType(_file),
                msg            = AwardData.GetAwardMessage(_file),
                reason         = AwardData.GetAwardReason(_file),
                proxy_name     = ProxyData.GetProxyUserName(_file),
                approval_name  = AwardData.GetApprovalUserName(_file);
         Step2 step2           = InitialPage.Go().Logon().ClickLogin().NavigateToNominationSpan()
                                 .SearchEmployeeFound(user)
                                 .SelectAward(award);
         Assert.AreEqual("This award is worth $250.00", step2.GetValueAward(), "the message is not right");
         NominationHomePage recognitionPage = step2.SelectSameValues(customerImpact, 1)
                                              .FillMsg(msg)
                                              .FillReason(reason)
                                              .ClickNext();
         step2.SelectSameValues(bussinesImpact, 0).ClickNext();
         recognitionPage.DeliverType(printype);
         Assert.AreEqual(2, recognitionPage.GetCountEditLnk(), "Edit links are not two");
         recognitionPage.ClickSendRecognition();
         Assert.AreEqual("Success!", recognitionPage.GetSuccesMsg(), "Message its not success");
         MainHomePage home = recognitionPage.NavigateToAdminHomePageSpan().EnterUserName(proxy_name).ProxyToMainHomePage();
         Assert.IsTrue(home.IsPopUpRecognitionShow(), "Pop up recognition is not showing up");
         PendingApprovals change = home.ClickHereAwardPopUp();
         Assert.AreEqual("Pending Approvals", change.GetTitleMenu(), "Title is not pending approval");
         change.ApproveAward().ClickApprove();
         Assert.AreEqual("Pending Approvals", change.GetTitleMenu(), "Title is not pending approval");
         home = change.ExitProxyToMainPage().NavigateToAdminHomePageSpan().NavigateToAdminHomePageSpan().EnterUserName(approval_name).ProxyToMainHomePage();
         Assert.IsFalse(home.IsPopUpRecognitionShow(), "Pop up recognition is showing up");
     }
 }