Example #1
0
        public void DeviceFarmListSuites()
        {
            #region to-get-information-about-suites-1472583038218

            var client   = new AmazonDeviceFarmClient();
            var response = client.ListSuites(new ListSuitesRequest
            {
                Arn       = "arn:aws:devicefarm:us-west-2:123456789101:job:EXAMPLE-GUID-123-456", // You can get the Amazon Resource Name (ARN) of the job by using the list-jobs CLI command.
                NextToken = "RW5DdDJkMWYwZjM2MzM2VHVpOHJIUXlDUXlhc2QzRGViYnc9SEXAMPLE"            // A dynamically generated value, used for paginating results.
            });

            List <Suite> suites = response.Suites;

            #endregion
        }
Example #2
0
        private List <Suite> GetSuites(Job job)
        {
            string       nextToken = null;
            List <Suite> suites    = new List <Suite>();

            do
            {
                var resp = DFClient.ListSuites(new ListSuitesRequest()
                {
                    NextToken = nextToken, Arn = job.Arn
                });
                nextToken = resp.NextToken;
                suites.AddRange(resp.Suites);
            } while (nextToken != null);
            return(suites);
        }
Example #3
0
        private Dictionary <string, string> CreateArtifactsDirectoryStructure()
        {
            var structure = new Dictionary <string, string>();

            // Jobs
            var jobList = client.ListJobs(new ListJobsRequest {
                Arn = runArn
            });

            foreach (var job in jobList.Jobs)
            {
                var jobPath = SanitizeFilename(job.Name);
                var jobId   = ExtractArnId(job.Arn);

                // Suites
                var suiteList = client.ListSuites(new ListSuitesRequest {
                    Arn = job.Arn
                });

                foreach (var suite in suiteList.Suites)
                {
                    var suiteId   = ExtractArnId(suite.Arn);
                    var suitePath = SanitizeFilename(suite.Name);

                    // Tests
                    var testList = client.ListTests(new ListTestsRequest {
                        Arn = suite.Arn
                    });

                    foreach (var test in testList.Tests)
                    {
                        var testId   = ExtractArnId(test.Arn);
                        var testPath = Path.Combine(options.ArtifactsSavePath, jobPath, suitePath, SanitizeFilename(test.Name));
                        Directory.CreateDirectory(testPath);
                        structure[$"{jobId}/{suiteId}/{testId}"] = testPath;
                    }
                }
            }

            return(structure);
        }