Esempio n. 1
0
        public AdminWindow(int signedInAdminID)
        {
            InitializeComponent();
            AdminWindowObject = this;

            signedInAdmin = new AdminModel(signedInAdminID);

            // Initialize DataContext with signedInAdmin Model
            DataContext = signedInAdmin;

            ControlUpdateNewAdminPasswordGrid(signedInAdmin.ID);

            // Initialize AdminWindowPages Objects

            AdminHomePageObject       = new AdminHomePage();
            ChallengesSetupPageObject = new ChallengesSetupPage();
            AdminSettingsPageObject   = new AdminSettingsPage();

            // Initialize Listbox Selected Index
            AdminWindowPagesListBox.SelectedIndex = 0;

            // Intialize MessagesQueue and Assign it to MessagesSnackbar's MessageQueue
            var MessagesQueue = new SnackbarMessageQueue(System.TimeSpan.FromMilliseconds(2000));

            MessagesSnackbar.MessageQueue = MessagesQueue;
        }
Esempio n. 2
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);
     }
 }
Esempio n. 3
0
        public void CreateCompatyPickupTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminCompanies.Click();
            adminPage.Companies.Click();
            var companiesPage = adminPage.GoTo <CompaniesPage>();

            companiesPage.Table.RowSearch.Name.SetValue(companyPickupName);
            companiesPage = companiesPage.SeachButtonRowClickAndGo();

            while (companiesPage.Table.GetRow(0).Name.IsPresent)
            {
                companiesPage.Table.GetRow(0).ActionsDelete.Click();
                companiesPage.Aletr.Accept();
                companiesPage = companiesPage.GoTo <CompaniesPage>();
                companiesPage.Table.RowSearch.Name.SetValue(companyPickupName);
                companiesPage = companiesPage.SeachButtonRowClickAndGo();
            }
            companiesPage.Create.Click();
            var companyCreatePage = companiesPage.GoTo <CompanyCreatePage>();

            companyCreatePage.Name.SetValueAndWait(companyPickupName);
            companyCreatePage.CompanyDriver.SelectValue("Aplix");
            companyCreatePage.CompanyAddress.SetValueAndWait("Address");
            companyCreatePage.ItemsMax.SetValueAndWait("3");
            companyCreatePage.ManagersLegalEntity.SetFirstValueSelect(legalEntityName);
            companyCreatePage.ManagersPickup.SetFirstValueSelect(legalPickupName);
            companyCreatePage.SaveButton.Click();
            companiesPage = companyCreatePage.GoTo <CompaniesPage>();
            var adminMaintenancePage = LoadPage <AdminMaintenancePage>("admin/maintenance/cache_flush");

            adminMaintenancePage.AlertText.WaitText("Cache flushed!");
        }
Esempio n. 4
0
        public void CreateSelfPriceTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminCompanies.Click();
            adminPage.Times.Mouseover();
            adminPage.TimesSelf.Click();
            var timesSelfPage = adminPage.GoTo <AdminBaseListPage>();

            timesSelfPage.LabelDirectory.WaitText(@"Справочник ""Сроки доставки""");
            timesSelfPage.Table.RowSearch.CompanyName.SetValue(companyName);
            timesSelfPage = timesSelfPage.SeachButtonRowClickAndGo();

            while (timesSelfPage.Table.GetRow(0).ColumnThree.IsPresent)
            {
                timesSelfPage.Table.GetRow(0).ActionsDelete.Click();
                timesSelfPage = timesSelfPage.GoTo <AdminBaseListPage>();
                timesSelfPage.Table.RowSearch.CompanyName.SetValue(companyName);
                timesSelfPage = timesSelfPage.SeachButtonRowClickAndGo();
            }
            timesSelfPage.Create.Click();
            var timeSelfCreatePage = timesSelfPage.GoTo <TimeCreatePage>();

            timeSelfCreatePage.CompanyName.SetFirstValueSelect(companyName);
            timeSelfCreatePage.Route.SetFirstValueSelect("2", "г. Москва #151184 - г. Москва #151184");
            timeSelfCreatePage.MaxTime.SetValueAndWait("1");
            timeSelfCreatePage.MinTime.SetValueAndWait("1");
            timeSelfCreatePage.SaveButton.Click();
            timesSelfPage = timeSelfCreatePage.GoTo <AdminBaseListPage>();

            timesSelfPage.Table.RowSearch.CompanyName.SetValue(companyName);
            timesSelfPage = timesSelfPage.SeachButtonRowClickAndGo();
            timesSelfPage.Table.GetRow(0).ColumnThree.WaitText(companyName);
        }
Esempio n. 5
0
        public void CreateMarginsTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminCompanies.Click();
            adminPage.Margins.Mouseover();
            adminPage.MarginsValue.Click();
            var marginsValuePage = adminPage.GoTo <MarginsValuePage>();

            Assert.AreEqual(marginsValuePage.Table.GetRow(0).Name.GetText(), "Забор");
            marginsValuePage.Table.GetRow(0).ActionsEdit.Click();
            var marginsValueCreatePage = marginsValuePage.GoTo <MarginsValueCreatePage>();

            marginsValueCreatePage.Value.SetValue(marginsPickup.ToString());
            marginsValueCreatePage.Mode.SelectValue("Рубли");
            marginsValueCreatePage.SaveButton.Click();
            marginsValuePage = marginsValueCreatePage.GoTo <MarginsValuePage>();

            Assert.AreEqual(marginsValuePage.Table.GetRow(2).Name.GetText(), "Самовывоз");
            marginsValuePage.Table.GetRow(2).ActionsEdit.Click();
            marginsValueCreatePage = marginsValuePage.GoTo <MarginsValueCreatePage>();
            marginsValueCreatePage.Value.SetValue(marginsSelf.ToString());
            marginsValueCreatePage.Mode.SelectValue("Рубли");
            marginsValueCreatePage.SaveButton.Click();
            marginsValuePage = marginsValueCreatePage.GoTo <MarginsValuePage>();

            Assert.AreEqual(marginsValuePage.Table.GetRow(4).Name.GetText(), "Курьерская доставка");
            marginsValuePage.Table.GetRow(4).ActionsEdit.Click();
            marginsValueCreatePage = marginsValuePage.GoTo <MarginsValueCreatePage>();
            marginsValueCreatePage.Value.SetValue(marginsCourirs.ToString());
            marginsValueCreatePage.Mode.SelectValue("Рубли");
            marginsValueCreatePage.SaveButton.Click();
            marginsValuePage = marginsValueCreatePage.GoTo <MarginsValuePage>();
        }
