Beispiel #1
0
 public void TestJournals(Journals journ)
 {
     journPage.GoToTheJournal(journ.journalName, driverForJournals /*.getInstance(TestData.browser)*/);
     Assert.False(driverForJournals /*.getInstance(TestData.browser)*/.Url.Contains("PageNotFoundError"), "There is no journal named " + journ.journalName);
     journPage.SearchAndGo(driverForJournals /*.getInstance(TestData.browser)*/);
     accumulator.Accumulate(() => Assert.True(SearchPage.CheckSearch(driverForJournals /*.getInstance(TestData.browser)*/), "No results"));
     journPage.GoToTheAdvancedSearch(driverForJournals /*.getInstance(TestData.browser)*/);
     AdvancedSearchPage.MakeSearch(driverForJournals /*.getInstance(TestData.browser)*/);
     accumulator.Accumulate(() => Assert.False(AdvancedSearchPage.CheckSearch(driverForJournals /*.getInstance(TestData.browser)*/), "No results"));
     journPage.GoToTheJournal(journ.journalName, driverForJournals /*.getInstance(TestData.browser)*/);
     journPage.CheckEverythingForExist(journ, driverForJournals /*.getInstance(TestData.browser)*/);
     accumulator.Release();
 }
Beispiel #2
0
        public void CheckEverythingForExist(Journals obj, IWebDriver driver)
        {
            foreach (var navs in obj.navigation)
            {
                tempBigXpath           = "//a[contains(text(), \"" + navs.bigItem + "\")]";
                tempNavElement.name    = navs.bigItem + " in " + obj.journalName;
                tempNavElement.locator = By.XPath(tempBigXpath);
                logger.Info("Checking if element exists {0}, its XPath: {1}", tempNavElement.name, tempBigXpath);
                assertsAccumulator.Accumulate(() => Assert.True(CheckItemExist(tempNavElement, driver), "The Element " + tempNavElement.name + " does not exist"));

                tempSmallXpath           = "//span[contains(text(), \"" + navs.item + "\")]";
                tempSmallElement.name    = navs.item + " in " + obj.journalName;
                tempSmallElement.locator = By.XPath(tempSmallXpath);
                logger.Info("Checking if element exists {0}, its XPath: {1}", tempSmallElement.name, tempSmallXpath);
                assertsAccumulator.Accumulate(() => Assert.True(CheckItemExist(tempSmallElement, driver), "The Element " + tempSmallElement.name + " does not exist"));
            }
            assertsAccumulator.Release();
        }