예제 #1
0
        public bool AddNewUser(BimTrackUser bimUser)
        {
//            IWebElement weTarget = GetRoot().FindElement(By.XPath("//input[@data-testid='validEmailCell']"));
//            weTarget.SendKeys(BimEmailProcessor.EMAILS_PREFIX + szUserSuffix +
//                              BimEmailProcessor.EMAILS_DOMAIN);
            var random = new Random();

            Thread.Sleep(random.Next(250, 500));
            _SetNewUserEmail(bimUser.email);
            Thread.Sleep(random.Next(250, 500));
            _SetNewUserRole(bimUser.isAdmin);
            Thread.Sleep(random.Next(250, 500));
            _ClickAddOrCancel(true, false);



            //TODO: Replace by ID, dependant on localized resource
            // Wait for a maximum time of x milliseconds for the out of users available message to pop in case the
            // maximum of users was reached
            const string warning = "You can not choose this plan. The hub user limit is reached.";
            var          byElem  = By.XPath(".//span[text() ='" + warning + "']");
            var          retElem = WebElementHelper.WaitUntilVisible(byElem, 2500);

            if (retElem != null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
예제 #2
0
        /*
         * Environnement:
         *  DEV: https://dev.bimtrack.co/en/Login
         *  QA: https://qa.bimtrack.co/en/Login
         *  PROD: https://bimtrackapp.co/en/Login (edited)
         */

        public void createUser()
        {
            KeyChain kc = CTX.keyChain;

            CTX.driver.Url = kc.UrlBimTrack;

            BTLogin login = new BTLogin();

            login.LogIn(kc.LoginUsername, kc.LoginPassword);

            BTHubsTracks btHubsTracks = new BTHubsTracks();
            ProjectList  prjList      = btHubsTracks.OpenHubByName(kc.HubName);

            prjList.SelectProject(kc.DefaultProject);

            MainProject mainProject = new MainProject();

            SideBarMenu sideBarMenu = mainProject.GetSidebarMenu();

            sideBarMenu.ClickMenuItem("Hub Settings");
            HubSettings        hubSettings = new HubSettings();
            UserManagementForm userForm    = hubSettings.ClickButtonAddUser();

            var emailSuffix = BimTrackUser.GetNewUserSuffix();
            var email       = BimTrackUser.GetUniqueUserEmail(emailSuffix);

            if (userForm.AddNewUser(new BimTrackUser(email, true)))
            {
                // PROCESS EMAIL
                BimEmailProcessor proc   = new BimEmailProcessor();
                string            szLink = null;
                while (szLink == null)
                {
                    szLink = proc.GetLatestActivationForUser(emailSuffix);
                    Console.Out.WriteLine("Loop waiting");
                    Thread.Sleep(1500);
                }

                Console.Out.WriteLine("SzLink == " + szLink);
                CTX.driver.Close();

                // Complete the user creation
                new CompleteUserFormTest().ActivateUser(szLink);

                //hubSettings.FillNewUserInformation(userSuffix, true);

                Thread.Sleep(1500);
            }

            CTX.driver.Close();
        }
예제 #3
0
        /*
         * Environnement:
         *  DEV: https://dev.bimtrack.co/en/Login
         *  QA: https://qa.bimtrack.co/en/Login
         *  PROD: https://bimtrackapp.co/en/Login (edited)
         */

        public void startBimTrack()
        {
//            CTX.driver.Url = "http://bimtrackapp.co";
            CTX.driver.Url = "https://qa.bimtrack.co/";

            BTLogin login = new BTLogin();

            login.LogIn("*****@*****.**", "Z3nt3l1499!");

            BTHubsTracks btHubsTracks = new BTHubsTracks();
            ProjectList  prjList      = btHubsTracks.OpenHubByName("ZenyTest");

            prjList.SelectProject("ZENPROJECT001");

            MainProject mainProject = new MainProject();

            SideBarMenu sideBarMenu = mainProject.GetSidebarMenu();

            sideBarMenu.ClickMenuItem("Hub Settings");
            HubSettings        hubSettings = new HubSettings();
            UserManagementForm userForm    = hubSettings.ClickButtonAddUser();

            var emailSuffix = BimTrackUser.GetNewUserSuffix();
            var email       = BimTrackUser.GetUniqueUserEmail(emailSuffix);

            userForm.AddNewUser(new BimTrackUser(email, true));

            // PROCESS EMAIL
            BimEmailProcessor proc   = new BimEmailProcessor();
            string            szLink = null;

            while (szLink == null)
            {
                szLink = proc.GetLatestActivationForUser(emailSuffix);
                Console.Out.WriteLine("Loop waiting");
                Thread.Sleep(1500);
            }

            Console.Out.WriteLine("SzLink == " + szLink);
            CTX.driver.Close();

            // Complete the user creation
            new CompleteUserFormTest().ActivateUser(szLink);

            //hubSettings.FillNewUserInformation(userSuffix, true);

            Thread.Sleep(1500);
            CTX.driver.Close();
        }
예제 #4
0
 public bool RemoveAllUsers(BimTrackUser bimUser)
 {
     return(false);
 }