Skip to content

Commit

Permalink
changed step to check library on iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
AEkaterina committed Feb 6, 2024
1 parent 4361270 commit 1af05e4
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/test/java/stepdefinitions/CatalogSteps.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import enums.localization.catalog.ActionButtonsForBooksAndAlertsKeys;
import enums.localization.sortoptions.AvailabilityKeys;
import enums.localization.sortoptions.SortByKeys;
import framework.utilities.ActionProcessorUtils;
import framework.utilities.ScenarioContext;
import framework.utilities.swipe.SwipeElementUtils;
import io.cucumber.java.en.Then;
Expand Down Expand Up @@ -35,6 +36,8 @@ public class CatalogSteps {
private final CatalogBooksScreen catalogBooksScreen;
private final SortOptionsScreen sortOptionsScreen;
private final SearchScreen searchScreen;
private final SettingsScreen settingsScreen;
private final LibrariesScreen librariesScreen;
private final ScenarioContext context;
private static final SecureRandom random = new SecureRandom();

Expand All @@ -48,6 +51,8 @@ public CatalogSteps(ScenarioContext context){
catalogBooksScreen = new CatalogBooksScreen();
sortOptionsScreen = new SortOptionsScreen();
searchScreen = new SearchScreen();
settingsScreen = new SettingsScreen();
librariesScreen = new LibrariesScreen();
}

@When("Open Catalog")
Expand All @@ -62,7 +67,13 @@ public void isCatalogScreenOpened() {

@Then("Library {string} is opened on Catalog screen")
public void isLibraryOpenedInCatalog(String libraryName){
Assert.assertTrue("Library is not opened on the Catalog screen!", catalogScreen.isLibraryOnTheCatalogDisplayed(libraryName));
ActionProcessorUtils.doForAndroid(() -> Assert.assertTrue("Library is not opened on the Catalog screen!", catalogScreen.isLibraryOnTheCatalogDisplayed(libraryName)));
ActionProcessorUtils.doForIos(() -> {
menuBarScreen.openBottomMenuTab(MenuBar.SETTINGS);
menuBarScreen.openBottomMenuTab(MenuBar.SETTINGS);
settingsScreen.openLibraries();
Assert.assertTrue(libraryName + " is not present on Libraries screen", librariesScreen.isLibraryPresent(libraryName));
});
}

@Then("Count of books in first category is more than {int}")
Expand Down

0 comments on commit 1af05e4

Please sign in to comment.