Esempio n. 6
0
        public void OneTimeTearDown()
        {
            AdminLoginPage ALoginPage = LoadAdminLoginPage();

            ALoginPage.ClickLoginButton();
            AdminHomePage adminHomePage = ALoginPage.LogInAdmin();

            adminHomePage.ClickSystemMenu();
            adminHomePage.ClickLocalizationMenu();
            adminHomePage.ClickTaxesMenu();
            TaxClassesPage taxClassesPage = adminHomePage.GoToTaxClassesPage();

            taxClassesPage = taxClassesPage.RemoveRuleFromTaxClass(TaxClassesRepository.GetTaxebleProductsTaxClass(), TaxRateRepository.GetFixTaxRate());
            taxClassesPage = taxClassesPage.RemoveRuleFromTaxClass(TaxClassesRepository.GetTaxebleProductsTaxClass(), TaxRateRepository.GetPercentageTaxRate());
            Thread.Sleep(3000);         // for presentation ONLY
            taxClassesPage.ClickSystemMenu();
            TaxRatesPage taxRatesPage = taxClassesPage.GoToTaxRatesPage();

            taxRatesPage = taxRatesPage.DeleteTaxRate(TaxRateRepository.GetFixTaxRate().Name);
            taxRatesPage = taxRatesPage.DeleteTaxRate(TaxRateRepository.GetPercentageTaxRate().Name);
            Thread.Sleep(3000);         // for presentation ONLY
            taxClassesPage.ClickSystemMenu();
            GeoZonesPage geoZonesPage = taxClassesPage.GoToGeoZonePage();

            geoZonesPage.DeleteGeoZone(GeoZonesRepository.GetUAGeoZone().Name);
            Thread.Sleep(1000);         // for presentation ONLY
        }
Esempio n. 7
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);
     }
 }
Esempio n. 8
0
        public void T07_DeletePickupTimetableTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            //            удаление графика забора если он был
            adminPage.AdminCompanies.Click();
            adminPage.PickupTimetable.Click();
            var pickupTimetablePage = adminPage.GoTo <AdminBaseListPage>();

            pickupTimetablePage.Table.RowSearch.CompanyName.SetValue(companyPickupName);
            pickupTimetablePage = pickupTimetablePage.SeachButtonRowClickAndGo();
            while (pickupTimetablePage.Table.GetRow(0).Name.IsPresent)
            {
                pickupTimetablePage.Table.GetRow(0).ActionsDelete.Click();
                pickupTimetablePage.Aletr.Accept();
                pickupTimetablePage = pickupTimetablePage.GoTo <AdminBaseListPage>();
                pickupTimetablePage.Table.RowSearch.CompanyName.SetValue(companyPickupName);
                pickupTimetablePage = pickupTimetablePage.SeachButtonRowClickAndGo();
            }

            pickupTimetablePage.Table.RowSearch.CompanyName.SetValue(companyName);
            pickupTimetablePage = pickupTimetablePage.SeachButtonRowClickAndGo();
            while (pickupTimetablePage.Table.GetRow(0).Name.IsPresent)
            {
                pickupTimetablePage.Table.GetRow(0).ActionsDelete.Click();
                pickupTimetablePage = pickupTimetablePage.GoTo <AdminBaseListPage>();
                pickupTimetablePage.Table.RowSearch.CompanyName.SetValue(companyName);
                pickupTimetablePage = pickupTimetablePage.SeachButtonRowClickAndGo();
            }
        }
Esempio n. 9
0
        public void CreateTimesPickupTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminCompanies.Click();
            adminPage.Times.Mouseover();
            adminPage.TimesPickup.Click();
            var timesPickupPage = adminPage.GoTo <AdminBaseListPage>();

            timesPickupPage.LabelDirectory.WaitText(@"Справочник ""Время забора""");
            timesPickupPage.Table.RowSearch.CompanyName.SetValue(companyPickupName);
            timesPickupPage = timesPickupPage.SeachButtonRowClickAndGo();

            while (timesPickupPage.Table.GetRow(0).Name.IsPresent)
            {
                timesPickupPage.Table.GetRow(0).ActionsDelete.Click();
                timesPickupPage.Aletr.Accept();
                timesPickupPage = timesPickupPage.GoTo <AdminBaseListPage>();
                timesPickupPage.Table.RowSearch.CompanyName.SetValue(companyPickupName);
                timesPickupPage = timesPickupPage.SeachButtonRowClickAndGo();
            }
            timesPickupPage.Create.Click();
            var timePickupCreatePage = timesPickupPage.GoTo <TimePickupCreatePage>();

            timePickupCreatePage.CompanyName.SetFirstValueSelect(companyPickupName);
            timePickupCreatePage.City.SetFirstValueSelect("Москва");
            timePickupCreatePage.MaxTime.SetValueAndWait("1");
            timePickupCreatePage.MinTime.SetValueAndWait("1");
            timePickupCreatePage.SaveButton.Click();
            timesPickupPage = timePickupCreatePage.GoTo <AdminBaseListPage>();

            timesPickupPage.Table.RowSearch.CompanyName.SetValue(companyPickupName);
            timesPickupPage = timesPickupPage.SeachButtonRowClickAndGo();
            timesPickupPage.Table.GetRow(0).Name.WaitText(companyPickupName);
        }
Esempio n. 10
0
        public void CreateWeightTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.DirectoryList.Click();
            adminPage.Intervals.Mouseover();
            adminPage.IntervalsWeight.Click();
            var intervalsWeightPage = adminPage.GoTo <AdminBaseListPage>();

            intervalsWeightPage.LabelDirectory.WaitText(@"Справочник ""Веса""");
            intervalsWeightPage.Table.RowSearch.Name.SetValue(weightName);
            intervalsWeightPage = intervalsWeightPage.SeachButtonRowClickAndGo();

            while (intervalsWeightPage.Table.GetRow(0).Name.IsPresent)
            {
                intervalsWeightPage.Table.GetRow(0).ActionsDelete.Click();
                intervalsWeightPage.Aletr.Accept();
                intervalsWeightPage = intervalsWeightPage.GoTo <AdminBaseListPage>();
                intervalsWeightPage.Table.RowSearch.Name.SetValue(weightName);
                intervalsWeightPage = intervalsWeightPage.SeachButtonRowClickAndGo();
            }
            intervalsWeightPage.Create.Click();
            var intervalWeightCreatePage = intervalsWeightPage.GoTo <IntervalWeightCreatePage>();

            intervalWeightCreatePage.Name.SetValueAndWait(weightName);
            intervalWeightCreatePage.Min.SetValueAndWait(weightMin.ToString());
            intervalWeightCreatePage.Max.SetValueAndWait(weightMax.ToString());
            intervalWeightCreatePage.SaveButton.Click();
            intervalsWeightPage = intervalWeightCreatePage.GoTo <AdminBaseListPage>();

            intervalsWeightPage.Table.RowSearch.Name.SetValue(weightName);
            intervalsWeightPage = intervalsWeightPage.SeachButtonRowClickAndGo();
            intervalsWeightPage.Table.GetRow(0).Name.WaitText(weightName);
        }
