コード例 #1
0
        public void VerifyValidLogin()
        {
            LoginSteps loginSteps = new LoginSteps(_testOutputHelper);
            var        loginText  = loginSteps.Login("*****@*****.**", "password");

            Assert.Equal(loginText, "My Account");
        }
コード例 #2
0
        public void Test1()
        {
            var loginSteps = new LoginSteps(Driver);

            loginSteps.Login();

            Assert.AreEqual("All Projects - TestRail", Driver.Title);
            Assert.IsTrue(new DashboardPage(Driver).IsPageOpened());
        }
コード例 #3
0
        public new void OneTimeSetUp()
        {
            var loginSteps = new LoginSteps(Driver);

            loginSteps.Login();

            _projectService  = new ProjectService();
            _addProjectSteps = new AddProjectSteps(Driver);
        }
コード例 #4
0
        public void Test2()
        {
            var loginSteps = new LoginSteps(Driver);

            loginSteps.Login();

            var element = WaitService.GetVisibleElement(By.Id("sidebar-projects-add"));

            Console.Out.WriteLine(element.Displayed);
        }
コード例 #5
0
        public void TestHelpDropdownSelectByText()
        {
            var loginSteps = new LoginSteps(Driver);

            loginSteps.Login();

            var dashboardPage = new DashboardPage(Driver);

            dashboardPage.HelpDropdownButton.Click();
            Console.Out.WriteLine(dashboardPage.HelpDropdown.Displayed);
            dashboardPage.HelpDropdown.SelectByText("TestRail User Guide");
        }
コード例 #6
0
        public void TestUserDropdownSelectByText()
        {
            var loginSteps = new LoginSteps(Driver);

            loginSteps.Login();

            var dashboardPage = new DashboardPage(Driver);

            dashboardPage.UserDropdownButton.Click();
            Assert.IsTrue(dashboardPage.UserDropdown.Displayed);
            dashboardPage.UserDropdown.SelectByText("My Settings");
        }
コード例 #7
0
        public void TestProgressDropDown()
        {
            var loginSteps = new LoginSteps(Driver);

            loginSteps.Login();

            var dashboardPage = new DashboardPage(Driver);

            dashboardPage.InProgressDropdownButton.Click();
            Console.Out.WriteLine(dashboardPage.InProgressDropdown.Displayed);
            Console.Out.WriteLine(dashboardPage.InProgressDropdown.Text);
            Assert.AreEqual(dashboardPage.InProgressDropdown.Text, $"In Progress\n There are no tests you are currently working on." +
                            $" You can use the Progress  feature to indicate that you are working on a test.");
        }
コード例 #8
0
        public static void BaseProfileSetup()
        {
            if (!TestConfig.UseProfiles)
            {
                return;
            }

            Parallel.ForEach(UserProfileDirectories.Keys, (username) =>
            {
                var profileDirectory = UserProfileDirectories[username];
                var baseDirectory    = Path.Combine(profileDirectory, "base");

                // SpecFlow isolation settings may run scenarios in different processes or AppDomains and [BeforeTestRun] runs per thread. Lock statement insufficient.
                using (var mutex = new Mutex(true, $"{nameof(BaseProfileSetup)}-{username}", out var createdNew))
                {
                    if (!createdNew)
                    {
                        mutex.WaitOne();
                    }

                    if (Directory.Exists(baseDirectory))
                    {
                        mutex.ReleaseMutex();
                        return;
                    }

                    try
                    {
                        Directory.CreateDirectory(baseDirectory);

                        var userBrowserOptions = (BrowserOptionsWithProfileSupport)TestConfig.BrowserOptions.Clone();
                        userBrowserOptions.ProfileDirectory = baseDirectory;
                        userBrowserOptions.Headless         = true;

                        var webClient = new WebClient(userBrowserOptions);
                        using (new XrmApp(webClient))
                        {
                            var user = TestConfig.Users.First(u => u.Username == username);
                            LoginSteps.Login(webClient.Browser.Driver, TestConfig.GetTestUrl(), user.Username, user.Password);
                        }
                    }
                    finally
                    {
                        mutex.ReleaseMutex();
                    }
                }
            });
コード例 #9
0
        public void Test1()
        {
            var loginSteps = new LoginSteps(Driver);

            loginSteps.Login();

            var dashBoardPage = new DashboardPage(Driver);

            dashBoardPage.SidebarProjectsAdd.Click();

            var addProjectPage = new AddProjectPage(Driver);

            addProjectPage.Name.SendKeys("test-wrappers-radioButton");

            addProjectPage.ModeSuite.SelectById("suite_mode_single_baseline");
            addProjectPage.AddProject.Click();
        }
コード例 #10
0
        public void Test3()
        {
            var loginSteps = new LoginSteps(Driver);

            loginSteps.Login();

            var dashBoardPage = new DashboardPage(Driver);

            dashBoardPage.SidebarProjectsAdd.Click();

            var addProjectPage = new AddProjectPage(Driver);

            addProjectPage.Name.SendKeys("radioBut2");

            addProjectPage.ModeSuite.SelectByValue("2");

            /*var radioButton = new RadioButton(Driver, By.XPath("//div[@class='radio']"));
             * radioButton.SelectByValue("2");*/
            //  addProjectPage.AddProjectButton.Click();
            Thread.Sleep(1000);
        }
コード例 #11
0
        public void Test2()
        {
            var loginSteps = new LoginSteps(Driver);

            loginSteps.Login();

            var dashBoardPage = new DashboardPage(Driver);

            dashBoardPage.SidebarProjectsAdd.Click();

            var addProjectPage = new AddProjectPage(Driver);

            addProjectPage.AddProject.Click();

            var checkBox = new CheckBox(Driver, By.Id("show_announcement"));

            //var radioButton = new RadioButton(Driver, By.ClassName("radio"));
            // radioButton.SelectById("suite_mode_single_baseline");
            Console.Out.WriteLine(checkBox.Selected);
            checkBox.Click();
            Console.Out.WriteLine(checkBox.Selected);
        }
コード例 #12
0
 public void DadoRealizaOLogin()
 {
     LoginSteps.Login(Browser);
     Thread.Sleep(5000);
 }