Beispiel #1
0
		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");
		}
Beispiel #2
0
		public void Test003_DeleteVocabulary()
		{
			Trace.WriteLine(BasePage.RunningTestKeyWord + "'Delete the Vocabulary'");

			AdminTaxonomyPage adminTaxonomyPage = new AdminTaxonomyPage(_driver);
			adminTaxonomyPage.OpenUsingButtons(_baseUrl);

			//adminTaxonomyPage.WaitForElement(By.XPath(AdminTaxonomyPage.VocabularyTable));
			int itemNumber = adminTaxonomyPage.FindElements(By.XPath(AdminTaxonomyPage.VocabularyList)).Count;

			adminTaxonomyPage.DeleteVocabulary(_vocabularyName);

			adminTaxonomyPage.OpenUsingButtons(_baseUrl);
			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the number of elements in the list decreased by 1");
			Assert.That(adminTaxonomyPage.FindElements(By.XPath(AdminTaxonomyPage.VocabularyList)).Count,
						Is.EqualTo(itemNumber - 1),
						"The Vocabulary is not deleted correctly");

			Trace.WriteLine(BasePage.TraceLevelPage + "ASSERT the Vocabulary is not present in the list");
			Assert.IsFalse(adminTaxonomyPage.ElementPresent(By.XPath("//tr[td[text() = '" + _vocabularyName + "']]")),
						   "The Vocabulary is not deleted correctly");
		}