Esempio n. 11
0
        public void CreatePaymentPriceTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminCompanies.Click();
            adminPage.PaymentPrice.Click();
            var рaymentPricePage = adminPage.GoTo <AdminBaseListPage>();

            рaymentPricePage.LabelDirectory.WaitText(@"Справочник ""Возможность наложенного платежа""");
            рaymentPricePage.Table.RowSearch.CompanyName.SetValue(companyName);
            рaymentPricePage = рaymentPricePage.SeachButtonRowClickAndGo();

            while (рaymentPricePage.Table.GetRow(0).Name.IsPresent)
            {
                рaymentPricePage.Table.GetRow(0).ActionsDelete.Click();
                рaymentPricePage.Aletr.Accept();
                рaymentPricePage = рaymentPricePage.GoTo <AdminBaseListPage>();
                рaymentPricePage.Table.RowSearch.CompanyName.SetValue(companyName);
                рaymentPricePage = рaymentPricePage.SeachButtonRowClickAndGo();
            }
            рaymentPricePage.Create.Click();
            var рaymentPriceCreatePage = рaymentPricePage.GoTo <PaymentPriceCreatePage>();

            рaymentPriceCreatePage.Company.SetFirstValueSelect(companyName);
            рaymentPriceCreatePage.City.SetFirstValueSelect("Москва");
            рaymentPriceCreatePage.SaveButton.Click();
            рaymentPricePage = рaymentPriceCreatePage.GoTo <AdminBaseListPage>();

            рaymentPricePage.Table.RowSearch.CompanyName.SetValue(companyName);
            рaymentPricePage = рaymentPricePage.SeachButtonRowClickAndGo();
            рaymentPricePage.Table.GetRow(0).Name.WaitText(companyName);
        }
Esempio n. 12
0
        private void label13_Click(object sender, EventArgs e)
        {
            AdminHomePage adminhomepage = new AdminHomePage();

            this.Hide();
            adminhomepage.Closed += (s, args) => this.Close();
            adminhomepage.Show();
        }
Esempio n. 13
0
        public void T01_CreateWarehouseTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminUsers.Click();
            adminPage.UsersWarehouses.Click();
            var warehousesPage = adminPage.GoTo <AdminBaseListPage>();

            warehousesPage.LabelDirectory.WaitText(@"Справочник ""Склады""");
            warehousesPage.Table.RowSearch.Name.SetValue(userWarehouseName);
            warehousesPage = warehousesPage.SeachButtonRowClickAndGo();
            while (warehousesPage.Table.GetRow(0).Name.IsPresent)
            {
                warehousesPage.Table.GetRow(0).ActionsDelete.Click();
                warehousesPage.Aletr.Accept();
                warehousesPage = warehousesPage.GoTo <AdminBaseListPage>();
                warehousesPage.Table.RowSearch.Name.SetValue(userWarehouseName);
                warehousesPage = warehousesPage.SeachButtonRowClickAndGo();
            }
            var          defaulPage = warehousesPage.LoginOut();
            UserHomePage userPage   = defaulPage.LoginAsUser(userNameAndPass, userNameAndPass);

            userPage.UseProfile.Click();
            userPage.UserWarehouses.Click();
            var warehousesListPage = userPage.GoTo <UserWarehousesPage>();

            warehousesListPage.WarehousesCreate.Click();
            var warehouseCreatePage = warehousesListPage.GoTo <UserWarehouseCreatePage>();

            warehouseCreatePage.Name.SetValueAndWait(userWarehouseName);
            warehouseCreatePage.Street.SetValueAndWait("Улица");
            warehouseCreatePage.House.SetValueAndWait("Дом");
            warehouseCreatePage.Flat.SetValueAndWait("Квартира");
            warehouseCreatePage.ContactPerson.SetValueAndWait(legalEntityName);
            warehouseCreatePage.ContactPhone.SetValueAndWait("1111111111");
            warehouseCreatePage.PostalCode.SetValueAndWait("555444");
            warehouseCreatePage.ContactEmail.SetValueAndWait(userNameAndPass);
            warehouseCreatePage.City.SetFirstValueSelect("Москва");

            for (int i = 0; i < 7; i++)
            {
                warehouseCreatePage.GetDay(i).FromHour.SetValueAndWait("1:12");
                warehouseCreatePage.GetDay(i).ToHour.SetValueAndWait("23:23");
            }

            warehouseCreatePage.CreateButton.Click();
            warehousesListPage = warehouseCreatePage.GoTo <UserWarehousesPage>();

            warehousesListPage.Table.GetRow(0).Name.WaitPresence();

            var defaultPage = warehousesListPage.LoginOut();

            adminPage = defaultPage.LoginAsAdmin(adminName, adminPass);
            var adminMaintenancePage = LoadPage <AdminMaintenancePage>("admin/maintenance/cache_flush");

            adminMaintenancePage.AlertText.WaitText("Cache flushed!");
        }
Esempio n. 14
0
        public override void PreCondition()
        {
            base.PreCondition();
            LogProgress("Admin is going to Login Page ");
            var loginPage = welcomePage.SignIn();

            LogProgress("Admin is going to his Home Page");
            homePage = loginPage.LoginAsAdmin("*****@*****.**", "Admin123");
        }
Esempio n. 15
0
        public void CreateCompatyTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminCompanies.Click();
            adminPage.Companies.Click();
            var companiesPage = adminPage.GoTo <AdminBaseListPage>();

            companiesPage.LabelDirectory.WaitText(@"Справочник ""Компании""");
            companiesPage.Table.RowSearch.Name.SetValue(companyName);
            companiesPage = companiesPage.SeachButtonRowClickAndGo();

            while (companiesPage.Table.GetRow(0).Name.IsPresent)
            {
                companiesPage.Table.GetRow(0).ActionsDelete.Click();
                companiesPage.Aletr.Accept();
                companiesPage = companiesPage.GoTo <AdminBaseListPage>();
                companiesPage.Table.RowSearch.Name.SetValue(companyName);
                companiesPage = companiesPage.SeachButtonRowClickAndGo();
            }
            companiesPage.Create.Click();
            var companyCreatePage = companiesPage.GoTo <CompanyCreatePage>();

            companyCreatePage.Name.SetValueAndWait(companyName);
            companyCreatePage.CompanyPickup.SetFirstValueSelect(companyPickupName);
            companyCreatePage.CompanyPickupAddButton.Click();
            companyCreatePage.CompanyDriver.SelectValue("Boxberry");
            companyCreatePage.CompanyAddress.SetValueAndWait("Address");
            companyCreatePage.ItemsMax.SetValueAndWait("3");
            companyCreatePage.PackingPaid.UncheckAndWait();
            companyCreatePage.PackingRequired.UncheckAndWait();
            companyCreatePage.ManagersLegalEntity.SetFirstValueSelect(legalEntityName);
            companyCreatePage.SaveButton.Click();
            companiesPage = companyCreatePage.GoTo <AdminBaseListPage>();
            var adminMaintenancePage = LoadPage <AdminMaintenancePage>("admin/maintenance/cache_flush");

            adminMaintenancePage.AlertText.WaitText("Cache flushed!");

