public static bool BrowserStackAppAutomateDeleteApp(this ICakeContext context, string appId, BrowserStackSettings settings)
        {
            var browserStack = BrowserStackClient.Create(settings);

            var result = browserStack.AppAutomateDeleteApp(appId).Result;

            return(result.Success);
        }
        public static AppAutomateApp[] BrowserStackAppAutomateRecentGroupApps(this ICakeContext context, BrowserStackSettings settings)
        {
            var browserStack = BrowserStackClient.Create(settings);

            return(browserStack.AppAutomateRecentGroupApps().Result);
        }
        public static AppAutomateApp[] BrowserStackAppAutomateRecentApps(this ICakeContext context, BrowserStackSettings settings, string customId = null)
        {
            var browserStack = BrowserStackClient.Create(settings);

            return(customId == null
                ? browserStack.AppAutomateRecentApps().Result
                : browserStack.AppAutomateRecentApps(customId).Result);
        }
        public static void BrowserStackAppAutomateUpload(this ICakeContext context, string url, BrowserStackSettings settings, string customId = null)
        {
            var browserStack = BrowserStackClient.Create(settings);

            browserStack.AppAutomateUpload(new AppAutomateRequestData {
                custom_id = customId, url = url
            }).Wait();
        }
        public static void BrowserStackAppAutomateUpload(this ICakeContext context, FilePath filePath, BrowserStackSettings settings, string customId = null)
        {
            var browserStack = BrowserStackClient.Create(settings);

            var file = context.FileSystem.GetFile(filePath);

            using (var stream = file.OpenRead())
            {
                var fileName = filePath.GetFilename().ToString();

                browserStack.AppAutomateUpload(new StreamPart(stream, fileName), new AppAutomateRequestData {
                    custom_id = customId
                }).Wait();
            }
        }
        public static void BrowserStackAppLiveUpload(this ICakeContext context, FilePath filePath, BrowserStackSettings settings)
        {
            var browserStack = BrowserStackClient.Create(settings.Username, settings.AccessKey, settings.Timeout);

            var file = context.FileSystem.GetFile(filePath);

            using (var stream = file.OpenRead())
            {
                var fileName = filePath.GetFilename().ToString();

                var part = new StreamPart(stream, fileName);

                browserStack.AppLiveUpload(part).Wait();
            }
        }