Skip to content

Commit

Permalink
The tests will fail when ANIME vertical will be filled with data
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalyszko-fandom committed Dec 17, 2019
1 parent 223fe7d commit 0895322
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
Expand Up @@ -99,7 +99,25 @@ public void verifyWamIndexIsNotEmpty() {
true
);
} else {
Log.log("verifyTabIsSelected", "there is only the head row", false);
Log.log("verifyWamIndexIsNotEmpty", "there is only the head row", false);
}
}

/**
* @desc Checks if the table for the vertical tab is empty. Needed to monitor data in ANIME vertical
*/
public void verifyWamIndexIsEmpty() {
wait.forElementPresent(WAM_INDEX_TABLE);
int rows = wamIndexRows.size();
if (rows == 2 && wamIndexRows.get(1).getText().startsWith("The wiki you searched for is not in the top 5000")) {
Log.log(
"verifyWamIndexIsEmpty",
"WamTab for this vertical is empty, as it should be",
true
);
} else {
Log.log("verifyWamIndexIsEmpty",
"Rows in this tab started to appear! ANIME vertical is probably filled with data!", false);
}
}

Expand Down
Expand Up @@ -8,9 +8,8 @@ public enum WamTab {
COMICS(4, "COMICS"),
LIFESTYLE(5, "LIFESTYLE"),
MUSIC(6, "MUSIC"),
MOVIES(7, "MOVIES");
// ANIME the line below should be uncommented somewhere in 2020 when Anime data will start to appear
//ANIME(8, "ANIME");
MOVIES(7, "MOVIES"),
ANIME(8, "ANIME");

private final int verticalId;

Expand Down
Expand Up @@ -34,13 +34,14 @@ public void wam_001_verifyDefaultPage() {

@Test
public void wam_002_verifyFilteringByVertical() {
// WARNING! There are some hardcoded instructions which aim was to make sure that the test will not fail on Anime tab
// when the Anime tab will start to be filled with data, we should remove those fragments
// Seek for "Anime" in the tests to find those instructions
wam.verifyWamIndexIsNotEmpty();
wam.verifyWamVerticalFilterOptions();

for (WamTab tab : EnumSet.complementOf(EnumSet.of(WamTab.ALL))) {
// ignore ANIME vertical
// delete the line below when ANIME wertical will start to be filled withd data!
if (tab.getId() == 8)
continue;
wam.selectTab(tab);
wam.verifyIfVerticalIdSelectedInUrl(tab.getId());
wam.verifyWamIndexIsNotEmpty();
Expand Down Expand Up @@ -107,4 +108,15 @@ public void wam_006_testJune32019DataCorrectness() {
);

}

@Test
@RelatedIssue(issueID = "DE-4569", comment = "If fails, remove the tests and include ANIME vertical in test 002.")
/**
* The goal of this test is to alert the DE team when Anime verticall will start to be filled with data.
* If the test fails, we need to changge the tests to start monitoring if this vertical is filled with data.
*/
public void wam_007_checkIfAnimeAlreadyIsFilled() {
wam.selectTab(WamTab.ANIME);
wam.verifyWamIndexIsEmpty();
}
}

0 comments on commit 0895322

Please sign in to comment.