//            удаление календаря если он был
            adminMaintenancePage.AdminCompanies.Click();
            adminMaintenancePage.Calendars.Click();
            var calendarsPage = adminMaintenancePage.GoTo <AdminBaseListPage>();

            calendarsPage.LabelDirectory.WaitText(@"Справочник ""Календарь выходных дней компании""");
            calendarsPage.Table.RowSearch.CompanyName.SetValue(companyName);
            calendarsPage = calendarsPage.SeachButtonRowClickAndGo();
            while (calendarsPage.Table.GetRow(0).ColumnThree.IsPresent)
            {
                calendarsPage.Table.GetRow(0).ActionsDelete.Click();
                calendarsPage = calendarsPage.GoTo <AdminBaseListPage>();
                calendarsPage.Table.RowSearch.CompanyName.SetValue(companyName);
                calendarsPage = calendarsPage.SeachButtonRowClickAndGo();
            }

            adminMaintenancePage = LoadPage <AdminMaintenancePage>("admin/maintenance/cache_flush");
            adminMaintenancePage.AlertText.WaitText("Cache flushed!");
        }
Esempio n. 16
0
        public void CreateDeliveryPointTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminCompanies.Click();
            adminPage.DeliveryPoints.Click();
            var deliveryPointsPage = adminPage.GoTo <AdminBaseListPage>();

            deliveryPointsPage.LabelDirectory.WaitText(@"Справочник ""Пункты выдачи""");
            deliveryPointsPage.Table.RowSearch.Name.SetValue(deliveryPointName);
            deliveryPointsPage = deliveryPointsPage.SeachButtonRowClickAndGo();

            while (deliveryPointsPage.Table.GetRow(0).Name.IsPresent)
            {
                deliveryPointsPage.Table.GetRow(0).ActionsDelete.Click();
                deliveryPointsPage.Aletr.Accept();
                deliveryPointsPage = deliveryPointsPage.GoTo <AdminBaseListPage>();
                deliveryPointsPage.Table.RowSearch.Name.SetValue(deliveryPointName);
                deliveryPointsPage = deliveryPointsPage.SeachButtonRowClickAndGo();
            }
            deliveryPointsPage.Create.Click();
            var deliveryPointCreatePage = deliveryPointsPage.GoTo <DeliveryPointCreatePage>();

            deliveryPointCreatePage.City.SetFirstValueSelect("Москва");
            deliveryPointCreatePage.DeliveryPointName.SetValueAndWait(deliveryPointName);
            deliveryPointCreatePage.CompanyName.SetFirstValueSelect(companyName);
            deliveryPointCreatePage.Address.SetValueAndWait(deliveryPointAddress);
            deliveryPointCreatePage.Longitude.SetValueAndWait(deliveryPointLongitude);
            deliveryPointCreatePage.Latitude.SetValueAndWait(deliveryPointLatitude);
            deliveryPointCreatePage.HasFittingRoom.Click();
            deliveryPointCreatePage.IsCard.Click();
            deliveryPointCreatePage.IsCash.Click();
            deliveryPointCreatePage.SaveButton.Click();
            deliveryPointsPage = deliveryPointCreatePage.GoTo <AdminBaseListPage>();

            deliveryPointsPage.Create.Click();
            deliveryPointCreatePage = deliveryPointsPage.GoTo <DeliveryPointCreatePage>();
            deliveryPointCreatePage.City.SetFirstValueSelect("Санкт-Петербург");
            deliveryPointCreatePage.DeliveryPointName.SetValueAndWait(deliveryPointName + "2");
            deliveryPointCreatePage.CompanyName.SetFirstValueSelect(companyName);
            deliveryPointCreatePage.Address.SetValueAndWait(deliveryPointAddress2);
            deliveryPointCreatePage.Longitude.SetValueAndWait(deliveryPointLongitude2);
            deliveryPointCreatePage.Latitude.SetValueAndWait(deliveryPointLatitude2);
            deliveryPointCreatePage.HasFittingRoom.Click();
            deliveryPointCreatePage.IsCard.Click();
            deliveryPointCreatePage.IsCash.Click();
            deliveryPointCreatePage.SaveButton.Click();
            deliveryPointsPage = deliveryPointCreatePage.GoTo <AdminBaseListPage>();
            deliveryPointsPage.Table.RowSearch.Name.SetValue(deliveryPointName);
            deliveryPointsPage = deliveryPointsPage.SeachButtonRowClickAndGo();
            deliveryPointsPage.Table.GetRow(1).Name.WaitPresence();

            var adminMaintenancePage = LoadPage <AdminMaintenancePage>("admin/maintenance/mongo_points");

            adminMaintenancePage.AlertText.WaitTextContains("Синхронизировано");
            adminMaintenancePage.AlertText.WaitTextContains("точек самовывоза");
        }
        private void btnLogin_Click(object sender, RoutedEventArgs e)
        {
            Con.Close();
            String Username = txtUsername.Text;
            String Password = GetEncryptionMd5.MD5Process(txtPassword.Password.Trim());

            Cmd = new SqlCommand("Select * From tblUsers Where EmailId='" + Username + "' " +
                                 "or ContactNumber='" + Username + "' and Password='******' ", Con);
            Con.Open();
            SqlDataReader DR;

            DR = Cmd.ExecuteReader();

            if (DR.HasRows)
            {
                DR.Read();
                if ((Username == DR.GetValue(3).ToString() && Password == DR.GetValue(6).ToString()) ||
                    (Username == DR.GetValue(4).ToString() && Password == DR.GetValue(6).ToString())
                    )
                {
                    txtUsername.Text       = "Email Or Contact No.";
                    txtUsername.Foreground = Brushes.DarkGray;
                    txtPassword.Password   = "";
                    string Role = "A=Admin, L= Librarian";
                    Role = DR.GetValue(5).ToString().Trim();

                    if (Role == "A" || Role == "a" || Role == "L" || Role == "l")
                    {
                        //User Is Admin
                        AdminHomePage adminHomePage = new AdminHomePage(int.Parse(DR.GetValue(0).ToString()), DR.GetValue(3).ToString());
                        adminHomePage.Show();
                        this.Close();
                    }
                    else
                    {
                        return;
                    }
                    lblInvalid.Visibility = Visibility.Hidden;
                }
                else
                {
                    lblInvalid.Visibility = Visibility.Visible;
                    lblInvalid.Content    = "Invalid Password!";
                    txtPassword.Password  = "";
                }
            }
            else
            {
                //User Does Not Exists!
                lblInvalid.Content     = "User Does Not Exists!";
                lblInvalid.Visibility  = Visibility.Visible;
                txtUsername.Text       = "Email Or Contact No.";
                txtUsername.Foreground = Brushes.DarkGray;
                txtPassword.Password   = "";
            }
        }
