コード例 #1
0
        public void Initialization()
        {
            // Configuring Implicit Timeout and navigating to Application
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(IMPLICIT_WAIT_TIMEOUT);
            driver.Navigate().GoToUrl(APPLICATION_URL);

            // Pre-condition: Logging in as manager
            var loginPageObject = new LoginPageObject(driver);

            SetInputField(loginPageObject.UserEmailTextBox, MANAGER_EMAIL);
            SetInputField(loginPageObject.UserPasswordTextBox, MANAGER_PASSWORD);
            loginPageObject.LoginButton.Click();

            // Navigating to OKRs list page
            var sidebarMenuPageObject = new SideBarMenuPageObject(driver);

            sidebarMenuPageObject.OKRItem.Click();

            // Pre-condition: creating temporary OKR for Admin User
            okrListPageObject = new OKRListPageObject(driver);
            okrListPageObject.UsersComboBox.SelectByText(MANAGER_USER_NAME);
            okrListPageObject.NewOKRButton.Click();

            var newOKRPageObject = new SetOKRPageObject(driver);

            testOKRName = TEST_OKR_NAME + new Random().Next(0, 999).ToString();
            SetInputField(newOKRPageObject.OKRNameField, testOKRName);
            SetInputField(newOKRPageObject.ObjectivesList[0].ObjectiveNameField, TEST_OKR_OBJECTIVE_TEXT);
            newOKRPageObject.ObjectivesList[0].KeyResultsList[0].RemoveKeyResultLink.Click();  // Removing unnecessary Key Result
            SetInputField(newOKRPageObject.ObjectivesList[0].KeyResultsList[0].KeyResultField, TEST_OKR_KEYRESULT_TEXT);
            newOKRPageObject.SaveButton.Click();
        }
コード例 #2
0
        public void SetupEnvironment()
        {
            // Configuring timeout and navigating to Application
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(IMPLICIT_WAIT_TIMEOUT);
            driver.Navigate().GoToUrl(APPLICATION_URL);

            // Preconditions: login as manager and create OKR
            var loginObject = new LoginPageObject(driver);

            loginObject.UserEmailTextBox.SendKeys(MANAGER_EMAIL);
            loginObject.UserPasswordTextBox.SendKeys(MANAGER_PASSWORD);
            loginObject.LoginButton.Click();
            var sidebarMenu = new SideBarMenuPageObject(driver);

            sidebarMenu.OKRItem.Click();
            var okrListPageObject = new OKRListPageObject(driver);

            okrListPageObject.UsersComboBox.SelectByText(MANAGER_USERNAME);
            okrListPageObject.NewOKRButton.Click();

            // OKR fillout
            var newOKRPageObject = new SetOKRPageObject(driver);

            newOKRPageObject.OKRNameField.SendKeys(TESTOKR_NAME);
            newOKRPageObject.ObjectivesList[0].ObjectiveNameField.SendKeys(TESTOKR_OBJECTIVENAME);
            newOKRPageObject.ObjectivesList[0].KeyResultsList[0].KeyResultField.SendKeys(TESTOKR_V2);
            newOKRPageObject.ObjectivesList[0].KeyResultsList[1].KeyResultField.SendKeys(TESTOKR_V2);
            newOKRPageObject.SaveButton.Click();
        }
コード例 #3
0
        public void Initialization()
        {
            // Configuring Implicit Timeout and navigating to Application
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(IMPLICIT_WAIT_TIMEOUT);
            driver.Navigate().GoToUrl(APPLICATION_URL);

            //Initializing globals
            approveOKRPageObject = new ApproveOKRPageObject(driver);
            editOKRPageObject    = new SetOKRPageObject(driver);
            okrListPageObject    = new OKRListPageObject(driver);

            // Pre-condition: Logging in as manager
            var loginPageObject = new LoginPageObject(driver);

            loginPageObject.UserEmailTextBox.Clear();
            loginPageObject.UserEmailTextBox.SendKeys(MANAGER_EMAIL);
            loginPageObject.UserPasswordTextBox.Clear();
            loginPageObject.UserPasswordTextBox.SendKeys(MANAGER_PASSWORD);
            loginPageObject.LoginButton.Click();

            // Navigating to OKRs list page and selecting Team Lead User
            var sidebarMenuPageObject = new SideBarMenuPageObject(driver);

            sidebarMenuPageObject.OKRItem.Click();
        }
