Пример #1
0
        private static async Task JiraAsync(string ticket)
        {
            // JIRA
            var jiraHost = Environment.GetEnvironmentVariable("VISDIFF_JIRA_HOST");
            var jiraUser = Environment.GetEnvironmentVariable("VISDIFF_JIRA_USER");
            var jiraKey  = Environment.GetEnvironmentVariable("VISDIFF_JIRA_KEY");
            var jira     = JIRAUtils.Create(jiraHost, jiraUser, jiraKey);

            // SauceLabs Browser w/ tunnel enabled.
            var user   = Environment.GetEnvironmentVariable("VISDIFF_GRID_USER");
            var apiKey = Environment.GetEnvironmentVariable("VISDIFF_GRID_KEY");
            var host   = Environment.GetEnvironmentVariable("VISDIFF_GRID_HOST");
            var opts   = SauceLabsBrowser.GetDefaultBrowserOptions(true); // Set this to false for no tunnel

            opts = SeleniumBrowser.AddCredentials(opts, user, apiKey);
            var browser = new SauceLabsBrowser(opts, host);

            var tcManager = new DefaultTestCaseManager(browser)
            {
                ProdBaseUrl  = "http://example.com",
                StageBaseUrl = "http://stage.example.com"
            };

            // You can do some fun stuff in here, like:
            // if (ticket.startsWith("PROJECT1-")) tcManager = new ProjectOneTCManager(browser); - This example could also be handled inside of a single TCManager
            // if (ticket.startsWith("MOBILE-")) tcManager = newMobileTCManager(new MobileBrowser());

            // GO!
            Console.WriteLine(String.Format("[RABBIT][JIRA-ASYNC] Received: {0}", ticket));
            await OrchestrationUtils.RunJiraDiff(jira, tcManager, ticket);

            Console.WriteLine(String.Format("[RABBIT][JIRA-ASYNC] Completed: {0}", ticket));
        }
Пример #2
0
        private static async Task JiraAsync(string ticket)
        {
            // JIRA
            var jiraHost = Environment.GetEnvironmentVariable("VISDIFF_JIRA_HOST");
            var jiraUser = Environment.GetEnvironmentVariable("VISDIFF_JIRA_USER");
            var jiraKey  = Environment.GetEnvironmentVariable("VISDIFF_JIRA_KEY");
            var jira     = JIRAUtils.Create(jiraHost, jiraUser, jiraKey);

            // Browser
            var browser   = new PuppeteerBrowser();
            var tcManager = new DefaultTestCaseManager(browser)
            {
                ProdBaseUrl  = "http://example.com",
                StageBaseUrl = "http://stage.example.com"
            };

            // GO!
            Console.WriteLine(String.Format("[RABBIT][JIRA-ASYNC] Received: {0}", ticket));
            await OrchestrationUtils.RunJiraDiff(jira, tcManager, ticket);

            Console.WriteLine(String.Format("[RABBIT][JIRA-ASYNC] Completed: {0}", ticket));
        }