Esempio n. 18
0
        public void T02_CreateShopTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminUsers.Click();
            adminPage.UsersShops.Click();
            var shopsPage = adminPage.GoTo <UsersShopsPage>();

            shopsPage.Table.RowSearch.Name.SetValue(userShopName);
            shopsPage = shopsPage.SeachButtonRowClickAndGo();
            while (shopsPage.Table.GetRow(0).Name.IsPresent)
            {
                shopsPage.Table.GetRow(0).ActionsDelete.Click();
                shopsPage.Aletr.Accept();
                shopsPage = shopsPage.GoTo <UsersShopsPage>();
                shopsPage.Table.RowSearch.Name.SetValue(userShopName);
                shopsPage = shopsPage.SeachButtonRowClickAndGo();
            }
            var defaultPage = shopsPage.LoginOut();
            var userPage    = defaultPage.LoginAsUser(userNameAndPass, userNameAndPass);

            userPage.UseProfile.Click();
            userPage.UserShops.Click();
            var shopsListPage = userPage.GoTo <UserShopsPage>();

            shopsListPage.ShopsCreate.Click();
            var shopCreatePage = shopsListPage.GoTo <UserShopCreatePage>();

            shopCreatePage.Name.SetValueAndWait(userShopName);
            shopCreatePage.Address.SetValueAndWait("Москва");
            shopCreatePage.Warehouse.SelectValue(userWarehouseName);
            shopCreatePage.CreateButton.Click();
            shopsListPage = shopCreatePage.GoTo <UserShopsPage>();
            var row = shopsListPage.Table.FindRowByName(userShopName);

            defaultPage = shopsListPage.LoginOut();
            adminPage   = defaultPage.LoginAsAdmin(adminName, adminPass);
            adminPage.AdminUsers.Click();
            adminPage.UsersShops.Click();
            shopsPage = adminPage.GoTo <UsersShopsPage>();
            shopsPage = shopCreatePage.GoTo <UsersShopsPage>();
            shopsPage.Table.RowSearch.Name.SetValue(userShopName);
            shopsPage = shopsPage.SeachButtonRowClickAndGo();
            shopsPage.Table.GetRow(0).Name.WaitPresence();
            shopsPage.Table.GetRow(0).ActionsEdit.Click();

            var shopEditPage = shopsPage.GoTo <UserAdminShopCreatePage>();

            shopEditPage.CompanyPickup.SetFirstValueSelect(companyPickupName);
            shopEditPage.CreateButton.Click();
            shopsPage = shopEditPage.GoTo <UsersShopsPage>();
            var adminMaintenancePage = LoadPage <AdminMaintenancePage>("admin/maintenance/cache_flush");

            adminMaintenancePage.AlertText.WaitText("Cache flushed!");
        }
Esempio n. 19
0
        public void SinglePickupFalseTest()
        {
            //            Ставим нет (галочку) в компании нашей у поля Единый забор
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminCompanies.Click();
            adminPage.Companies.Click();
            var companiesPage = adminPage.GoTo <CompaniesPage>();

            companiesPage.Table.RowSearch.Name.SetValue(companyPickupName);
            companiesPage = companiesPage.SeachButtonRowClickAndGo();
            string singlePickup = companiesPage.Table.GetRow(0).SinglePickup.GetText();

            if (singlePickup == "Yes")
            {
                companiesPage.Table.GetRow(0).ActionsEdit.Click();
                var companyCreatePage = companiesPage.GoTo <CompanyCreatePage>();
                companyCreatePage.SinglePickup.Click();
                companyCreatePage.SaveButton.Click();
                companiesPage = companyCreatePage.GoTo <CompaniesPage>();
                companiesPage.Table.RowSearch.Name.SetValue(companyPickupName);
                companiesPage = companiesPage.SeachButtonRowClickAndGo();
            }
            companiesPage.Table.GetRow(0).SinglePickup.WaitText("No");

            string[] ordersID        = SendOrdersRequest();
            var      оrdersInputPage = LoadPage <OrdersInputPage>("admin/orders/");

            оrdersInputPage.Table.RowSearch.ID.SetValue(ordersID[0]);
            оrdersInputPage = оrdersInputPage.SeachButtonRowClickAndGo();
            оrdersInputPage.Table.GetRow(0).ID.WaitText(ordersID[0]);
            оrdersInputPage.Table.GetRow(0).MoreInfo.Click();

            var оrderEditPage  = оrdersInputPage.GoTo <OrderInputEditingPage>();
            var pickupDate     = DateTime.ParseExact(оrderEditPage.PickupDate.GetValue(), "yyyy-MM-dd HH:mm:ss", null);
            var transferCDDate = DateTime.ParseExact(оrderEditPage.TransferCDDate.GetValue(), "yyyy-MM-dd HH:mm:ss",
                                                     null);

//            Сравниваем даты они долны быть равны
            Assert.AreEqual(pickupDate, transferCDDate, "Дата передачи в КД должна быть равна Дате заборы");

            оrderEditPage.Orders.Click();
            оrderEditPage.OrderInput.Click();
            оrdersInputPage = оrderEditPage.GoTo <OrdersInputPage>();
            оrdersInputPage.Table.RowSearch.ID.SetValue(ordersID[1]);
            оrdersInputPage = оrdersInputPage.SeachButtonRowClickAndGo();
            оrdersInputPage.Table.GetRow(0).ID.WaitText(ordersID[1]);
            оrdersInputPage.Table.GetRow(0).MoreInfo.Click();

            оrderEditPage  = оrdersInputPage.GoTo <OrderInputEditingPage>();
            pickupDate     = DateTime.ParseExact(оrderEditPage.PickupDate.GetValue(), "yyyy-MM-dd HH:mm:ss", null);
            transferCDDate = DateTime.ParseExact(оrderEditPage.TransferCDDate.GetValue(), "yyyy-MM-dd HH:mm:ss", null);
//            Сравниваем даты они долны быть равны
            Assert.AreEqual(pickupDate, transferCDDate, "Дата передачи в КД должна быть равна Дате заборы");
        }
