Package romanemperorsscraper.tester
Class Tester
- java.lang.Object
-
- romanemperorsscraper.tester.Tester
-
public class Tester extends java.lang.Object
This class tests the following methods: - PersonPageData's constructor by scraping public PersonPageData(WebDriver webDriver, PersonNameUrl personNameUrl, String dynastyPageUrl) {[...]} (through PersonPageDataTester) - Dynasty's constructor by scraping public Dynasty(String dynastyPageUrl, String dynastyName, WebDriver webDriver, boolean makeDynastyTree) {[...]} (through DynastyTester) - Dynasty's getDynasties method (through DynastiesTester)- Author:
- Matteo Collica, Sara Lazzaroni, Radu Ionut Barbalata
-
-
Constructor Summary
Constructors Constructor Description Tester()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static int
computeResults(int numberOfSinglePassedTests, int numberOfSingleTests)
Compare the number of single passed tests with the total amount of single tests and print out the outcomestatic void
main(java.lang.String[] args)
The main method executes and keeps count of the single passed tests and test groups (PersonPageDataTester, DynastyTester and DynastiesTester) passed over the total amountstatic void
printValues(java.util.ArrayList<java.lang.String> fields, java.util.HashMap<java.lang.String,java.lang.String> expectedScrapedValues)
Given an ArrayList of fields and their expected and scraped value, print them all
-
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws UnsupportedOsException, NoSupportedBrowsersException
The main method executes and keeps count of the single passed tests and test groups (PersonPageDataTester, DynastyTester and DynastiesTester) passed over the total amount- Parameters:
args
- currently there is no support for any command-line argument- Throws:
UnsupportedOsException
NoSupportedBrowsersException
-
printValues
public static void printValues(java.util.ArrayList<java.lang.String> fields, java.util.HashMap<java.lang.String,java.lang.String> expectedScrapedValues)
Given an ArrayList of fields and their expected and scraped value, print them all- Parameters:
fields
- an ArrayList of the fields we have to print expected values and scraped values ofexpectedScrapedValues
- the expected value : scraped value entries to be printed
-
computeResults
public static int computeResults(int numberOfSinglePassedTests, int numberOfSingleTests)
Compare the number of single passed tests with the total amount of single tests and print out the outcome- Parameters:
numberOfSinglePassedTests
- the number of single passed testsnumberOfSingleTests
- the total amount of single tests- Returns:
- 1 if the number of single passed tests is the same as the total amount of tests, 0 otherwise
-
-