コード例 #1
0
        public void GetTestCasesForTestPlanTest()
        {
            Console.WriteLine(testlink.about());

            var project  = testlink.GetProjects().First(a => a.name == "CMGE");
            var testPlan = testlink.GetProjectTestPlans(project.id).First(a => a.name == "V0-H.1020");

            var platforms = testlink.GetTestPlanPlatforms(testPlan.id);

            Console.WriteLine($"\r\n{testPlan.name} includes platforms:");
            platforms.ForEach(a => Console.WriteLine($"{a.name} (id: {a.id})"));

            var builds = testlink.GetBuildsForTestPlan(testPlan.id);

            Console.WriteLine($"\r\n{testPlan.name} includes builds:");
            builds.ForEach(a => Console.WriteLine($"{a.name} (id: {a.id})"));

            var cases     = testlink.GetTestCasesForTestPlan(testPlan.id);
            var testCases = cases.GroupBy(a => a.external_id).Select(g => g.First()).ToList();

            Console.WriteLine($"\r\n{testPlan.name} includes test cases: {testCases.Count}");

            var platformTestCases = testCases.GroupBy(a => a.platform_name);

            Console.WriteLine("\r\nGroups:");
            var counter = 0;

            foreach (var group in platformTestCases)
            {
                counter += group.ToArray().Length;
                Console.WriteLine($"Platform: {group.Key} Test cases: {group.ToArray().Length}");
            }

            Console.WriteLine($"All platform total test cases: {counter}");
        }
コード例 #2
0
        protected void TestLinkInitialize()
        {
            try
            {
                tl         = new TestLink("f71e80e4c23bba99dfedf1b442bb42f5", "http://172.30.2.44/testlink/lib/api/xmlrpc.php");
                testPlanId = tl.getTestPlanByName(ProjectName, PlanName).id;

                if (tl.GetBuildsForTestPlan(testPlanId).FirstOrDefault(x => x.name == buildName) == null)
                {
                    tl.CreateBuild(testPlanId, buildName, "Build created by script");
                }

                buildId = tl.GetBuildsForTestPlan(testPlanId).FirstOrDefault(x => x.name == buildName).id;
            }
            catch (Exception ex)
            {
                //
            }
        }
コード例 #3
0
        public void GetTestCasesForTestPlanTest()
        {
            _testOutputHelper.WriteLine(testlink.about());

            var project  = testlink.GetProjects().First(a => a.name == "CMGE");
            var testPlan = testlink.GetProjectTestPlans(project.id).First(a => a.name == "integration-test-plan");

            _testOutputHelper.WriteLine($"test plan id: {testPlan.id}");

            var platforms = testlink.GetTestPlanPlatforms(testPlan.id);

            _testOutputHelper.WriteLine($"\r\n{testPlan.name} includes platforms:");
            platforms.ForEach(a => _testOutputHelper.WriteLine($"{a.name} (id: {a.id})"));

            var builds = testlink.GetBuildsForTestPlan(testPlan.id);

            _testOutputHelper.WriteLine($"\r\n{testPlan.name} includes builds:");
            builds.ForEach(a => _testOutputHelper.WriteLine($"{a.name} (id: {a.id})"));

            var cases     = testlink.GetTestCasesForTestPlan(testPlan.id);
            var testCases = cases.GroupBy(a => a.external_id).Select(g => g.First()).ToList();

            _testOutputHelper.WriteLine($"\r\n{testPlan.name} includes test cases: {testCases.Count}");
            testCases.ForEach(a => _testOutputHelper.WriteLine($"ID:{a.tc_id} ExternalID:{a.external_id} {a.name} {a.tester_id}"));

            var platformTestCases = testCases.GroupBy(a => a.platform_name);

            _testOutputHelper.WriteLine("\r\nGroups:");
            var counter = 0;

            foreach (var group in platformTestCases)
            {
                counter += group.ToArray().Length;
                _testOutputHelper.WriteLine($"Platform: {group.Key} Test cases: {group.ToArray().Length}");
            }

            _testOutputHelper.WriteLine($"All platform total test cases: {counter}");
        }
コード例 #4
0
        protected void TestLinkInitialize()
        {
            try
            {
                Tl         = new TestLink("f71e80e4c23bba99dfedf1b442bb42f5", "http://172.30.2.44/testlink/lib/api/xmlrpc.php");
                TestPlanId = Tl.getTestPlanByName(Configs.ProjectName, Configs.PlanName).id;

                if (Tl.GetBuildsForTestPlan(TestPlanId).FirstOrDefault(x => x.name == Configs.BuildName) == null)
                {
                    Tl.CreateBuild(TestPlanId, Configs.BuildName, "Build created by script");
                }

                Build firstOrDefault = Tl.GetBuildsForTestPlan(TestPlanId).FirstOrDefault(x => x.name == Configs.BuildName);
                if (firstOrDefault != null)
                {
                    BuildId = firstOrDefault.id;
                }
            }
            catch
            {
                //
            }
        }