public void Test001_AddNewVocabulary() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Add a new Vocabulary"); var adminTaxonomyPage = new AdminTaxonomyPage(_driver); adminTaxonomyPage.OpenUsingButtons(_baseUrl); int itemNumber = adminTaxonomyPage.FindElements(By.XPath(AdminTaxonomyPage.VocabularyList)).Count; adminTaxonomyPage.AddNewVocabulary(_vocabularyName, _vocabularyType, _vocabularyScope); adminTaxonomyPage.OpenUsingButtons(_baseUrl); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list increased by 1"); Assert.That( adminTaxonomyPage.FindElements(By.XPath(AdminTaxonomyPage.VocabularyList)).Count, Is.EqualTo(itemNumber + 1), "The Vocabulary is not added correctly"); Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Vocabulary is present in the list"); Assert.IsTrue(adminTaxonomyPage.ElementPresent(By.XPath("//tr[td[text() = '" + _vocabularyName + "']]")), "The Vocabulary is not added correctly"); }
[Test] //Testcase trace: Test-672 public void Test005_Host_VocabularyWithWebsiteScopeShouldNotBeAvailableOnChildSite() { Trace.WriteLine(BasePage.RunningTestKeyWord + "'Host: Add Vocabulary with Website scope - it should not be available on child site'"); //Open 'Taxonomy' page AdminTaxonomyPage adminTaxonomyPage = new AdminTaxonomyPage(_driver); adminTaxonomyPage.OpenUsingButtons(_baseUrl); // Click on 'Create New Vocabulary' button and Add a Vocabulary Name and Scope=Application and Click on 'Create Vocabulary' button adminTaxonomyPage.AddNewVocabulary(_websiteScopeVocabularyName, "simple", "website"); //Assert the Vocabulary's scope is Website Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Vocabulary is present and its scope is Website"); Assert.That(adminTaxonomyPage.WaitForElement(By.XPath("//tr[td[text() = '" + _websiteScopeVocabularyName + "']]/td[5]")).Text, Is.EqualTo("Website"), "The Vocabulary scope is not 'Website'"); //Navigate to Child site using its url and Open 'Taxonomy' page adminTaxonomyPage.OpenUsingButtons(_baseUrl + "/" + _childSiteName); //Assert the new vocabulary exists and Assert the new vocabulary's scope is Application Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Vocabulary is NOT present"); Assert.IsFalse(adminTaxonomyPage.ElementPresent(By.XPath("//tr[td[text() = '" + _websiteScopeVocabularyName + "']]")), "The Vocabulary with Webiste scope is present on child site"); }