diff --git a/src/test/java/features/AudiobookLyrasis.feature b/src/test/java/features/AudiobookLyrasis.feature index 5ff5ed4..d41a345 100644 --- a/src/test/java/features/AudiobookLyrasis.feature +++ b/src/test/java/features/AudiobookLyrasis.feature @@ -28,7 +28,7 @@ Feature: Audiobooks in LYRASIS Reads Then Audio player screen of book 'bookInfo' is opened And Chapter name on audio player screen is equal to 'chapterNameKey' saved chapter name And Pause button is present on audio player screen - When Select 2X playback speed on playback speed audiobook screen + When Select "2.0"X playback speed on playback speed audiobook screen And Wait for 3 seconds And Tap pause button on audio player screen Then Play button is present on audio player screen @@ -61,8 +61,9 @@ Feature: Audiobooks in LYRASIS Reads | Biblioboard | @logout @returnBooks @tier1 - Scenario Outline: Navigate by Audiobook - When Search 'available' book of distributor '' and bookType 'AUDIOBOOK' and save as 'bookNameInfo' + Scenario: Navigate by Audiobook +# When Search 'available' book of distributor '' and bookType 'AUDIOBOOK' and save as 'bookNameInfo' + When Search for "Pinocchio" and save bookName as 'bookNameInfo' And Switch to 'Audiobooks' catalog tab And Open AUDIOBOOK book with GET action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' And Click GET action button on Book details screen @@ -81,12 +82,12 @@ Feature: Audiobooks in LYRASIS Reads Then Play button is present on audio player screen And Playback has been moved behind by 15 seconds from 'timeBehind' and 'chapterTimeKey' seconds on audio player screen - Scenarios: - | distributor | - | Bibliotheca | - | Palace Marketplace | - | Axis 360 | - | Biblioboard | +# Scenarios: +# | distributor | +# | Bibliotheca | +# | Palace Marketplace | +# | Axis 360 | +# | Biblioboard | @logout @returnBooks @tier1 Scenario Outline: Check end of chapter sleep timer @@ -325,7 +326,6 @@ Feature: Audiobooks in LYRASIS Reads And Open Bookmarks on toc audiobook screen Then Bookmark for the chapter 'chapterName' with the time 'chapterTime' is saved on Bookmarks screen -# need to fix for ios @smoke @logout @returnBooks Scenario: Audiobooks: Perform check of Listen and Back button When Search for "Down the Hatch" and save bookName as 'bookNameInfo' diff --git a/src/test/java/screens/audiobook/AudioPlayerScreen.java b/src/test/java/screens/audiobook/AudioPlayerScreen.java index 45bba2b..96061ad 100644 --- a/src/test/java/screens/audiobook/AudioPlayerScreen.java +++ b/src/test/java/screens/audiobook/AudioPlayerScreen.java @@ -31,34 +31,34 @@ public class AudioPlayerScreen extends Screen { new IosLocator(By.xpath("//XCUIElementTypeButton[@label=\"Play\"]"))), "Play button"); private final IButton btnBack = getElementFactory().getButton(LocatorUtils.getLocator( new AndroidLocator(By.xpath("//android.widget.ImageButton[@content-desc=\"Back\"]")), - new IosLocator(By.xpath("//XCUIElementTypeNavigationBar/XCUIElementTypeButton[1]"))), "Back button"); + new IosLocator(By.xpath("//XCUIElementTypeNavigationBar//XCUIElementTypeImage[@name=\"Back\"]"))), "Back button"); private final IButton btnPause = getElementFactory().getButton(LocatorUtils.getLocator( new AndroidLocator(By.xpath("//android.widget.ImageView[@content-desc=\"Pause\"]")), new IosLocator(By.xpath("//XCUIElementTypeButton[@label=\"Pause\"]"))), "Pause button"); private final ILabel lblLeftTime = getElementFactory().getLabel(LocatorUtils.getLocator( new AndroidLocator(By.id("player_time")), - new IosLocator(By.xpath("//XCUIElementTypeStaticText[@name=\"progress_leftLabel\"]"))), "Left time label"); + new IosLocator(By.xpath("//XCUIElementTypeOther/XCUIElementTypeStaticText[6]"))), "Left time label"); private final IButton btnToc = getElementFactory().getButton(LocatorUtils.getLocator( new AndroidLocator(By.id("player_menu_toc")), new IosLocator(By.xpath("//XCUIElementTypeNavigationBar//XCUIElementTypeButton[@label=\"Table of contents\"]"))), "TOC button"); private final ILabel lblChapterName = getElementFactory().getLabel(LocatorUtils.getLocator( new AndroidLocator(By.id("player_spine_element")), - new IosLocator(By.xpath("(//XCUIElementTypeStaticText[@name=\"progress_rightLabel\"])[1]"))), "Chapter name label"); + new IosLocator(By.xpath("//XCUIElementTypeOther/XCUIElementTypeStaticText[7]"))), "Chapter name label"); private final IButton btnPlaybackSpeed = getElementFactory().getButton(LocatorUtils.getLocator( new AndroidLocator(By.id("player_menu_playback_rate_image")), - new IosLocator(By.xpath("//XCUIElementTypeToolbar//XCUIElementTypeButton"))), "Playback speed button"); + new IosLocator(By.xpath("//XCUIElementTypeOther/XCUIElementTypeButton[4]"))), "Playback speed button"); private final ILabel lblRightTime = getElementFactory().getLabel(LocatorUtils.getLocator( new AndroidLocator(By.id("player_time_maximum")), - new IosLocator(By.xpath("(//XCUIElementTypeStaticText[@name=\"progress_rightLabel\"])[2]"))), "Right time label"); + new IosLocator(By.xpath("//XCUIElementTypeOther/XCUIElementTypeStaticText[8]"))), "Right time label"); private final IButton btnSkipAhead = getElementFactory().getButton(LocatorUtils.getLocator( new AndroidLocator(By.id("player_jump_forwards")), - new IosLocator(By.name("skip_forward"))), "Skip ahead button"); + new IosLocator(By.name("skip forward"))), "Skip ahead button"); private final IButton btnSkipBehind = getElementFactory().getButton(LocatorUtils.getLocator( new AndroidLocator(By.id("player_jump_backwards")), - new IosLocator(By.name("skip_back"))), "Skip behind button"); + new IosLocator(By.name("skip back"))), "Skip behind button"); private final IButton btnSleepTimer = getElementFactory().getButton(LocatorUtils.getLocator( new AndroidLocator(By.id("player_menu_sleep_image")), - new IosLocator(By.xpath("//XCUIElementTypeToolbar//XCUIElementTypeButton[3]"))), "Sleep timer button"); + new IosLocator(By.xpath("//XCUIElementTypeButton[@name=\"Sleep Timer\"]"))), "Sleep timer button"); private final IButton btnSlider = getElementFactory().getButton(LocatorUtils.getLocator( new AndroidLocator(By.xpath("//android.widget.SeekBar")), new IosLocator(By.xpath("//XCUIElementTypeOther[@name=\"progress_grip\"]"))), "Slider"); diff --git a/src/test/java/screens/audiobook/PlaybackSpeedScreen.java b/src/test/java/screens/audiobook/PlaybackSpeedScreen.java index c1706cc..257b174 100644 --- a/src/test/java/screens/audiobook/PlaybackSpeedScreen.java +++ b/src/test/java/screens/audiobook/PlaybackSpeedScreen.java @@ -23,7 +23,7 @@ public class PlaybackSpeedScreen extends Screen { private static final String PLAYBACK_SPEED_ANDROID = "//*[@text=\"%sx\"]"; - private static final String PLAYBACK_SPEED_IOS = "//XCUIElementTypeButton[@name=\"%s\"]"; + private static final String PLAYBACK_SPEED_IOS = "//XCUIElementTypeButton[contains(@name,\"%s\")]"; public PlaybackSpeedScreen() { super(LocatorUtils.getLocator( @@ -40,8 +40,7 @@ public PlaybackSpeedScreen() { public void selectPlaybackSpeed(String playbackSpeed) { ActionProcessorUtils.doForIos(() -> { - String speedOptionName = speedNameIos.get(playbackSpeed); - getElementFactory().getButton(By.xpath(String.format(PLAYBACK_SPEED_IOS, speedOptionName)), speedOptionName).click(); + getElementFactory().getButton(By.xpath(String.format(PLAYBACK_SPEED_IOS, playbackSpeed)), "Playback speed " + playbackSpeed).click(); }); ActionProcessorUtils.doForAndroid(() -> { getElementFactory().getButton(By.xpath(String.format(PLAYBACK_SPEED_ANDROID, playbackSpeed)), "Playback speed").click(); diff --git a/src/test/java/screens/audiobook/TocAudiobookScreen.java b/src/test/java/screens/audiobook/TocAudiobookScreen.java index 3512747..d0b2431 100644 --- a/src/test/java/screens/audiobook/TocAudiobookScreen.java +++ b/src/test/java/screens/audiobook/TocAudiobookScreen.java @@ -40,7 +40,7 @@ public class TocAudiobookScreen extends Screen { private static final String CHAPTERS_LOC_ANDROID = "//android.widget.LinearLayout//android.widget.TextView[contains(@resource-id, \"player_toc_chapter_item_view_title\")]"; private static final String DOWNLOADING_PROGRESS_LOC_ANDROID = "//androidx.recyclerview.widget.RecyclerView//android.widget.RelativeLayout[%d]//android.view.View"; - private static final String CHAPTER_NAME_BY_CHAPTER_NUMBER_LOC_IOS = "//XCUIElementTypeTable/XCUIElementTypeCell[%d]/XCUIElementTypeStaticText[1]"; + private static final String CHAPTER_NAME_BY_CHAPTER_NUMBER_LOC_IOS = "//XCUIElementTypeCollectionView/XCUIElementTypeCell[%d]//XCUIElementTypeStaticText[1]"; public TocAudiobookScreen() { super(LocatorUtils.getLocator( diff --git a/src/test/java/stepdefinitions/audiobooksteps/PlaybackSpeedSteps.java b/src/test/java/stepdefinitions/audiobooksteps/PlaybackSpeedSteps.java index 0c192d6..7f791fe 100644 --- a/src/test/java/stepdefinitions/audiobooksteps/PlaybackSpeedSteps.java +++ b/src/test/java/stepdefinitions/audiobooksteps/PlaybackSpeedSteps.java @@ -14,9 +14,8 @@ public PlaybackSpeedSteps() { audioPlayerScreen = new AudioPlayerScreen(); } - @And("Select {double}X playback speed on playback speed audiobook screen") - public void selectPlaybackSpeedOnPlaybackSpeedAudiobookScreen(Double playbackSpeedDouble) { - String playbackSpeed = String.valueOf(playbackSpeedDouble); + @And("Select {string}X playback speed on playback speed audiobook screen") + public void selectPlaybackSpeedOnPlaybackSpeedAudiobookScreen(String playbackSpeed) { audioPlayerScreen.openPlaybackSpeed(); audioPlayerScreen.getPlaybackSpeedAudiobookScreen().selectPlaybackSpeed(playbackSpeed); }