Beispiel #1
0
        public void AddPackageForCustomerContractor()
        {
            var loginPage              = new LoginTabPageObject(driver);
            var loginTenantnPage       = new LoginTenantTabPageObject(driver);
            var mainPageHeaders        = new MainMenuPageObject(driver);
            var packagesScreen         = new PackagesScreenPageObject(driver);
            var priceManagmentDropDown = new PriceManagmentDropDownPageObject(driver);
            var addPackagePopup        = new AddPackagePopupPageObject(driver);

            // login flow

            loginPage.Login(creds.Email, creds.Password);
            loginTenantnPage.ChooseFirstTenant();
            mainPageHeaders.ClickPricingManagementHeader();
            priceManagmentDropDown.ClickPackages();
            packagesScreen.ClickAddPackageBtn();

            // add package flow

            addPackagePopup.ClickCustomerType();
            addPackagePopup.SetAccountTypeContractor();
            Thread.Sleep(100);
            addPackagePopup.SetContractorCompany();
            addPackagePopup.SetPeriodOngoing();
            addPackagePopup.SetStartDate();
            addPackagePopup.SetEndDate();
            Int32  unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
            string description   = "Add Package For Customer Single Company Contractor Ongoing. Timestamp: " + unixTimestamp;

            addPackagePopup.SetDescription(description);
            addPackagePopup.SetBudget();
            addPackagePopup.SetTarget();
            addPackagePopup.ClickSaveBtn();
            Thread.Sleep(100);
            packagesScreen.ClickOrderById();
            Thread.Sleep(100);
            packagesScreen.ClickOrderById();
            Thread.Sleep(1000);

            var actualResult = driver.FindElement(By.XPath("//*[@id=\"gridPackageOverview\"]/div/div[2]/kendo-grid/div/kendo-grid-list/div/div[1]/table/tbody/tr[1]/td[6]")).Text;

            Assert.AreEqual(description, actualResult);
        }