Esempio n. 1
0
        public void FunctionsPage_NoInvocations()
        {
            FunctionsPage page = Dashboard.GoToFunctionsPage();

            InvocationsSection section = page.InvocationsSection;

            Assert.True(section.IsUserAccesible);

            Assert.Equal("Invocation Log Recently executed functions", section.Title.Text);

            InvocationsTable table = section.Table;

            table.WaitForDataToLoad();

            table = section.Table;

            IEnumerable <TableRow> rows = table.BodyRows;

            Assert.Equal(1, rows.Count());

            TableRow singleRow            = rows.Single();
            IEnumerable <TableCell> cells = singleRow.Cells;

            Assert.Equal(1, cells.Count());

            TableCell singleCell = cells.Single();

            Assert.Equal(table.HeaderRows.First().Cells.Count(), singleCell.ColSpan);
            Assert.Equal("No functions have run recently.", singleCell.RawElement.Text);
        }
Esempio n. 2
0
        public void FunctionsPage_NoFunctions()
        {
            FunctionsPage page = Dashboard.GoToFunctionsPage();

            FunctionsSection section = page.FunctionsSection;

            Assert.True(section.IsUserAccesible);

            Assert.Equal("Functions", section.Title.Text);

            FunctionsTable table = section.Table;

            table.WaitForDataToLoad();

            // Find the table again because after load it gets completely replace
            table = section.Table;

            IEnumerable <TableRow> rows = table.BodyRows;

            Assert.Equal(1, rows.Count());

            TableRow singleRow            = rows.Single();
            IEnumerable <TableCell> cells = singleRow.Cells;

            Assert.Equal(1, cells.Count());

            TableCell singleCell = cells.Single();

            Assert.Equal(table.HeaderRows.First().Cells.Count(), singleCell.ColSpan);
            Assert.Equal("No functions are present.", singleCell.RawElement.Text);
        }
Esempio n. 3
0
        public void FunctionsPage_Invocations()
        {
            FunctionsPage page = Dashboard.GoToFunctionsPage();

            InvocationsSection section = page.InvocationsSection;

            ValidateEmptyInvocationsTable(() => section.Table);
        }
Esempio n. 4
0
        public void FunctionsPage_SdkTeaser()
        {
            FunctionsPage page = Dashboard.GoToFunctionsPage();

            SdkTeaserNotification sdkTeaserNotification = page.SdkTeaserNotificationSection.SdkTeaserNotification;

            Assert.True(sdkTeaserNotification.IsUserAccesible);
            Assert.Equal("http://go.microsoft.com/fwlink/?LinkID=320954", sdkTeaserNotification.MoreInfoUrl.Href);
        }
Esempio n. 5
0
        public void FunctionsPage_InaccessibleError()
        {
            FunctionsPage page = Dashboard.GoToFunctionsPage();

            BadConnectionStringNotification notification = page.ErrorsNotificationSection.BadConnectionStringNotification;

            Assert.True(notification.IsUserAccesible);
            Assert.Equal("The configuration is not properly set for the Microsoft Azure WebJobs Dashboard. " +
                         "Failed to connect with the xxxxxxxxxx storage account using credentials provided in the connection " +
                         "string.\r\nIn your Microsoft Azure Website configuration you must set a connection string named " +
                         "AzureWebJobsDashboard by using the following format " +
                         "DefaultEndpointsProtocol=https;AccountName=NAME;AccountKey=KEY pointing to the Microsoft Azure " +
                         "Storage account where the Microsoft Azure WebJobs Runtime logs are stored.\r\n\r\nPlease visit the " +
                         "article about configuring connection strings for more information on how you can configure " +
                         "connection strings in your Microsoft Azure Website.",
                         notification.ErrorMessage);
            Assert.Equal("http://go.microsoft.com/fwlink/?LinkID=320957", notification.HelpUrl.Href);
        }
Esempio n. 6
0
        public void FunctionsPage_Functions()
        {
            FunctionsPage page = Dashboard.GoToFunctionsPage();

            FunctionsSection section = page.FunctionsSection;

            section.Table.WaitForDataToLoad();

            IEnumerable <TableRow> functionsRows = section.Table.BodyRows;

            Assert.Equal(1, functionsRows.Count());

            FunctionsTableRow functionRow = functionsRows.Single() as FunctionsTableRow;

            Assert.NotNull(functionRow);

            // TODO: assert link
            Assert.Equal("SingleFunction.Function", functionRow.FunctionName);
            Assert.Equal(2, functionRow.SuccessCount);
            Assert.Equal(1, functionRow.FailCount);
        }
Esempio n. 7
0
        public void FunctionsPage_OldHost()
        {
            try
            {
                _storageAccount.CreateOldHostContainer();

                FunctionsPage page = Dashboard.GoToFunctionsPage();

                OldHostNotification notification = page.ErrorsNotificationSection.OldHostNotification;
                Assert.True(notification.IsUserAccesible);
                Assert.Equal(
                    "Jobs from an earlier version of the Azure WebJobs SDK have been detected. Please upgrade the jobs to the latest version in order to see their status in the dashboard. Please visit this article for more information about the Azure WebJobs SDK.",
                    notification.Text);
                Assert.Equal("http://go.microsoft.com/fwlink/?LinkID=401520", notification.HelpUrl.Href);
            }
            finally
            {
                Dashboard.Quit();
                _storageAccount.RemoveOldHostContainer();
            }
        }
Esempio n. 8
0
        public void FunctionsPage_Functions()
        {
            FunctionsPage page = Dashboard.GoToFunctionsPage();

            FunctionsSection functionsSection = page.FunctionsSection;

            functionsSection.Table.WaitForDataToLoad();

            IEnumerable <TableRow> functionsRows = functionsSection.Table.BodyRows;

            Assert.Equal(1, functionsRows.Count());

            FunctionsTableRow functionRow = functionsRows.Single() as FunctionsTableRow;

            Assert.NotNull(functionRow);

            Assert.Equal("SingleFunction.Function", functionRow.FunctionName);
            Assert.Equal(0, functionRow.SuccessCount);
            Assert.Equal(0, functionRow.FailCount);
            Assert.Equal(
                Dashboard.BuildFullUrl(FunctionDefinitionPage.ConstructRelativePath(_functionDefinitionId)),
                functionRow.FunctionLink.Href);
        }