Exemplo n.º 1
0
        public void ThenIShouldSeeTheFollowingRepositories(Table table)
        {
            var repositories = Wait.Until(d => d.FindElements(By.ClassName("repository")).Where(r => !r.GetAttribute("class").Contains("ng-hide"))).ToArray();

            Assert.GreaterOrEqual(repositories.Count(), table.RowCount, "Number of repositories wrong");

            for (var i = 0; i < table.RowCount; i++)
            {
                IWebElement repository = null;
                var         tableRow   = table.Rows[i];

                var title = tableRow["Title"];

                for (var z = 0; z < repositories.Count(); z++)
                {
                    repository = repositories[z].FindElement(By.Id(title));
                    if (repository != null)
                    {
                        break;
                    }
                }

                Assert.NotNull(repository, string.Format("Can't find repository {0}", title));

                HtmlRepositoryUtility.CompareRepository(tableRow, repository);
            }
        }
Exemplo n.º 2
0
        public void ThenIShouldSeeTheFollowingRepository(Table table)
        {
            var row = table.Rows[0];

            row["Title"]   = string.Format(row["Title"], ScenarioContext.Current["uniqueness"]);
            row["ApiUrl"]  = string.Format(row["ApiUrl"], ScenarioContext.Current["uniqueness"]);
            row["FeedUrl"] = string.Format(row["FeedUrl"], ScenarioContext.Current["uniqueness"]);

            var repository = this.Wait.Until(d => d.FindElements(By.Id(row["Title"])).LastOrDefault());

            Assert.IsNotNull(repository, "Repository not found!");

            HtmlRepositoryUtility.CompareRepository(row, repository);
        }