Esempio n. 20
0
        public void T04_DeleteTimesTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminCompanies.Click();
            adminPage.Times.Mouseover();
            adminPage.TimesPickup.Click();
            var timesPickupPage = adminPage.GoTo <AdminBaseListPage>();

            timesPickupPage.Table.RowSearch.CompanyName.SetValue(companyPickupName);
            timesPickupPage = timesPickupPage.SeachButtonRowClickAndGo();

            while (timesPickupPage.Table.GetRow(0).Name.IsPresent)
            {
                timesPickupPage.Table.GetRow(0).ActionsDelete.Click();
                timesPickupPage.Aletr.Accept();
                timesPickupPage = timesPickupPage.GoTo <AdminBaseListPage>();
                timesPickupPage.Table.RowSearch.CompanyName.SetValue(companyPickupName);
                timesPickupPage = timesPickupPage.SeachButtonRowClickAndGo();
            }

            timesPickupPage.AdminCompanies.Click();
            timesPickupPage.Times.Mouseover();
            timesPickupPage.TimesCourier.Click();
            var timesCourierPage = adminPage.GoTo <AdminBaseListPage>();

            timesCourierPage.Table.RowSearch.CompanyName.SetValue(companyName);
            timesCourierPage = timesCourierPage.SeachButtonRowClickAndGo();

            while (timesCourierPage.Table.GetRow(0).ColumnThree.IsPresent)
            {
                timesCourierPage.Table.GetRow(0).ActionsDelete.Click();
                timesPickupPage.Aletr.Accept();
                timesCourierPage = timesCourierPage.GoTo <AdminBaseListPage>();
                timesCourierPage.Table.RowSearch.CompanyName.SetValue(companyName);
                timesCourierPage = timesCourierPage.SeachButtonRowClickAndGo();
            }
            timesCourierPage.AdminCompanies.Click();
            timesCourierPage.Times.Mouseover();
            timesCourierPage.TimesSelf.Click();
            var timesSelfPage = adminPage.GoTo <AdminBaseListPage>();

            timesSelfPage.Table.RowSearch.CompanyName.SetValue(companyName);
            timesSelfPage = timesSelfPage.SeachButtonRowClickAndGo();

            while (timesSelfPage.Table.GetRow(0).ColumnThree.IsPresent)
            {
                timesSelfPage.Table.GetRow(0).ActionsDelete.Click();
                timesPickupPage.Aletr.Accept();
                timesSelfPage = timesSelfPage.GoTo <AdminBaseListPage>();
                timesSelfPage.Table.RowSearch.CompanyName.SetValue(companyName);
                timesSelfPage = timesSelfPage.SeachButtonRowClickAndGo();
            }
        }
Esempio n. 21
0
        public void TestLogout()
        {
            //Initialize Admin page
            AdminHomePage page = new AdminHomePage(driver);

            //When
            page.LogOut();
            //Then
            Assert.AreEqual("NAIT - Login", driver.Title);
            //Test report
            test = extent.CreateTest("TestLogout");
            // test.Log(Status.Pass, "TestPassed");
        }
Esempio n. 22
0
        public void TestLogoutFail()
        {
            //Initialize Admin page
            AdminHomePage page = new AdminHomePage(driver);

            //When
            page.LogOut();
            //Then
            Assert.AreEqual("NAIT Admin", driver.Title);
            //Test report
            testFail = extent.CreateTest("TestLogoutFail");
            testFail.Log(Status.Fail, "TestFailed");
        }
Esempio n. 23
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);
     }
 }
Esempio n. 24
0
        internal AdminHomePage GoToHomePage()
        {
            Driver.Navigate().GoToUrl(_adminRoot);

            AdministartorLocalLoginPage login = new AdministartorLocalLoginPage(Driver);

            login.DoLogin();

            AdminHomePage home = new AdminHomePage(Driver);

            home.LongWaitReturnedToApp(5);

            Assert.IsTrue(home.IsOnPage(home.RootUrl));
            return(home);
        }
Esempio n. 25
0
        public void CreateSelfPriceTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminCompanies.Click();
            adminPage.Prices.Mouseover();
            adminPage.PricesSelf.Click();
            var pricesSelfPage = adminPage.GoTo <PricesPage>();

            pricesSelfPage.Table.RowSearch.CompanyName.SetValue(companyName);
            pricesSelfPage = pricesSelfPage.SeachButtonRowClickAndGo();

            while (pricesSelfPage.Table.GetRow(0).CompanyName.IsPresent)
            {
                pricesSelfPage.Table.GetRow(0).ActionsDelete.Click();
                pricesSelfPage.Aletr.Accept();
                pricesSelfPage = pricesSelfPage.GoTo <PricesPage>();
                pricesSelfPage.Table.RowSearch.CompanyName.SetValue(companyName);
                pricesSelfPage = pricesSelfPage.SeachButtonRowClickAndGo();
            }

            pricesSelfPage.Create.Click();
            var priceSelfCreatePage = pricesSelfPage.GoTo <PriceCreatePage>();

            priceSelfCreatePage.Price.SetValueAndWait("12");
            priceSelfCreatePage.PriceOverFlow.SetValueAndWait("4");
            priceSelfCreatePage.Route.SetFirstValueSelect("2", "г. Москва #151184 - г. Москва #151184");
            priceSelfCreatePage.CompanyName.SetFirstValueSelect(companyName);
            priceSelfCreatePage.Weight.SetFirstValueSelect(weightName);
            priceSelfCreatePage.Dimension.SetFirstValueSelect(sideName);
            priceSelfCreatePage.SaveButton.Click();
            pricesSelfPage = priceSelfCreatePage.GoTo <PricesPage>();

            pricesSelfPage.Create.Click();
            priceSelfCreatePage = pricesSelfPage.GoTo <PriceCreatePage>();
            priceSelfCreatePage.Price.SetValueAndWait("12");
            priceSelfCreatePage.PriceOverFlow.SetValueAndWait("3");
            priceSelfCreatePage.Route.SetFirstValueSelect("3", "г. Москва #151184 - г. Санкт-Петербург #151185");
            priceSelfCreatePage.CompanyName.SetFirstValueSelect(companyName);
            priceSelfCreatePage.Weight.SetFirstValueSelect(weightName);
            priceSelfCreatePage.Dimension.SetFirstValueSelect(sideName);
            priceSelfCreatePage.SaveButton.Click();
            pricesSelfPage = priceSelfCreatePage.GoTo <PricesPage>();

            pricesSelfPage.Table.RowSearch.CompanyName.SetValue(companyName);
            pricesSelfPage = pricesSelfPage.SeachButtonRowClickAndGo();
            pricesSelfPage.Table.GetRow(1).CompanyName.WaitText(companyName);
        }