コード例 #4
0
        public void BeforeAllMethods()
        {
            // General driver configuration
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(IMPLICIT_WAIT_SECONDS);
            driver.Navigate().GoToUrl(APPLICATION_URL);

            // Applied Page Objects
            login       = new LoginPageObject(driver);
            sideBarMenu = new SideBarMenuPageObject(driver);
            OKRList     = new OKRListPageObject(driver);
            setOKR      = new SetOKRPageObject(driver);
            deleteOKR   = new ApproveOKRPageObject(driver);

            // Login into system
            login.UserEmailTextBox.Click();
            login.UserEmailTextBox.Clear();
            login.UserEmailTextBox.SendKeys(email.ToString());
            login.UserPasswordTextBox.Click();
            login.UserPasswordTextBox.Clear();
            login.UserPasswordTextBox.SendKeys(password);
            login.LoginButton.Click();

            // Navigate to OKR Page
            sideBarMenu.OKRItem.Click();

            // Click button "New OKR"
            OKRList.NewOKRButton.Click();
        }
コード例 #5
0
        public void Initialization()
        {
            // General driver configuration
            driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(IMPLICIT_WAIT_SECONDS);
            driver.Navigate().GoToUrl(APPLICATION_URL);

            // Assigning of Page Objects
            login = new LoginPageObject(driver);
            sideBarMenuPageObject     = new SideBarMenuPageObject(driver);
            myTasksPageObject         = new MyTasksPageObject(driver);
            topPanelPageObject        = new TopPanelPageObject(driver);
            addTaskPageObject         = new AddTaskPageObject(driver);
            deleteTaskPageObject      = new DeleteTaskPageObject(driver);
            okrListForAssignedPerson1 = new OKRListPageObject(driver);
            okrListForAssignedPerson2 = new OKRListPageObject(driver);
            approveOKRPageObject      = new ApproveOKRPageObject(driver);
            setOKRPageObject          = new SetOKRPageObject(driver);

            identificationNumber = DateTime.Now.ToString("dd:MM:yyyy/HH:mm");
            assigneesList        = new List <UserKeyResultsPageObject>();
            taskList             = new List <TaskPageObject>();
            wait = new WebDriverWait(driver, TimeSpan.FromSeconds(EXPLICIT_WAIT_SECONDS));

            // Login into system
            login.UserEmailTextBox.Click();
            login.UserEmailTextBox.Clear();
            login.UserEmailTextBox.SendKeys(MANAGER_EMAIL);
            login.UserPasswordTextBox.Click();
            login.UserPasswordTextBox.Clear();
            login.UserPasswordTextBox.SendKeys(MANAGER_PASSWORD);
            login.LoginButton.Click();

            // Assigning unique names to OKRs
            okrName1 = ASSIGNED_PERSON_1_OKR_NAME + identificationNumber;
            okrName2 = ASSIGNED_PERSON_2_OKR_NAME + identificationNumber;

            // Creating OKRs for the assignees
            CreateOkr(ASSIGNED_PERSON_1, okrName1, ASSIGNED_PERSON_1_OBJECTIVE,
                      ASSIGNED_PERSON_1_KEY_RESULT_1, ASSIGNED_PERSON_1_KEY_RESULT_2, okrListForAssignedPerson1);

            CreateOkr(ASSIGNED_PERSON_2, okrName2, ASSIGNED_PERSON_2_OBJECTIVE,
                      ASSIGNED_PERSON_2_KEY_RESULT_1, ASSIGNED_PERSON_2_KEY_RESULT_2, okrListForAssignedPerson2);
        }