Skip to content

Commit

Permalink
updated tests for Catalog on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
AEkaterina committed Nov 5, 2023
1 parent d405fd1 commit 7911632
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/test/java/screens/CatalogScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import constants.appattributes.IosAttributes;
import framework.utilities.ActionProcessorUtils;
import framework.utilities.LocatorUtils;
import framework.utilities.swipe.SwipeElementUtils;
import models.AndroidLocator;
import models.IosLocator;
import org.openqa.selenium.By;
Expand Down Expand Up @@ -42,7 +41,7 @@ public class CatalogScreen extends Screen {

private static final String CATEGORY_NAME_LOCATOR_ANDROID = "//android.widget.TextView[contains(@resource-id, \"feedLaneTitle\") and @text=\"%1$s\"]/parent::android.widget.LinearLayout/following-sibling::*[contains(@resource-id,\"feedLaneCoversScroll\")]";
private static final String CATEGORY_LOCATOR_ANDROID = "//androidx.recyclerview.widget.RecyclerView//android.widget.LinearLayout/android.widget.TextView[1]";
private static final String BOOK_COVER_IN_CATEGORY_LOCATOR_ANDROID = "/android.widget.LinearLayout";
private static final String BOOK_COVER_IN_CATEGORY_LOCATOR_ANDROID = "/android.widget.FrameLayout";
private static final String BOOK_NAME_LOCATOR_ANDROID = "//androidx.recyclerview.widget.RecyclerView[contains(@resource-id,\"feedWithoutGroupsList\")]/android.widget.FrameLayout/android.view.ViewGroup/android.widget.TextView[1]";
private static final String CURRENT_CATEGORY_LOCATOR_ANDROID = "//android.widget.TextView[contains(@resource-id, \"feedLaneTitle\") and @text=\"%1$s\"]";
private static final String MORE_BUTTON_LOCATOR_ANDROID = "//android.widget.LinearLayout/android.widget.TextView[@text=\"More…\"]";
Expand Down Expand Up @@ -87,7 +86,6 @@ public Set<String> getListOfBooksNameInFirstCategory() {
categoryLine.getTouchActions().scrollToElement(SwipeDirection.DOWN);
do {
bookNames.addAll(currentBooksNames);
SwipeElementUtils.swipeFromRightToLeft(categoryLine);
currentBooksNames = getValuesFromListOfLabels(LocatorUtils.getLocator(
new AndroidLocator(By.xpath(String.format(CATEGORY_NAME_LOCATOR_ANDROID, categoryName) + BOOK_COVER_IN_CATEGORY_LOCATOR_ANDROID)),
new IosLocator(By.xpath(String.format(CATEGORY_NAME_LOCATOR_IOS, categoryName) + BOOK_COVER_IN_CATEGORY_LOCATOR_IOS))));
Expand Down

0 comments on commit 7911632

Please sign in to comment.