Skip to content

Commit

Permalink
Merge pull request #18 from ThePalaceProject/refactoring_android
Browse files Browse the repository at this point in the history
refactoring Android
  • Loading branch information
AEkaterina authored Oct 25, 2023
2 parents d83b5b4 + 16ddac9 commit f8a3e5c
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/test/java/enums/epub/TabsTocAndBookmarksEpub.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
@Getter
public enum TabsTocAndBookmarksEpub {

BOOKMARKS("Bookmarks", "BOOKMARKS"),
TOC("Contents", "TABLE OF CONTENTS");
BOOKMARKS("Bookmarks", "Bookmarks"),
TOC("Contents", "Table Of Contents");

private final String iosValue;
private final String androidValue;
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/features/AudiobookLyrasis.feature
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ Feature: Audiobooks in LYRASIS Reads
When Open the 2 chapter on toc audiobook screen and save the chapter name as 'chapterName' and chapter number as 'chapterNumber'
And Set END_OF_CHAPTER sleep timer on sleep timer audiobook screen
And Select 2X playback speed on playback speed audiobook screen
And Stretch slider on the time tracking line forward on audio player screen
And Stretch slider on the time tracking line to the end of playback
And Listen a chapter on audio player screen
Then Play button is present on audio player screen
When Save the name of chapter as 'nextChapter' on audio player screen
Expand Down
8 changes: 8 additions & 0 deletions src/test/java/screens/audiobook/AudioPlayerScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,14 @@ public void stretchPlaySliderForward() {
action.press(PointOption.point(startX, startY)).moveTo(PointOption.point(endX, startY)).release().perform();
}

public void stretchPlaySliderToTheEnd() {
int startX = AqualityServices.getApplication().getDriver().findElement(btnSlider.getLocator()).getLocation().getX();
int startY = AqualityServices.getApplication().getDriver().findElement(btnSlider.getLocator()).getLocation().getY();
double endX = AqualityServices.getApplication().getDriver().findElement(lblPlaybackProgress.getLocator()).getSize().width * 0.9;
TouchAction action = new TouchAction(AqualityServices.getApplication().getDriver());
action.press(PointOption.point(startX, startY)).moveTo(PointOption.point((int) endX, startY)).release().perform();
}

public boolean isLineRemainingDisplayed() {
return lblLineRemaining.state().isDisplayed();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,14 @@ public void stretchSliderForward() {
audioPlayerScreen.stretchPlaySliderForward();
}

@When("Stretch slider on the time tracking line to the end of playback")
public void stretchSliderToTheEnd() {
audioPlayerScreen.stretchPlaySliderToTheEnd();
}

@When("Listen a chapter on audio player screen")
public void waitTheEndOfChapter() {
audioPlayerScreen.stretchPlaySliderForward();
audioPlayerScreen.stretchPlaySliderToTheEnd();
AqualityServices.getConditionalWait().waitFor(()-> {
boolean isNull = false;
long timer = audioPlayerScreen.getRightTime().getSeconds();
Expand Down

0 comments on commit f8a3e5c

Please sign in to comment.