Esempio n. 26
0
        public void CreateSideTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.DirectoryList.Click();
            adminPage.Intervals.Mouseover();
            adminPage.IntervalsSize.Click();
            var intervalsSizePage = adminPage.GoTo <AdminBaseListPage>();

            intervalsSizePage.LabelDirectory.WaitText(@"Справочник ""Размеры""");
            intervalsSizePage.Table.RowSearch.Name.SetValue(sideName);
            intervalsSizePage = intervalsSizePage.SeachButtonRowClickAndGo();

            while (intervalsSizePage.Table.GetRow(0).Name.IsPresent)
            {
                intervalsSizePage.Table.GetRow(0).ActionsDelete.Click();
                intervalsSizePage.Aletr.Accept();
                intervalsSizePage = intervalsSizePage.GoTo <AdminBaseListPage>();
                intervalsSizePage.Table.RowSearch.Name.SetValue(sideName);
                intervalsSizePage = intervalsSizePage.SeachButtonRowClickAndGo();
            }
            intervalsSizePage.Create.Click();
            var intervalSizeCreatePage = intervalsSizePage.GoTo <IntervalSideCreatePage>();

            intervalSizeCreatePage.Name.SetValueAndWait(sideName);
            intervalSizeCreatePage.Side1Min.SetValueAndWait(side1Min.ToString());
            intervalSizeCreatePage.Side2Min.SetValueAndWait(side2Min.ToString());
            intervalSizeCreatePage.Side3Min.SetValueAndWait(side3Min.ToString());
//            intervalSizeCreatePage.SidesSumMin.SetValueAndWait(sidesSumMin.ToString());
//            intervalSizeCreatePage.VolumeMin.SetValueAndWait(volumeMin.ToString());
            intervalSizeCreatePage.SidesSumMin.SetValueAndWait("");
            intervalSizeCreatePage.VolumeMin.SetValueAndWait("");
            intervalSizeCreatePage.Side1Max.SetValueAndWait(side1Max.ToString());
            intervalSizeCreatePage.Side2Max.SetValueAndWait(side2Max.ToString());
            intervalSizeCreatePage.Side3Max.SetValueAndWait(side3Max.ToString());
//            intervalSizeCreatePage.SidesSumMax.SetValueAndWait(sidesSumMax.ToString());
//            intervalSizeCreatePage.VolumeMax.SetValueAndWait(volumeMax.ToString());
            intervalSizeCreatePage.SidesSumMax.SetValueAndWait("");
            intervalSizeCreatePage.VolumeMax.SetValueAndWait("");
            intervalSizeCreatePage.SaveButton.Click();
            intervalsSizePage = intervalSizeCreatePage.GoTo <AdminBaseListPage>();

            intervalsSizePage.Table.RowSearch.Name.SetValue(sideName);
            intervalsSizePage = intervalsSizePage.SeachButtonRowClickAndGo();
            intervalsSizePage.Table.GetRow(0).Name.WaitText(sideName);
        }
Esempio n. 27
0
        public void CreateAnAdvancedBooking()
        {
            //Arrange
            var                                  loginPage                          = new LoginPage(_driver);
            AdminHomePage                        adminPage                          = new AdminHomePage(_driver);
            AdminBookingPage                     adminBookingPage                   = new AdminBookingPage(_driver);
            AdminAdvancedBookingPage             adminAdvancedBookingPage           = new AdminAdvancedBookingPage(_driver);
            AdminAdvancedBookingConfirmationPage advancedBookingConfirmationMessage = new AdminAdvancedBookingConfirmationPage(_driver);

            //Act-->on admin home page
            loginPage.Login();
            adminPage.ClickOnBooking();

            //Assert-->on admin home page
            var pageTitle = _driver.Title;

            Console.WriteLine(pageTitle);
            Assert.IsTrue(pageTitle.Contains("ClubSpark / Admin / Booking"));

            //Act -->on booking page
            adminBookingPage.ClickOnBookingSheet();

            //Assert-->booking page
            var bookingPageTitle = _driver.Title;

            Console.WriteLine(bookingPageTitle);
            Assert.IsTrue(bookingPageTitle.Contains("Regression Test Venue / Booking / Book by date"));

            //Act -->on advancebooking page
            adminAdvancedBookingPage.ClicktoSelectNextDay();
            adminAdvancedBookingPage.clickOnATimeSlot();
            adminAdvancedBookingPage.ClickOnAdvancedOptions();
            //Assert-->advancebooking page
            var advancebookingPageTitle = _driver.Title;

            Console.WriteLine(advancebookingPageTitle);
            Assert.IsTrue(advancebookingPageTitle.Contains("Regression Test Venue / Booking / Advanced booking"));

            //Act
            adminAdvancedBookingPage.ClickSumbit();
            string advancedBookingMessage = advancedBookingConfirmationMessage.ConfirmationText();

            //Assert --> Advanced booking message page
            Assert.AreEqual(advancedBookingMessage, "Your booking has been confirmed.", "The names match");
        }
Esempio n. 28
0
        public void PickupTimetableTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminCompanies.Click();
            adminPage.PickupTimetable.Click();
            var pickupTimetablePage = adminPage.GoTo <AdminBaseListPage>();

            pickupTimetablePage.LabelDirectory.WaitText(@"Справочник ""Время отправки забора""");
            pickupTimetablePage.Table.RowSearch.CompanyName.SetValue(companyPickupName);
            pickupTimetablePage = pickupTimetablePage.SeachButtonRowClickAndGo();

            while (pickupTimetablePage.Table.GetRow(0).Name.IsPresent)
            {
                pickupTimetablePage.Table.GetRow(0).ActionsDelete.Click();
                pickupTimetablePage = pickupTimetablePage.GoTo <AdminBaseListPage>();
                pickupTimetablePage.Table.RowSearch.CompanyName.SetValue(companyPickupName);
                pickupTimetablePage = pickupTimetablePage.SeachButtonRowClickAndGo();
            }

            pickupTimetablePage.Table.RowSearch.CompanyName.SetValue(companyName);
            pickupTimetablePage = pickupTimetablePage.SeachButtonRowClickAndGo();
            while (pickupTimetablePage.Table.GetRow(0).Name.IsPresent)
            {
                pickupTimetablePage.Table.GetRow(0).ActionsDelete.Click();
                pickupTimetablePage.Aletr.Accept();
                pickupTimetablePage = pickupTimetablePage.GoTo <AdminBaseListPage>();
                pickupTimetablePage.Table.RowSearch.CompanyName.SetValue(companyName);
                pickupTimetablePage = pickupTimetablePage.SeachButtonRowClickAndGo();
            }

            pickupTimetablePage.Create.Click();
            var pickupTimetableCreatePage = pickupTimetablePage.GoTo <PickupTimetableCreatePage>();

            pickupTimetableCreatePage.Company.SetFirstValueSelect(companyPickupName);
            pickupTimetableCreatePage.PickupTime.SelectByText("23:45");
            pickupTimetableCreatePage.PickupPeriod.SelectByText("Сегодня");
            pickupTimetableCreatePage.SaveButton.Click();
            pickupTimetablePage = pickupTimetableCreatePage.GoTo <AdminBaseListPage>();

            pickupTimetablePage.Table.RowSearch.CompanyName.SetValue(companyPickupName);
            pickupTimetablePage = pickupTimetablePage.SeachButtonRowClickAndGo();
            pickupTimetablePage.Table.GetRow(0).Name.WaitText(companyPickupName);
        }
