Package romanemperorsscraper.tester
Class DynastiesTester
- java.lang.Object
-
- romanemperorsscraper.tester.DynastiesTester
-
-
Field Summary
Fields Modifier and Type Field Description private static java.util.HashMap<java.lang.String,java.lang.String>expectedDynastiesprivate static java.util.HashMap<java.lang.String,java.lang.String>scrapedDynastiesprivate static org.openqa.selenium.WebDriverwebDriver
-
Constructor Summary
Constructors Constructor Description DynastiesTester()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleandoTest()Compare the scraped dynasties names and URLs with the expected onesstatic java.util.HashMap<java.lang.String,java.lang.String>getExpectedDynasties()static java.util.HashMap<java.lang.String,java.lang.String>getScrapedDynasties()static voidinitialize()Initialize the WebDriver needed to scrape data from the Wikipedia page of Roman Emperors and obtain the dynasties names and Wikipedia page URLs to be compared with the expected onesstatic voidinitialize(org.openqa.selenium.WebDriver webDriver)Obtain the dynasties names and Wikipedia page URLs to be compared with the expected ones
-
-
-
Method Detail
-
initialize
public static void initialize() throws NoSupportedBrowsersException, UnsupportedOsExceptionInitialize the WebDriver needed to scrape data from the Wikipedia page of Roman Emperors and obtain the dynasties names and Wikipedia page URLs to be compared with the expected ones- Throws:
NoSupportedBrowsersException- if there are no supported browsers installed in user's Operating SystemUnsupportedOsException- if the user's Operating System isn't supported (not a Windows, macOS or Unix-based one)
-
initialize
public static void initialize(org.openqa.selenium.WebDriver webDriver)
Obtain the dynasties names and Wikipedia page URLs to be compared with the expected ones- Parameters:
webDriver- the WebDriver needed to scrape data from the Wikipedia page
-
doTest
public static boolean doTest()
Compare the scraped dynasties names and URLs with the expected ones- Returns:
- true if the test was completed successfully, false otherwise
-
getScrapedDynasties
public static java.util.HashMap<java.lang.String,java.lang.String> getScrapedDynasties()
- Returns:
- the HashMap of scraped dynasties (where the key is the Wikipedia page URL and the value is the dynasty name)
-
getExpectedDynasties
public static java.util.HashMap<java.lang.String,java.lang.String> getExpectedDynasties()
- Returns:
- the HashMap of expected dynasties (where the key is the Wikipedia page URL and the value is the dynasty name)
-
-