Exemple #1
0
        public void Recognition_UploadAttachments_WS_1166_Sample1()
        {
            if (!DataParser.ReturnExecution("WS_1166"))
            {
                Assert.Ignore();
            }
            else
            {
                _file = "Resources\\" + client + "\\TestsData\\WS_1166.xml";
                AwardData.GetAwardImpact(_file);
                string user            = AwardData.GetAwardUserName(_file),
                       award           = AwardData.GetAwardName(_file),
                       value           = AwardData.GetAwardValue(_file),
                       secondvalue     = AwardData.GetAwardSecondValue(_file),
                       file_name       = GeneralData.GetFileName(_file),
                       path_file_wrong = GeneralData.GetPathWrongFile(_file).Trim(),
                       reason          = AwardData.GetAwardMessage(_file),
                       path_file       = GeneralData.GetPathFile(_file).Trim(),
                       proxy_name      = ProxyData.GetProxyUserName(_file);

                //Scenario 1
                NominationHomePage recognitionPage =
                    InitialPage.Go().Logon().ClickLogin().NavigateToAdminHomePage().LoginProxyAsuser()
                    .EnterUserName(proxy_name).ProxyToMainHomePage().ClosePopUp().NavigateToNomination();
                recognitionPage
                .SearchEmployeeFound(user)
                .SelectAward(award)
                .SelectValues(value)
                .SelectValues(secondvalue)
                .FillReason(reason);
                recognitionPage.ClickUploadFile();
                foreach (char a in path_file)
                {
                    SendKeys.SendWait(a.ToString());
                    Thread.Sleep(30);
                }
                SendKeys.SendWait("{ENTER}");
                Assert.IsTrue(recognitionPage.WasFileUploadedCorrectly(file_name), "The file was not upload");
            }
        }