Esempio n. 29
0
        public void CkeckEqualInputOutputDatesTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            string[] ordersID = SendOrdersRequest();

//            Создание исходщих завок
            var adminMaintenancePage = LoadPage <AdminMaintenancePage>("admin/maintenance/process_i_orders");

            adminMaintenancePage.AlertText.WaitTextContains("Processed");

//            Входящая заявка 1
            var оrderEditPage       = LoadPage <OrderInputEditingPage>("admin/orders/edit/" + ordersID[0]);
            var transferCDInputDate = DateTime.ParseExact(оrderEditPage.TransferCDDate.GetValue(), "yyyy-MM-dd HH:mm:ss", null);

            var оrdersInputPage = LoadPage <OrdersInputPage>("admin/orders/?&filters[_id]=" + ordersID[0]);

            оrdersInputPage.Table.GetRow(0).OrderOutput.Click();
            var оrdersOutputPage = оrdersInputPage.GoTo <OrdersOutputPage>();

            оrdersOutputPage.Table.GetRow(0).ActionsEdit.Click();
//            исходящая заявка 1
            var оrderEditOutputPage  = оrdersOutputPage.GoTo <OrderOutputEditingPage>();
            var transferCDOutputDate = DateTime.ParseExact(оrderEditOutputPage.TransferCDDate.GetValue(), "dd.MM.yyyy HH:mm:ss", null);

//            Сравнение двух дат
            Assert.AreEqual(transferCDInputDate, transferCDOutputDate, "Даты должны совпадать у исходящей и входящей заявки");

//            Входящая заявка 2
            оrderEditPage       = LoadPage <OrderInputEditingPage>("admin/orders/edit/" + ordersID[0]);
            transferCDInputDate = DateTime.ParseExact(оrderEditPage.TransferCDDate.GetValue(), "yyyy-MM-dd HH:mm:ss", null);

            оrdersInputPage = LoadPage <OrdersInputPage>("admin/orders/?&filters[_id]=" + ordersID[0]);
            оrdersInputPage.Table.GetRow(0).OrderOutput.Click();
            оrdersOutputPage = оrdersInputPage.GoTo <OrdersOutputPage>();
            оrdersOutputPage.Table.GetRow(0).ActionsEdit.Click();
//            исходящая заявка 2
            оrderEditOutputPage  = оrdersOutputPage.GoTo <OrderOutputEditingPage>();
            transferCDOutputDate = DateTime.ParseExact(оrderEditOutputPage.TransferCDDate.GetValue(), "dd.MM.yyyy HH:mm:ss", null);

//            Сравнение двух дат
            Assert.AreEqual(transferCDInputDate, transferCDOutputDate, "Даты должны совпадать у исходящей и входящей заявки");
        }
        public void CreateOrderedIttemplatesTest()
        {
            AdminHomePage adminPage = LoginAsAdmin(adminName, adminPass);

            adminPage.AdminCompanies.Click();
            adminPage.OrderedIttemplates.Click();
            var orderedIttemplatesPage = adminPage.GoTo <OrderedIttemplatesPage>();

            orderedIttemplatesPage.Table.RowSearch.CompanyName.SetValue(companyName);
            orderedIttemplatesPage = orderedIttemplatesPage.SeachButtonRowClickAndGo();

            while (orderedIttemplatesPage.Table.GetRow(0).Name.IsPresent)
            {
                orderedIttemplatesPage.Table.GetRow(0).ActionsDelete.Click();
                orderedIttemplatesPage.Aletr.Accept();
                orderedIttemplatesPage = orderedIttemplatesPage.GoTo <OrderedIttemplatesPage>();
                orderedIttemplatesPage.Table.RowSearch.CompanyName.SetValue(companyName);
                orderedIttemplatesPage = orderedIttemplatesPage.SeachButtonRowClickAndGo();
            }
            orderedIttemplatesPage.Create.Click();
            var orderedIttemplatesCreatePage = orderedIttemplatesPage.GoTo <OrderedIttemplatesCreatePage>();

            orderedIttemplatesCreatePage.CompanyName.SetFirstValueSelect(companyName);
            orderedIttemplatesCreatePage.Through.SelectValue("Email");
            orderedIttemplatesCreatePage.Action.SelectValue("Отмена заказа");
            orderedIttemplatesCreatePage.ThroughEmail.SetValueAndWait(adminName);
            orderedIttemplatesCreatePage.Subject.SetValueAndWait("Отмена заказа #dd");
            orderedIttemplatesCreatePage.Message.SetValueAndWait("Сообщение на отмену заказа #dd");
            orderedIttemplatesCreatePage.SaveButton.Click();
            orderedIttemplatesPage = orderedIttemplatesCreatePage.GoTo <OrderedIttemplatesPage>();

            orderedIttemplatesPage.Create.Click();
            orderedIttemplatesCreatePage = orderedIttemplatesPage.GoTo <OrderedIttemplatesCreatePage>();
            orderedIttemplatesCreatePage.CompanyName.SetFirstValueSelect(companyName);
            orderedIttemplatesCreatePage.Through.SelectValue("Email");
            orderedIttemplatesCreatePage.Action.SelectValue("Редактирование заказа");
            orderedIttemplatesCreatePage.ThroughEmail.SetValueAndWait(adminName);
            orderedIttemplatesCreatePage.Subject.SetValueAndWait("Редактирование заказа #dd");
            orderedIttemplatesCreatePage.Message.SetValueAndWait("список измененных полей и новых значений: #changed");
            orderedIttemplatesCreatePage.SaveButton.Click();
            orderedIttemplatesPage = orderedIttemplatesCreatePage.GoTo <OrderedIttemplatesPage>();
        }