From 2b6a58ab8bec191c7dba55a2647d7e3c7745a2b5 Mon Sep 17 00:00:00 2001 From: AEkaterina Date: Thu, 18 Jan 2024 00:05:16 +0400 Subject: [PATCH 1/4] added biblioboard --- .../java/features/AudiobookLyrasis.feature | 18 +++++++++++++++--- src/test/java/features/EpubLyrasis.feature | 3 --- .../java/features/PdfLyrasisAndroid.feature | 14 +++++++------- src/test/java/features/PdfLyrasisIos.feature | 14 +++++++------- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/src/test/java/features/AudiobookLyrasis.feature b/src/test/java/features/AudiobookLyrasis.feature index db29b46..d4cfddb 100644 --- a/src/test/java/features/AudiobookLyrasis.feature +++ b/src/test/java/features/AudiobookLyrasis.feature @@ -59,6 +59,7 @@ Feature: Audiobooks in LYRASIS Reads | Bibliotheca | | Palace Marketplace | | Axis 360 | + | BiblioBoard | @logout @returnBooks @tier1 Scenario Outline: Navigate by Audiobook @@ -86,6 +87,7 @@ Feature: Audiobooks in LYRASIS Reads | Bibliotheca | | Palace Marketplace | | Axis 360 | + | BiblioBoard | @logout @returnBooks @tier1 Scenario Outline: Check end of chapter sleep timer @@ -114,6 +116,7 @@ Feature: Audiobooks in LYRASIS Reads | Bibliotheca | | Palace Marketplace | | Axis 360 | + | BiblioBoard | @logout @returnBooks @tier1 @exclude_android Scenario Outline: Check of line for time remaining @@ -131,6 +134,7 @@ Feature: Audiobooks in LYRASIS Reads | Bibliotheca | | Palace Marketplace | | Axis 360 | + | BiblioBoard | @logout @returnBooks @tier1 Scenario Outline: Check of switching to the next time @@ -152,6 +156,7 @@ Feature: Audiobooks in LYRASIS Reads | Bibliotheca | | Palace Marketplace | | Axis 360 | + | BiblioBoard | @logout @returnBooks @tier1 Scenario Outline: Check playback speed and sleep timer @@ -180,6 +185,7 @@ Feature: Audiobooks in LYRASIS Reads | Bibliotheca | | Palace Marketplace | | Axis 360 | + | BiblioBoard | @logout @returnBooks @tier1 @exlude_ios Scenario Outline: Check time tracking line @@ -208,6 +214,7 @@ Feature: Audiobooks in LYRASIS Reads | Bibliotheca | | Palace Marketplace | | Axis 360 | + | BiblioBoard | @logout @returnBooks @tier1 @exclude_ios Scenario Outline: Check of not rewinding forward and back by tapping on time bar @@ -237,6 +244,7 @@ Feature: Audiobooks in LYRASIS Reads | Palace Marketplace | | Axis 360 | | Bibliotheca | + | BiblioBoard | @logout @returnBooks @tier1 Scenario Outline: Playback speed: Check of playback speed @@ -275,10 +283,14 @@ Feature: Audiobooks in LYRASIS Reads | Axis 360 | 1.25 | 8 | 10 | | Axis 360 | 1.50 | 6 | 9 | | Axis 360 | 2.0 | 5 | 10 | + | Bibliotheca | 0.75 | 8 | 6 | + | Bibliotheca | 1.25 | 8 | 10 | + | Bibliotheca | 1.50 | 6 | 9 | | Bibliotheca | 2.0 | 5 | 10 | - | Bibliotheca | 2.0 | 5 | 10 | - | Bibliotheca | 2.0 | 5 | 10 | - | Bibliotheca | 2.0 | 5 | 10 | + | BiblioBoard | 0.75 | 8 | 6 | + | BiblioBoard | 1.25 | 8 | 10 | + | BiblioBoard | 1.50 | 6 | 9 | + | BiblioBoard | 2.0 | 5 | 10 | @logout @returnBooks @tier1 Scenario: TOC: Check of table of contents diff --git a/src/test/java/features/EpubLyrasis.feature b/src/test/java/features/EpubLyrasis.feature index ae6de36..93c143d 100644 --- a/src/test/java/features/EpubLyrasis.feature +++ b/src/test/java/features/EpubLyrasis.feature @@ -174,7 +174,6 @@ Feature: Read EPUB in Lyrasis Reads | Bibliotheca | | Palace Marketplace | | Axis 360 | - | BiblioBoard | @logout @returnBooks @tier1 Scenario Outline: Navigate by bookmarks @@ -204,7 +203,6 @@ Feature: Read EPUB in Lyrasis Reads | Bibliotheca | | Palace Marketplace | | Axis 360 | - | BiblioBoard | @logout @returnBooks @tier1 Scenario Outline: Delete bookmarks @@ -234,7 +232,6 @@ Feature: Read EPUB in Lyrasis Reads | Bibliotheca | | Palace Marketplace | | Axis 360 | - | BiblioBoard | @logout @returnBooks @tier1 Scenario: Read ebooks: Search: Perform check of the placeholder diff --git a/src/test/java/features/PdfLyrasisAndroid.feature b/src/test/java/features/PdfLyrasisAndroid.feature index 6e7c657..816fb8d 100644 --- a/src/test/java/features/PdfLyrasisAndroid.feature +++ b/src/test/java/features/PdfLyrasisAndroid.feature @@ -134,7 +134,7 @@ Feature: Read PDF in LYRASIS Reads on Android @smoke @logout @returnBooks @exclude_ios Scenario: Android: Read pdfs: Table of contents: Perform check of navigation of TOC button When Open search modal - And Search for "A Queen From the North" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' @@ -154,7 +154,7 @@ Feature: Read PDF in LYRASIS Reads on Android @smoke @logout @returnBooks @exclude_ios Scenario: Android: Read pdfs: Perform check of Settings When Open search modal - And Search for "Being Plumville" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' @@ -166,7 +166,7 @@ Feature: Read PDF in LYRASIS Reads on Android @smoke @logout @returnBooks @exclude_ios Scenario: Android: Read pdfs: Perform check of scrolling by default (down and up) When Open search modal - And Search for "The Art of Three" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' @@ -186,7 +186,7 @@ Feature: Read PDF in LYRASIS Reads on Android @smoke @logout @returnBooks @exclude_ios Scenario: Android: Read pdfs: Table of contents: Perform check of navigation When Open search modal - And Search for "The Art of Three" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' @@ -202,7 +202,7 @@ Feature: Read PDF in LYRASIS Reads on Android @smoke @logout @returnBooks @exclude_ios Scenario: Android: Read pdfs: Perform check of back button When Open search modal - And Search for "Being Plumville" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' @@ -214,7 +214,7 @@ Feature: Read PDF in LYRASIS Reads on Android @smoke @logout @returnBooks @exclude_ios Scenario: Android: Read pdfs: Table of contents: Contents with thumbnails: Perform check of navigation When Open search modal - And Search for "A Queen From the North" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' @@ -230,7 +230,7 @@ Feature: Read PDF in LYRASIS Reads on Android @smoke @logout @returnBooks @exclude_ios Scenario: Android: Read pdfs: Table of contents: Chapter content: Perform check of navigation When Open search modal - And Search for "A Queen From the North" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' diff --git a/src/test/java/features/PdfLyrasisIos.feature b/src/test/java/features/PdfLyrasisIos.feature index 1ea7814..c5513de 100644 --- a/src/test/java/features/PdfLyrasisIos.feature +++ b/src/test/java/features/PdfLyrasisIos.feature @@ -155,7 +155,7 @@ Feature: Read PDF in LYRARIS Reads on IOS @smoke @logout @returnBooks @exclude_android Scenario: IOS: Read pdfs: Pages: Perform check of reader navigating (swiping left and right) When Open search modal - And Search for "A Queen From the North" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' @@ -171,7 +171,7 @@ Feature: Read PDF in LYRARIS Reads on IOS @smoke @logout @returnBooks @exclude_android Scenario: iOS: Read pdfs: Search: Perform check that the field allows you to enter characters and delete them When Open search modal - And Search for "A Queen From the North" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' @@ -186,7 +186,7 @@ Feature: Read PDF in LYRARIS Reads on IOS @smoke @logout @returnBooks @exclude_android Scenario: iOS: Read pdfs: Search: Perform check of finding a word in the book When Open search modal - And Search for "A Queen From the North" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' @@ -200,7 +200,7 @@ Feature: Read PDF in LYRARIS Reads on IOS @smoke @logout @returnBooks @exclude_android Scenario: iOS: Read pdfs: Table of contents: Perform check of navigation When Open search modal - And Search for "Being Plumville" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' @@ -216,7 +216,7 @@ Feature: Read PDF in LYRARIS Reads on IOS @smoke @logout @returnBooks @exclude_android Scenario: iOS: Read pdfs: Perform check of back button When Open search modal - And Search for "Being Plumville" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' @@ -228,7 +228,7 @@ Feature: Read PDF in LYRARIS Reads on IOS @smoke @logout @returnBooks @exclude_android Scenario: iOS: Read pdfs: Table of contents: Contents with thumbnails: Perform check of navigation When Open search modal - And Search for "The Art of Three" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' @@ -244,7 +244,7 @@ Feature: Read PDF in LYRARIS Reads on IOS @smoke @logout @returnBooks @exclude_android Scenario: iOS: Read pdfs: Table of contents: Chapter content: Perform check of navigation When Open search modal - And Search for "The Art of Three" and save bookName as 'bookNameInfo' + And Search 'available' book of distributor 'Biblioboard' and bookType 'EBOOK' and save as 'bookNameInfo' And Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on Catalog books screen When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' From 29c88cba0993790790f48d011ccf3321075d2c7c Mon Sep 17 00:00:00 2001 From: AEkaterina Date: Thu, 18 Jan 2024 04:10:09 +0400 Subject: [PATCH 2/4] updated audiobooks --- .../java/features/AudiobookLyrasis.feature | 19 +++++++------- src/test/java/screens/CatalogScreen.java | 2 +- .../screens/audiobook/AudioPlayerScreen.java | 2 +- .../audiobooksteps/AudioPlayerSteps.java | 26 ++++++++----------- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/test/java/features/AudiobookLyrasis.feature b/src/test/java/features/AudiobookLyrasis.feature index d4cfddb..9fa1509 100644 --- a/src/test/java/features/AudiobookLyrasis.feature +++ b/src/test/java/features/AudiobookLyrasis.feature @@ -64,13 +64,14 @@ Feature: Audiobooks in LYRASIS Reads @logout @returnBooks @tier1 Scenario Outline: Navigate by Audiobook When Search 'available' book of distributor '' and bookType 'AUDIOBOOK' and save as 'bookNameInfo' - And Switch to 'Audiobooks' catalog tab + 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 Then Check that book contains LISTEN action button on Book details screen When Click LISTEN action button on Book details screen Then Audio player screen of book 'bookInfo' is opened - When Tap play button on audio player screen + When Save chapter time as 'chapterTimeKeyForBehind' on audio player screen + And Tap play button on audio player screen And Tap pause button on audio player screen And Save book play time as 'timeAhead' on audio player screen And Save chapter time as 'chapterTimeKey' on audio player screen @@ -80,7 +81,7 @@ Feature: Audiobooks in LYRASIS Reads When Save book play time as 'timeBehind' on audio player screen And Skip behind 30 seconds on audio player screen Then Play button is present on audio player screen - And Playback has been moved behind by 30 seconds from 'timeBehind' and 'chapterTimeKey' seconds on audio player screen + And Playback has been moved behind by 30 seconds from 'timeBehind' and 'chapterTimeKeyForBehind' seconds on audio player screen Scenarios: | distributor | @@ -91,7 +92,7 @@ Feature: Audiobooks in LYRASIS Reads @logout @returnBooks @tier1 Scenario Outline: Check end of chapter sleep timer - When Search 'available' book of distributor '' and bookType 'AUDIOBOOK' and save as 'bookNameInfo' + When Search for '' 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 @@ -112,11 +113,11 @@ Feature: Audiobooks in LYRASIS Reads Then Chapter name next to 'chapterNumber' chapter on toc audiobook screen is equal to 'nextChapter' saved chapter name Scenarios: - | distributor | - | Bibliotheca | - | Palace Marketplace | - | Axis 360 | - | BiblioBoard | + | bookName | + | The Sentence | + | Smart Brevity | + | The Beasts of Tarzan | + | Two in the Bush | @logout @returnBooks @tier1 @exclude_android Scenario Outline: Check of line for time remaining diff --git a/src/test/java/screens/CatalogScreen.java b/src/test/java/screens/CatalogScreen.java index 966ae6c..ff5a0b5 100644 --- a/src/test/java/screens/CatalogScreen.java +++ b/src/test/java/screens/CatalogScreen.java @@ -44,7 +44,7 @@ public class CatalogScreen extends Screen { 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.FrameLayout"; private static final String BOOK_NAME_LOCATOR_ANDROID = "//androidx.recyclerview.widget.RecyclerView[contains(@resource-id,\"feedLaneCoversScroll\")]/android.widget.FrameLayout"; - private static final String CURRENT_CATEGORY_LOCATOR_ANDROID = "//android.widget.TextView[contains(@resource-id, \"feedLaneTitle\") and @text=\"%1$s\"]"; + private static final String CURRENT_CATEGORY_LOCATOR_ANDROID = "//android.widget.TextView[@text=\"%s\"]"; private static final String MORE_BUTTON_LOCATOR_ANDROID = "//android.widget.LinearLayout/android.widget.TextView[@text=\"Moreā€¦\"]"; private static final String CURRENT_SECTION_LOCATOR_IN_CATALOG_ANDROID = "//androidx.recyclerview.widget.RecyclerView/android.widget.LinearLayout[%d]/android.widget.LinearLayout/android.widget.TextView[1]"; private static final String SECTION_TITLE_ANDROID = "//android.view.ViewGroup/android.widget.TextView[@text=\"%s\"]"; diff --git a/src/test/java/screens/audiobook/AudioPlayerScreen.java b/src/test/java/screens/audiobook/AudioPlayerScreen.java index de5228a..9defd69 100644 --- a/src/test/java/screens/audiobook/AudioPlayerScreen.java +++ b/src/test/java/screens/audiobook/AudioPlayerScreen.java @@ -45,7 +45,7 @@ public class AudioPlayerScreen extends Screen { new AndroidLocator(By.id("player_spine_element")), 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 AndroidLocator(By.id("player_menu_playback_rate_text")), 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")), diff --git a/src/test/java/stepdefinitions/audiobooksteps/AudioPlayerSteps.java b/src/test/java/stepdefinitions/audiobooksteps/AudioPlayerSteps.java index f643f63..91819d6 100644 --- a/src/test/java/stepdefinitions/audiobooksteps/AudioPlayerSteps.java +++ b/src/test/java/stepdefinitions/audiobooksteps/AudioPlayerSteps.java @@ -4,6 +4,7 @@ import aquality.appium.mobile.application.PlatformName; import com.google.inject.Inject; import enums.localization.catalog.TimerKeys; +import framework.utilities.ActionProcessorUtils; import framework.utilities.ScenarioContext; import io.cucumber.java.en.Then; import io.cucumber.java.en.When; @@ -140,15 +141,15 @@ public void skipBehindOnAudioPlayerScreen() { public void checkThatPlaybackHasBeenMovedBehindOnAudioPlayerScreen(long secondsBehind, String timeKey, String chapterTimeKey) { Duration savedDate = context.get(timeKey); Duration chapterTime = context.get(chapterTimeKey); - long secondsBefore = savedDate.getSeconds(); - long secondsOfChapterTime = chapterTime.getSeconds(); + long secondsOfPreviousChapter = savedDate.getSeconds(); + long currentChapterSeconds = chapterTime.getSeconds(); long actualTime = audioPlayerScreen.getLeftTime().getSeconds(); long expectedTime; - if(secondsOfChapterTime <= secondsBehind) { - expectedTime = secondsOfChapterTime - (secondsBehind - secondsBefore); + if(secondsOfPreviousChapter <= secondsBehind) { + expectedTime = currentChapterSeconds - (secondsBehind - secondsOfPreviousChapter); } else { - expectedTime = secondsBefore - secondsBehind; + expectedTime = secondsOfPreviousChapter - secondsBehind; } Assert.assertTrue("Date is not moved behind by " + secondsBehind + " seconds, Date is moved behind by ", actualTime == expectedTime || actualTime + 1 == expectedTime); @@ -196,13 +197,11 @@ public void isChapterPlaying(String chapterNameKey) { @Then("The speed by default is {string}X") public void isPlaySpeedNormal(String playbackSpeed) { - if(AqualityServices.getApplication().getPlatformName()== PlatformName.IOS) { + ActionProcessorUtils.doForIos(() -> { String speedValue = audioPlayerScreen.getPlaySpeedValue(); Assert.assertTrue("Play speed is not default: " + playbackSpeed, speedValue.contains(playbackSpeed)); - } - else { - Assert.assertEquals("Play speed is not default", "1.0x", audioPlayerScreen.getPlaySpeedValue()); - } + }); + ActionProcessorUtils.doForAndroid(() -> Assert.assertEquals("Play speed is not default", "1.0x", audioPlayerScreen.getPlaySpeedValue())); } @When("Open playback speed on audio player screen") @@ -212,11 +211,8 @@ public void openPlaybackSpeed() { @Then("Sleep timer is set to endOfChapter on audio player screen") public void checkThatSleepTimerIsSetToEndOfChapterOnAudioPLayerScreen() { - if (AqualityServices.getApplication().getPlatformName() == PlatformName.ANDROID) { - Assert.assertTrue("Timer value is not correct", audioPlayerScreen.isTimerSetTo(TimerKeys.END_OF_CHAPTER)); - } else if (AqualityServices.getApplication().getPlatformName() == PlatformName.IOS) { - Assert.assertTrue("Timer value is not correct", audioPlayerScreen.isTimerEqualTo(audioPlayerScreen.getRightTime())); - } + ActionProcessorUtils.doForAndroid(() -> Assert.assertTrue("Timer value is not correct", audioPlayerScreen.isTimerSetTo(TimerKeys.END_OF_CHAPTER))); + ActionProcessorUtils.doForIos(() -> Assert.assertTrue("Timer value is not correct", audioPlayerScreen.isTimerEqualTo(audioPlayerScreen.getRightTime()))); } @When("Open sleep timer on audio player screen") From 6ee7d098d06d0e857860c50175ba1c55bdb6e021 Mon Sep 17 00:00:00 2001 From: AEkaterina Date: Wed, 24 Jan 2024 09:31:07 +0400 Subject: [PATCH 3/4] updated reservations feature file --- src/test/java/features/Reservations.feature | 56 ++++++++++----------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/test/java/features/Reservations.feature b/src/test/java/features/Reservations.feature index 84a1935..767ea29 100644 --- a/src/test/java/features/Reservations.feature +++ b/src/test/java/features/Reservations.feature @@ -13,11 +13,11 @@ Feature: Reservation of book in LYRASIS When Activate sync bookmarks on Sign in screen And Open Catalog And Open search modal - And Search for "Peter Pan" and save bookName as "bookNameInfo" - And Switch to 'Audiobooks' catalog tab - And Click RESERVE action button on AUDIOBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' - And Click REMOVE action button on AUDIOBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' - Then AUDIOBOOK book with RESERVE action button and 'bookInfo' bookInfo is present on Catalog books screen + And Search 'unavailable' book of distributor 'Bibliotheca' and bookType 'EBOOK' and save as 'bookNameInfo' + And Switch to 'eBooks' catalog tab + And Click RESERVE action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' + And Click REMOVE action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' + Then EBOOK book with RESERVE action button and 'bookInfo' bookInfo is present on Catalog books screen @logout @returnBooks @tier1 Scenario: Reserve from Book Detail View and and Remove a Reserved Book from Reservations @@ -32,19 +32,19 @@ Feature: Reservation of book in LYRASIS When Activate sync bookmarks on Sign in screen And Open Catalog And Open search modal - And Search for "Ladies' Night" and save bookName as "bookNameInfo" - And Switch to 'Audiobooks' catalog tab + And Search 'unavailable' book of distributor 'Palace Marketplace' and bookType 'EBOOK' and save as 'bookNameInfo' + And Switch to 'eBooks' catalog tab Then Subcategory screen is opened - When Open AUDIOBOOK book with RESERVE action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' + When Open EBOOK book with RESERVE action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then Book 'bookInfo' is opened on book details screen When Click RESERVE action button on Book details screen And Open Reservations - Then AUDIOBOOK book with REMOVE action button and 'bookInfo' bookInfo is present on Reservations screen - When Open AUDIOBOOK book with REMOVE action button and 'bookInfo' bookInfo on Reservations screen + Then EBOOK book with REMOVE action button and 'bookInfo' bookInfo is present on Reservations screen + When Open EBOOK book with REMOVE action button and 'bookInfo' bookInfo on Reservations screen And Click REMOVE action button on Book details screen And Open Reservations And Wait for 7 seconds - Then AUDIOBOOK book with REMOVE action button and 'bookInfo' bookInfo is not present on Reservations screen + Then EBOOK book with REMOVE action button and 'bookInfo' bookInfo is not present on Reservations screen @logout @returnBooks @tier1 Scenario: Reserve from Book Detail View and Remove a Reserved Book from Book Detail View @@ -59,10 +59,10 @@ Feature: Reservation of book in LYRASIS When Activate sync bookmarks on Sign in screen And Open Catalog And Open search modal - And Search for "The 9/11 Commission Report" and save bookName as "bookNameInfo" - And Switch to 'Audiobooks' catalog tab + And Search 'unavailable' book of distributor 'Palace Marketplace' and bookType 'EBOOK' and save as 'bookNameInfo' + And Switch to 'eBooks' catalog tab Then Subcategory screen is opened - When Open AUDIOBOOK book with RESERVE action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' + When Open EBOOK book with RESERVE action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then Book 'bookInfo' is opened on book details screen When Click RESERVE action button on Book details screen And Click REMOVE action button on Book details screen @@ -81,16 +81,16 @@ Feature: Reservation of book in LYRASIS When Activate sync bookmarks on Sign in screen And Open Catalog And Open search modal - And Search for "The Secret Garden" and save bookName as 'bookNameInfo' - And Switch to 'Audiobooks' catalog tab - And Open AUDIOBOOK book with RESERVE action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' + And Search 'unavailable' book of distributor 'Axis 360' and bookType 'EBOOK' and save as 'bookNameInfo' + And Switch to 'eBooks' catalog tab + And Open EBOOK book with RESERVE action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' Then Book 'bookInfo' is opened on book details screen When Click RESERVE action button on Book details screen Then Check that book contains REMOVE action button on Book details screen When Click REMOVE action button on book details screen and click CANCEL action button on alert. Only for ios Then Check that book contains REMOVE action button on Book details screen When Open Reservations - Then AUDIOBOOK book with REMOVE action button and 'bookInfo' bookInfo is present on Reservations screen + Then EBOOK book with REMOVE action button and 'bookInfo' bookInfo is present on Reservations screen @logout @returnBooks @tier1 @exclude_ios Scenario: Check books sorting in Reservations @@ -105,15 +105,15 @@ Feature: Reservation of book in LYRASIS When Activate sync bookmarks on Sign in screen And Open Catalog And Open search modal - And Search for "Wwii Airmen" and save bookName as 'bookNameInfo' + And Search 'unavailable' book of distributor 'Axis 360' and bookType 'AUDIOBOOK' and save as 'bookNameInfo' And Click RESERVE action button on AUDIOBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' And Open Catalog And Open search modal - And Search for "The Secret Garden" and save bookName as 'bookNameInfo' + And Search 'unavailable' book of distributor 'Palace Marketplace' and bookType 'AUDIOBOOK' and save as 'bookNameInfo' And Click RESERVE action button on AUDIOBOOK book with 'bookNameInfo2' bookName on Catalog books screen and save book as 'bookInfo2' And Clear search field on Catalog books screen - And Search for "Peter Pan" and save bookName as 'bookNameInfo' - And Click RESERVE action button on EBOOK book with 'bookNameInfo3' bookName on Catalog books screen and save book as 'bookInfo3' + And Search 'unavailable' book of distributor 'Bibliotheca' and bookType 'AUDIOBOOK' and save as 'bookNameInfo' + And Click RESERVE action button on AUDIOBOOK book with 'bookNameInfo3' bookName on Catalog books screen and save book as 'bookInfo3' And Open Reservations Then Books are sorted by Title by default on Reservations screen And Books are sorted by Title ascending on Reservations screen @@ -133,16 +133,16 @@ Feature: Reservation of book in LYRASIS Then Login is performed successfully When Open Catalog And Open search modal - And Search for "Wwii Airmen" and save bookName as 'bookNameInfo' - And Switch to 'Audiobooks' catalog tab - And Open AUDIOBOOK book with RESERVE action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' + And Search 'unavailable' book of distributor 'Bibliotheca' and bookType 'EBOOK' and save as 'bookNameInfo' + And Switch to 'eBooks' catalog tab + And Open EBOOK book with RESERVE action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' And Click RESERVE action button on Book details screen And Open Reservations - Then AUDIOBOOK book with REMOVE action button and 'bookInfo' bookInfo is present on Reservations screen - When Open AUDIOBOOK book with REMOVE action button and 'bookInfo' bookInfo on Reservations screen + Then EBOOK book with REMOVE action button and 'bookInfo' bookInfo is present on Reservations screen + When Open EBOOK book with REMOVE action button and 'bookInfo' bookInfo on Reservations screen And Click REMOVE button but cancel the action by clicking CANCEL button on the alert And Open Reservations - Then AUDIOBOOK book with REMOVE action button and 'bookInfo' bookInfo is present on Reservations screen + Then EBOOK book with REMOVE action button and 'bookInfo' bookInfo is present on Reservations screen @smoke @logout @returnBooks Scenario: Reservations: Perform check of book appearance and remove it From 6082e1ec1db24527518adcab83aa8eec35b2995e Mon Sep 17 00:00:00 2001 From: AEkaterina Date: Wed, 24 Jan 2024 23:29:53 +0400 Subject: [PATCH 4/4] updated pdf tests --- .../java/features/PdfLyrasisAndroid.feature | 50 ++++++++-------- src/test/java/features/PdfLyrasisIos.feature | 38 ++++++------ .../java/features/PdfPalaceAndroid.feature | 58 +++++++++--------- src/test/java/features/PdfPalaceIos.feature | 36 +++++------ .../java/screens/pdf/ReaderPdfScreen.java | 23 +++++-- src/test/java/stepdefinitions/PdfSteps.java | 60 +++++++++---------- 6 files changed, 140 insertions(+), 125 deletions(-) diff --git a/src/test/java/features/PdfLyrasisAndroid.feature b/src/test/java/features/PdfLyrasisAndroid.feature index 816fb8d..403bbca 100644 --- a/src/test/java/features/PdfLyrasisAndroid.feature +++ b/src/test/java/features/PdfLyrasisAndroid.feature @@ -36,11 +36,11 @@ Feature: Read PDF in LYRASIS Reads on Android When Save the number of the last page as 'lastPageInfo' on pdf reader screen And Open pdf settings screen on pdf reader screen When Tap Go to last page button on pdf settings screen - Then Page number is equal to 'lastPageInfo' on pdf reader screen + Then Page number is equal to 'lastPageInfo' on pdf reader screen in "LYRASIS Reads" When Open pdf settings screen on pdf reader screen Then PDF settings screen is opened When Tap Go to first page button on pdf settings screen - Then The first page is opened on pdf reader screen + Then The first page is opened on pdf reader screen in "LYRASIS Reads" @logout @returnBooks @tier1 @exclude_ios Scenario: Settings: Check of Vertical scrolling in Lyrasis @@ -57,12 +57,12 @@ Feature: Read PDF in LYRASIS Reads on Android Then Vertical scrolling is chosen on settings screen And Spreads options are available on settings screen When Open pdf settings screen on pdf reader screen - And Save page number as 'pageInfo' on pdf reader screen + And Save page number as 'pageInfo' on pdf reader screen in "LYRASIS Reads" And Scroll page down on pdf reader screen - Then Page number is not equal to 'pageInfo' on pdf reader screen - When Save page number as 'pageInfo2' on pdf reader screen + Then Page number is not equal to 'pageInfo' on pdf reader screen in "LYRASIS Reads" + When Save page number as 'pageInfo2' on pdf reader screen in "LYRASIS Reads" And Scroll page up on pdf reader screen - Then Page number is not equal to 'pageInfo2' on pdf reader screen + Then Page number is not equal to 'pageInfo2' on pdf reader screen in "LYRASIS Reads" @logout @returnBooks @tier1 @exclude_ios Scenario: Settings: Check of Horizontal scrolling in Lyrasis @@ -79,12 +79,12 @@ Feature: Read PDF in LYRASIS Reads on Android Then Horizontal scrolling is chosen on settings screen And Spreads options are not available on settings screen When Open pdf settings screen on pdf reader screen - And Save page number as 'pageInfo' on pdf reader screen + And Save page number as 'pageInfo' on pdf reader screen in "LYRASIS Reads" And Go to next page on reader pdf screen - Then Page number is not equal to 'pageInfo' on pdf reader screen - When Save page number as 'pageInfo2' on pdf reader screen + Then Page number is not equal to 'pageInfo' on pdf reader screen in "LYRASIS Reads" + When Save page number as 'pageInfo2' on pdf reader screen in "LYRASIS Reads" And Go to previous page on reader pdf screen - Then Page number is not equal to 'pageInfo2' on pdf reader screen + Then Page number is not equal to 'pageInfo2' on pdf reader screen in "LYRASIS Reads" @logout @returnBooks @tier1 @exclude_ios Scenario: Settings: Check of Wrapped scrolling in Lyrasis @@ -101,12 +101,12 @@ Feature: Read PDF in LYRASIS Reads on Android Then Wrapped scrolling is chosen on settings screen And Spreads options are available on settings screen When Open pdf settings screen on pdf reader screen - And Save page number as 'pageInfo' on pdf reader screen + And Save page number as 'pageInfo' on pdf reader screen in "LYRASIS Reads" And Go to next page on reader pdf screen - Then Page number is not equal to 'pageInfo' on pdf reader screen - When Save page number as 'pageInfo2' on pdf reader screen + Then Page number is not equal to 'pageInfo' on pdf reader screen in "LYRASIS Reads" + When Save page number as 'pageInfo2' on pdf reader screen in "LYRASIS Reads" And Go to previous page on reader pdf screen - Then Page number is not equal to 'pageInfo2' on pdf reader screen + Then Page number is not equal to 'pageInfo2' on pdf reader screen in "LYRASIS Reads" @ignore @logout @returnBooks @tier1 @exclude_ios Scenario: Open book to last page read in Lyrasis @@ -118,18 +118,18 @@ Feature: Read PDF in LYRASIS Reads on Android And Click READ action button on Book details screen Then Reader pdf screen is opened When Swipe pdf page down from 7 to 10 times on reader pdf screen - And Save page number as 'pageNumber' on pdf reader screen + And Save page number as 'pageNumber' on pdf reader screen in "LYRASIS Reads" And Return to previous screen for epub and pdf And Click READ action button on Book details screen Then Reader pdf screen is opened - And Page number is equal to 'pageNumber' on pdf reader screen + And Page number is equal to 'pageNumber' on pdf reader screen in "LYRASIS Reads" When Restart app And Open Books Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on books screen When Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen And Click READ action button on Book details screen Then Reader pdf screen is opened - And Page number is equal to 'pageNumber' on pdf reader screen + And Page number is equal to 'pageNumber' on pdf reader screen in "LYRASIS Reads" @smoke @logout @returnBooks @exclude_ios Scenario: Android: Read pdfs: Table of contents: Perform check of navigation of TOC button @@ -176,12 +176,12 @@ Feature: Read PDF in LYRASIS Reads on Android Then Vertical scrolling is chosen by default on settings screen When Open pdf settings screen on pdf reader screen And Scroll page down on pdf reader screen - And Save page number as 'pageInfo' on pdf reader screen + And Save page number as 'pageInfo' on pdf reader screen in "LYRASIS Reads" And Scroll page down on pdf reader screen - Then Page number is not equal to 'pageInfo' on pdf reader screen - When Save page number as 'pageInfo2' on pdf reader screen + Then Page number is not equal to 'pageInfo' on pdf reader screen in "LYRASIS Reads" + When Save page number as 'pageInfo2' on pdf reader screen in "LYRASIS Reads" And Scroll page up on pdf reader screen - Then Page number is not equal to 'pageInfo2' on pdf reader screen + Then Page number is not equal to 'pageInfo2' on pdf reader screen in "LYRASIS Reads" @smoke @logout @returnBooks @exclude_ios Scenario: Android: Read pdfs: Table of contents: Perform check of navigation @@ -223,9 +223,9 @@ Feature: Read PDF in LYRASIS Reads on Android When Open TOC on pdf reader screen And Open content with thumbnails on pdf toc screen Then Thumbnails of the book pages are displayed - When Open random thumbnail and save the number as 'pageInfo' on pdf toc screen + When Open random thumbnail and save the number as 'pageInfo' on pdf toc screen in "LYRASIS Reads" And Return to pdf reader screen from pdf toc screen - Then Page number is equal to 'pageInfo' on pdf reader screen + Then Page number is equal to 'pageInfo' on pdf reader screen in "LYRASIS Reads" @smoke @logout @returnBooks @exclude_ios Scenario: Android: Read pdfs: Table of contents: Chapter content: Perform check of navigation @@ -239,6 +239,6 @@ Feature: Read PDF in LYRASIS Reads on Android When Open TOC on pdf reader screen And Open text chapter content on pdf toc screen Then Text chapter content is opened on pdf toc screen - When Open random chapter and save the number as 'pageInfo' on pdf toc screen + When Open random chapter and save the number as 'pageInfo' on pdf toc screen in "LYRASIS Reads" And Return to pdf reader screen from pdf toc screen - Then Page number is equal to 'pageInfo' on pdf reader screen \ No newline at end of file + Then Page number is equal to 'pageInfo' on pdf reader screen in "LYRASIS Reads" \ No newline at end of file diff --git a/src/test/java/features/PdfLyrasisIos.feature b/src/test/java/features/PdfLyrasisIos.feature index c5513de..c7d20f6 100644 --- a/src/test/java/features/PdfLyrasisIos.feature +++ b/src/test/java/features/PdfLyrasisIos.feature @@ -23,18 +23,18 @@ Feature: Read PDF in LYRARIS Reads on IOS And Click READ action button on Book details screen Then Reader pdf screen is opened When Swipe pdf page forward from 4 to 6 times on reader pdf screen - And Save page number as 'pageNumber' on pdf reader screen + And Save page number as 'pageNumber' on pdf reader screen in "LYRASIS Reads" And Return to previous screen for epub and pdf And Click READ action button on Book details screen Then Reader pdf screen is opened - And Page number is equal to 'pageNumber' on pdf reader screen + And Page number is equal to 'pageNumber' on pdf reader screen in "LYRASIS Reads" And Restart app And Open Books Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on books screen When Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen And Click READ action button on Book details screen Then Reader pdf screen is opened - And Page number is equal to 'pageNumber' on pdf reader screen + And Page number is equal to 'pageNumber' on pdf reader screen in "LYRASIS Reads" # @logout @returnBooks @tier1 @exclude_android # Scenario: Search Pdf Functionality Lyrasis @@ -71,12 +71,12 @@ Feature: Read PDF in LYRARIS Reads on IOS When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' And Click READ action button on Book details screen Then Reader pdf screen is opened - When Save page number as 'pageNumber' on pdf reader screen + When Save page number as 'pageNumber' on pdf reader screen in "LYRASIS Reads" And Slide page slider RIGHT on reader pdf screen - Then The 'pageNumber' saved page number is less than the current page number on the reader pdf screen - When Save page number as 'pageNumber' on pdf reader screen + Then The 'pageNumber' saved page number is less than the current page number on the reader pdf screen in "LYRASIS Reads" + When Save page number as 'pageNumber' on pdf reader screen in "LYRASIS Reads" And Slide page slider LEFT on reader pdf screen - Then The 'pageNumber' saved page number is greater than the current page number on the reader pdf screen + Then The 'pageNumber' saved page number is greater than the current page number on the reader pdf screen in "LYRASIS Reads" @logout @returnBooks @tier1 @exclude_android Scenario: Bookmarks Functionality Lyrasis @@ -95,10 +95,10 @@ Feature: Read PDF in LYRARIS Reads on IOS And Go to next page on reader pdf screen And Add bookmark on reader pdf screen # Then Bookmark is displayed on reader pdf screen - And Save page number as 'pageNumberInfo' on pdf reader screen + And Save page number as 'pageNumberInfo' on pdf reader screen in "LYRASIS Reads" And Go to next page on reader pdf screen And Add bookmark on reader pdf screen - And Save page number as 'pageNumberInfo2' on pdf reader screen + And Save page number as 'pageNumberInfo2' on pdf reader screen in "LYRASIS Reads" And Go to next page on reader pdf screen And Add bookmark on reader pdf screen # And Delete bookmark on reader pdf screen @@ -106,7 +106,7 @@ Feature: Read PDF in LYRARIS Reads on IOS And Open bookmarks pdf screen Then Amount of bookmarks is 2 on bookmarks pdf screen When Open the 0 bookmark on bookmarks pdf screen - Then Page number is equal to 'pageNumberInfo' on pdf reader screen + Then Page number is equal to 'pageNumberInfo' on pdf reader screen in "LYRASIS Reads" @logout @returnBooks @tier1 @exclude_android Scenario Outline: Check invalid data in searching Lyrasis @@ -161,12 +161,12 @@ Feature: Read PDF in LYRARIS Reads on IOS When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' And Click READ action button on Book details screen Then Reader pdf screen is opened - When Save page number as 'pageInfo' on pdf reader screen + When Save page number as 'pageInfo' on pdf reader screen in "LYRASIS Reads" And Go to next page on reader pdf screen - Then Page number increased by 1 from 'pageInfo' on pdf reader screen - When Save page number as 'pageInfo2' on pdf reader screen + Then Page number increased by 1 from 'pageInfo' on pdf reader screen in "LYRASIS Reads" + When Save page number as 'pageInfo2' on pdf reader screen in "LYRASIS Reads" And Go to previous page on reader pdf screen - Then Page number decreased by 1 from 'pageInfo2' on pdf reader screen + Then Page number decreased by 1 from 'pageInfo2' on pdf reader screen in "LYRASIS Reads" @smoke @logout @returnBooks @exclude_android Scenario: iOS: Read pdfs: Search: Perform check that the field allows you to enter characters and delete them @@ -195,7 +195,7 @@ Feature: Read PDF in LYRARIS Reads on IOS When Open search pdf screen And Enter 'try' text on search pdf screen And Open random found text and save page number as 'pageNumber' on search pdf screen - Then Page number is equal to 'pageNumber' on pdf reader screen + Then Page number is equal to 'pageNumber' on pdf reader screen in "LYRASIS Reads" @smoke @logout @returnBooks @exclude_android Scenario: iOS: Read pdfs: Table of contents: Perform check of navigation @@ -237,9 +237,9 @@ Feature: Read PDF in LYRARIS Reads on IOS When Open TOC on pdf reader screen And Open content with thumbnails on pdf toc screen Then Thumbnails of the book pages are displayed - When Open random thumbnail and save the number as 'pageInfo' on pdf toc screen + When Open random thumbnail and save the number as 'pageInfo' on pdf toc screen in "LYRASIS Reads" And Return to pdf reader screen from pdf toc screen - Then Page number is equal to 'pageInfo' on pdf reader screen + Then Page number is equal to 'pageInfo' on pdf reader screen in "LYRASIS Reads" @smoke @logout @returnBooks @exclude_android Scenario: iOS: Read pdfs: Table of contents: Chapter content: Perform check of navigation @@ -253,6 +253,6 @@ Feature: Read PDF in LYRARIS Reads on IOS When Open TOC on pdf reader screen And Open text chapter content on pdf toc screen Then Text chapter content is opened on pdf toc screen - When Open random chapter and save the number as 'pageInfo' on pdf toc screen + When Open random chapter and save the number as 'pageInfo' on pdf toc screen in "LYRASIS Reads" And Return to pdf reader screen from pdf toc screen - Then Page number is equal to 'pageInfo' on pdf reader screen \ No newline at end of file + Then Page number is equal to 'pageInfo' on pdf reader screen in "LYRASIS Reads" \ No newline at end of file diff --git a/src/test/java/features/PdfPalaceAndroid.feature b/src/test/java/features/PdfPalaceAndroid.feature index 7eb4ddb..3c4b87e 100644 --- a/src/test/java/features/PdfPalaceAndroid.feature +++ b/src/test/java/features/PdfPalaceAndroid.feature @@ -48,9 +48,9 @@ Feature: Read PDF in Palace Bookshelf on Android Then Reader pdf screen is opened When Open content with thumbnails on pdf toc screen Then Thumbnails of the book pages are displayed - When Open random thumbnail and save the number as 'pageInfo' on pdf toc screen + When Open random thumbnail and save the number as 'pageInfo' on pdf toc screen in "Palace Bookshelf" And Return to pdf reader screen from pdf toc screen - Then Page number is equal to 'pageInfo' on pdf reader screen + Then Page number is equal to 'pageInfo' on pdf reader screen in "Palace Bookshelf" @tier2 @exclude_ios Scenario: TOC: Contents with text: Check of list of chapters and navigation Palace @@ -61,9 +61,9 @@ Feature: Read PDF in Palace Bookshelf on Android Then Reader pdf screen is opened When Open text chapter content on pdf toc screen Then Text chapter content is opened on pdf toc screen - When Open random chapter and save the number as 'pageInfo' on pdf toc screen + When Open random chapter and save the number as 'pageInfo' on pdf toc screen in "Palace Bookshelf" And Return to pdf reader screen from pdf toc screen - Then Page number is equal to 'pageInfo' on pdf reader screen + Then Page number is equal to 'pageInfo' on pdf reader screen in "Palace Bookshelf" @tier2 @exclude_ios Scenario: Check of settings screen and page navigation Palace @@ -77,11 +77,11 @@ Feature: Read PDF in Palace Bookshelf on Android Then PDF settings screen is opened And Vertical scrolling is chosen by default on settings screen When Tap Go to last page button on pdf settings screen - Then Page number is equal to 'lastPageInfo' on pdf reader screen + Then Page number is equal to 'lastPageInfo' on pdf reader screen in "Palace Bookshelf" When Open pdf settings screen on pdf reader screen Then PDF settings screen is opened When Tap Go to first page button on pdf settings screen - Then The first page is opened on pdf reader screen + Then The first page is opened on pdf reader screen in "Palace Bookshelf" @tier2 @exclude_ios Scenario: Settings: Check of Vertical scrolling Palace @@ -90,18 +90,19 @@ Feature: Read PDF in Palace Bookshelf on Android When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' And Click READ action button on Book details screen Then Reader pdf screen is opened - When Open pdf settings screen on pdf reader screen + When Return to pdf reader screen from pdf toc screen + And Open pdf settings screen on pdf reader screen And Tap Vertical scrolling on pdf settings screen And Open pdf settings screen on pdf reader screen Then Vertical scrolling is chosen on settings screen And Spreads options are available on settings screen When Open pdf settings screen on pdf reader screen - And Save page number as 'pageInfo' on pdf reader screen + And Save page number as 'pageInfo' on pdf reader screen in "Palace Bookshelf" And Scroll page down on pdf reader screen - Then Page number is not equal to 'pageInfo' on pdf reader screen - When Save page number as 'pageInfo2' on pdf reader screen + Then Page number is not equal to 'pageInfo' on pdf reader screen in "Palace Bookshelf" + When Save page number as 'pageInfo2' on pdf reader screen in "Palace Bookshelf" And Scroll page up on pdf reader screen - Then Page number is not equal to 'pageInfo2' on pdf reader screen + Then Page number is not equal to 'pageInfo2' on pdf reader screen in "Palace Bookshelf" @tier2 @exclude_ios Scenario: Settings: Check of Horizontal scrolling Palace @@ -110,18 +111,19 @@ Feature: Read PDF in Palace Bookshelf on Android When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' And Click READ action button on Book details screen Then Reader pdf screen is opened - When Open pdf settings screen on pdf reader screen + When Return to pdf reader screen from pdf toc screen + And Open pdf settings screen on pdf reader screen And Tap Horizontal scrolling on pdf settings screen And Open pdf settings screen on pdf reader screen Then Horizontal scrolling is chosen on settings screen And Spreads options are not available on settings screen When Open pdf settings screen on pdf reader screen - And Save page number as 'pageInfo' on pdf reader screen + And Save page number as 'pageInfo' on pdf reader screen in "Palace Bookshelf" And Go to next page on reader pdf screen - Then Page number is not equal to 'pageInfo' on pdf reader screen - When Save page number as 'pageInfo2' on pdf reader screen + Then Page number is not equal to 'pageInfo' on pdf reader screen in "Palace Bookshelf" + When Save page number as 'pageInfo2' on pdf reader screen in "Palace Bookshelf" And Go to previous page on reader pdf screen - Then Page number is not equal to 'pageInfo2' on pdf reader screen + Then Page number is not equal to 'pageInfo2' on pdf reader screen in "Palace Bookshelf" @tier2 @exclude_ios Scenario: Settings: Check of Wrapped scrolling Palace @@ -130,18 +132,19 @@ Feature: Read PDF in Palace Bookshelf on Android When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' And Click READ action button on Book details screen Then Reader pdf screen is opened - When Open pdf settings screen on pdf reader screen + When Return to pdf reader screen from pdf toc screen + And Open pdf settings screen on pdf reader screen And Tap Wrapped scrolling on pdf settings screen And Open pdf settings screen on pdf reader screen Then Wrapped scrolling is chosen on settings screen And Spreads options are available on settings screen When Open pdf settings screen on pdf reader screen - And Save page number as 'pageInfo' on pdf reader screen - And Go to next page on reader pdf screen - Then Page number is not equal to 'pageInfo' on pdf reader screen - When Save page number as 'pageInfo2' on pdf reader screen - And Go to previous page on reader pdf screen - Then Page number is not equal to 'pageInfo2' on pdf reader screen + And Save page number as 'pageInfo' on pdf reader screen in "Palace Bookshelf" + And Scroll page down on pdf reader screen + Then Page number is not equal to 'pageInfo' on pdf reader screen in "Palace Bookshelf" + When Save page number as 'pageInfo2' on pdf reader screen in "Palace Bookshelf" + And Scroll page up on pdf reader screen + Then Page number is not equal to 'pageInfo2' on pdf reader screen in "Palace Bookshelf" @tier2 @exclude_ios Scenario: Open book to last page read Palace @@ -150,16 +153,17 @@ Feature: Read PDF in Palace Bookshelf on Android When Open EBOOK book with READ action button and 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' And Click READ action button on Book details screen Then Reader pdf screen is opened - When Swipe pdf page down from 10 to 20 times on reader pdf screen - And Save page number as 'pageNumber' on pdf reader screen + When Return to pdf reader screen from pdf toc screen + And Swipe pdf page down from 10 to 20 times on reader pdf screen + And Save page number as 'pageNumber' on pdf reader screen in "Palace Bookshelf" And Return to previous screen for epub and pdf And Click READ action button on Book details screen Then Reader pdf screen is opened - And Page number is equal to 'pageNumber' on pdf reader screen + And Page number is equal to 'pageNumber' on pdf reader screen in "Palace Bookshelf" When Restart app And Open Books Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on books screen When Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen And Click READ action button on Book details screen Then Reader pdf screen is opened - And Page number is equal to 'pageNumber' on pdf reader screen \ No newline at end of file + And Page number is equal to 'pageNumber' on pdf reader screen in "Palace Bookshelf" \ No newline at end of file diff --git a/src/test/java/features/PdfPalaceIos.feature b/src/test/java/features/PdfPalaceIos.feature index 4192030..f29218a 100644 --- a/src/test/java/features/PdfPalaceIos.feature +++ b/src/test/java/features/PdfPalaceIos.feature @@ -18,35 +18,35 @@ Feature: Read PDF in Palace Bookshelf on IOS @tier2 @exclude_android Scenario: Navigate by Page - Then Save page number as 'pageInfo' on pdf reader screen + Then Save page number as 'pageInfo' on pdf reader screen in "LYRASIS Reads" When Go to next page on reader pdf screen - Then Page number increased by 1 from 'pageInfo' on pdf reader screen - When Save page number as 'pageInfo2' on pdf reader screen + Then Page number increased by 1 from 'pageInfo' on pdf reader screen in "LYRASIS Reads" + When Save page number as 'pageInfo2' on pdf reader screen in "LYRASIS Reads" And Go to previous page on reader pdf screen - Then Page number decreased by 1 from 'pageInfo2' on pdf reader screen + Then Page number decreased by 1 from 'pageInfo2' on pdf reader screen in "LYRASIS Reads" @tier2 @exclude_android Scenario: Open book to last page read When Swipe pdf page forward from 4 to 6 times on reader pdf screen - And Save page number as 'pageNumber' on pdf reader screen + And Save page number as 'pageNumber' on pdf reader screen in "LYRASIS Reads" And Return to previous screen for epub and pdf And Click READ action button on Book details screen Then Reader pdf screen is opened - And Page number is equal to 'pageNumber' on pdf reader screen + And Page number is equal to 'pageNumber' on pdf reader screen in "LYRASIS Reads" When Restart app And Open Books Then EBOOK book with READ action button and 'bookInfo' bookInfo is present on books screen When Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen And Click READ action button on Book details screen Then Reader pdf screen is opened - And Page number is equal to 'pageNumber' on pdf reader screen + And Page number is equal to 'pageNumber' on pdf reader screen in "LYRASIS Reads" @tier2 @exclude_android Scenario: Navigate by Thumbnails When Open TOC on pdf reader screen Then There are content list with thumbnails and chapter content on pdf toc screen When Open 2 thumbnail and save the number as 'pageInfo' on pdf toc screen - Then Page number is equal to 'pageInfo' on pdf reader screen + Then Page number is equal to 'pageInfo' on pdf reader screen in "LYRASIS Reads" @tier2 @exclude_android Scenario: Search Pdf Functionality @@ -68,17 +68,17 @@ Feature: Read PDF in Palace Bookshelf on IOS When Open search pdf screen And Search for 'try' text on search pdf screen And Open random found text and save page number as 'pageNumber' on search pdf screen - Then Page number is equal to 'pageNumber' on pdf reader screen + Then Page number is equal to 'pageNumber' on pdf reader screen in "LYRASIS Reads" @tier2 @exclude_android Scenario: Navigate by Page slider When Swipe pdf page forward from 4 to 6 times on reader pdf screen - And Save page number as 'pageNumber' on pdf reader screen + And Save page number as 'pageNumber' on pdf reader screen in "LYRASIS Reads" And Slide page slider LEFT on reader pdf screen - Then The 'pageNumber' saved page number is less than the current page number on the reader pdf screen - When Save page number as 'pageNumber' on pdf reader screen + Then The 'pageNumber' saved page number is less than the current page number on the reader pdf screen in "LYRASIS Reads" + When Save page number as 'pageNumber' on pdf reader screen in "LYRASIS Reads" And Slide page slider RIGHT on reader pdf screen - Then The 'pageNumber' saved page number is greater than the current page number on the reader pdf screen + Then The 'pageNumber' saved page number is greater than the current page number on the reader pdf screen in "LYRASIS Reads" @tier2 @exclude_android Scenario: Navigate by pdf bookmarks @@ -89,10 +89,10 @@ Feature: Read PDF in Palace Bookshelf on IOS And Go to next page on reader pdf screen And Add bookmark on reader pdf screen # Then Bookmark is displayed on reader pdf screen - And Save page number as 'pageNumberInfo' on pdf reader screen + And Save page number as 'pageNumberInfo' on pdf reader screen in "LYRASIS Reads" And Go to next page on reader pdf screen And Add bookmark on reader pdf screen - And Save page number as 'pageNumberInfo2' on pdf reader screen + And Save page number as 'pageNumberInfo2' on pdf reader screen in "LYRASIS Reads" And Go to next page on reader pdf screen And Add bookmark on reader pdf screen # And Delete bookmark on reader pdf screen @@ -100,7 +100,7 @@ Feature: Read PDF in Palace Bookshelf on IOS And Open bookmarks pdf screen Then Amount of bookmarks is 2 on bookmarks pdf screen When Open the 0 bookmark on bookmarks pdf screen - Then Page number is equal to 'pageNumberInfo' on pdf reader screen + Then Page number is equal to 'pageNumberInfo' on pdf reader screen in "LYRASIS Reads" @tier2 @exclude_android Scenario: Check table of contents @@ -114,5 +114,5 @@ Feature: Read PDF in Palace Bookshelf on IOS Scenario: Navigate by Chapters When Open TOC on pdf reader screen And Open text chapter content on pdf toc screen - And Open random chapter and save the number as 'pageNumberInfo' on pdf toc screen - Then Page number is equal to 'pageNumberInfo' on pdf reader screen \ No newline at end of file + And Open random chapter and save the number as 'pageNumberInfo' on pdf toc screen in "LYRASIS Reads" + Then Page number is equal to 'pageNumberInfo' on pdf reader screen in "LYRASIS Reads" \ No newline at end of file diff --git a/src/test/java/screens/pdf/ReaderPdfScreen.java b/src/test/java/screens/pdf/ReaderPdfScreen.java index b88b4c8..8358d8b 100644 --- a/src/test/java/screens/pdf/ReaderPdfScreen.java +++ b/src/test/java/screens/pdf/ReaderPdfScreen.java @@ -26,6 +26,10 @@ public class ReaderPdfScreen extends Screen { private final ILabel lblPageNumber = getElementFactory().getLabel(LocatorUtils.getLocator( new AndroidLocator(By.xpath("//android.widget.EditText[@resource-id=\"pageNumber\"]")), new IosLocator(By.xpath("//XCUIElementTypeStaticText[contains(@value,\"/\")]"))), "Page number label"); + + private final ILabel lblPageNumberPalace = getElementFactory().getLabel(LocatorUtils.getLocator( + new AndroidLocator(By.xpath("//android.widget.TextView[@resource-id=\"numPages\"]")), + new IosLocator(By.xpath("//XCUIElementTypeStaticText[contains(@value,\"/\")]"))), "Page number in Palace Bookshelf"); private final ILabel lblBookName = getElementFactory().getLabel(LocatorUtils.getLocator( new AndroidLocator(By.xpath("//android.view.ViewGroup/android.widget.TextView")), new IosLocator(By.xpath("//XCUIElementTypeToolbar/parent::XCUIElementTypeOther/preceding-sibling::XCUIElementTypeOther[2]/XCUIElementTypeStaticText"))), "Book name"); @@ -49,7 +53,7 @@ public boolean isReaderOpened() { return lblPage.state().waitForDisplayed(); } - public int getPageNumber() { + public int getPageNumber(String libraryName) { Integer pageNumber = ActionProcessorUtils.doForIos(() -> { openNavigationBar(); String pageNumberStr = StringUtils.substringBetween(lblPageNumber.getAttribute(IosAttributes.NAME), "(", "/"); @@ -58,10 +62,17 @@ public int getPageNumber() { return Integer.parseInt(pageNumberStr); }); - if(pageNumber == null) { - pageNumber = ActionProcessorUtils.doForAndroid(() -> Integer.parseInt(StringUtils.substringBefore(lblPageNumber.getText(), ","))); + if (pageNumber == null) { + pageNumber = ActionProcessorUtils.doForAndroid(() -> { + String pageNumberStr; + if(libraryName.equals("Palace Bookshelf")) { + pageNumberStr = StringUtils.substringBetween(lblPageNumberPalace.getText(), "(", " of"); + } else { + pageNumberStr = StringUtils.substringBefore(lblPageNumber.getText(), ","); + } + return Integer.parseInt(pageNumberStr); + }); } - return pageNumber; } @@ -72,11 +83,11 @@ public void openNavigationBar() { } public void goToNextPage() { - ActionProcessorUtils.doForIos(() -> SwipeElementUtils.swipeThroughEntireElement(lblPage, EntireElementSwipeDirection.RIGHT)); + SwipeElementUtils.swipeThroughEntireElement(lblPage, EntireElementSwipeDirection.RIGHT); } public void goToPreviousPage() { - ActionProcessorUtils.doForIos(() -> SwipeElementUtils.swipeThroughEntireElement(lblPage, EntireElementSwipeDirection.LEFT)); + SwipeElementUtils.swipeThroughEntireElement(lblPage, EntireElementSwipeDirection.LEFT); } public NavigationBarPdfScreen getNavigationBarScreen() { diff --git a/src/test/java/stepdefinitions/PdfSteps.java b/src/test/java/stepdefinitions/PdfSteps.java index 1eb519a..7d17c19 100644 --- a/src/test/java/stepdefinitions/PdfSteps.java +++ b/src/test/java/stepdefinitions/PdfSteps.java @@ -36,9 +36,9 @@ public void isPdfReaderOpened() { Assert.assertTrue("PDF reader is not opened", readerPdfScreen.isReaderOpened()); } - @When("Save page number as {string} on pdf reader screen") - public void savePageNumberOnReader(String pageInfoKey){ - context.add(pageInfoKey, readerPdfScreen.getPageNumber()); + @When("Save page number as {string} on pdf reader screen in {string}") + public void savePageNumberOnReader(String pageInfoKey, String libraryName){ + context.add(pageInfoKey, readerPdfScreen.getPageNumber(libraryName)); } @When("Go to next page on reader pdf screen") @@ -46,10 +46,10 @@ public void goToNextPdfPage() { readerPdfScreen.goToNextPage(); } - @Then("Page number increased by 1 from {string} on pdf reader screen") - public void isPageNumberIncreased(String pageInfoKey) { + @Then("Page number increased by 1 from {string} on pdf reader screen in {string}") + public void isPageNumberIncreased(String pageInfoKey, String libraryName) { int numberBefore = context.get(pageInfoKey); - Assert.assertEquals("Page number has not increased", numberBefore + 1, readerPdfScreen.getPageNumber()); + Assert.assertEquals("Page number has not increased", numberBefore + 1, readerPdfScreen.getPageNumber(libraryName)); } @When("Go to previous page on reader pdf screen") @@ -57,10 +57,10 @@ public void goToPreviousPdfPage() { readerPdfScreen.goToPreviousPage(); } - @Then("Page number decreased by 1 from {string} on pdf reader screen") - public void isPageNumberDecreased(String pageInfoKey) { + @Then("Page number decreased by 1 from {string} on pdf reader screen in {string}") + public void isPageNumberDecreased(String pageInfoKey, String libraryName) { int numberBefore = context.get(pageInfoKey); - Assert.assertEquals("Page number has not decreased", numberBefore - 1, readerPdfScreen.getPageNumber()); + Assert.assertEquals("Page number has not decreased", numberBefore - 1, readerPdfScreen.getPageNumber(libraryName)); } @When("Open TOC on pdf reader screen") @@ -133,10 +133,10 @@ public void openRandomTextAndSavePageNumber(String pageNumberKey) { context.add(pageNumberKey, readerPdfScreen.getSearchPdfScreen().openRandomFoundText()); } - @Then("Page number is equal to {string} on pdf reader screen") - public void comparePageNumbers(String pageInfoKey) { + @Then("Page number is equal to {string} on pdf reader screen in {string}") + public void comparePageNumbers(String pageInfoKey, String libraryName) { int pageNumber = context.get(pageInfoKey); - Assert.assertEquals("Page number is wrong", pageNumber, readerPdfScreen.getPageNumber()); + Assert.assertEquals("Page number is wrong", pageNumber, readerPdfScreen.getPageNumber(libraryName)); } @When("Delete text in search line on search pdf screen") @@ -154,10 +154,10 @@ public void closePdfReader() { readerPdfScreen.getNavigationBarScreen().tapBackButton(); } - @When("Open random thumbnail and save the number as {string} on pdf toc screen") - public void openRandomThumbnail(String pageInfoKey) { + @When("Open random thumbnail and save the number as {string} on pdf toc screen in {string}") + public void openRandomThumbnail(String pageInfoKey, String libraryName) { tocBookmarksPdfScreen.getThumbnailsPdfScreen().openRandomThumbnail(); - context.add(pageInfoKey, readerPdfScreen.getPageNumber()); + context.add(pageInfoKey, readerPdfScreen.getPageNumber(libraryName)); } @When("Open {int} thumbnail and save the number as {string} on pdf toc screen") @@ -174,10 +174,10 @@ public void returnToReaderFromTOC() { } } - @When("Open random chapter and save the number as {string} on pdf toc screen") - public void openRandomChapter(String pageInfoKey){ + @When("Open random chapter and save the number as {string} on pdf toc screen in {string}") + public void openRandomChapter(String pageInfoKey, String libraryName){ chaptersPdfScreen.openRandomChapter(); - context.add(pageInfoKey, readerPdfScreen.getPageNumber()); + context.add(pageInfoKey, readerPdfScreen.getPageNumber(libraryName)); } @When("Open pdf settings screen on pdf reader screen") @@ -200,10 +200,10 @@ public void scrollPageDown() { readerPdfScreen.swipePageDown(); } - @Then("Page number is not equal to {string} on pdf reader screen") - public void isPageNotEqual(String pageInfoKey) { + @Then("Page number is not equal to {string} on pdf reader screen in {string}") + public void isPageNotEqual(String pageInfoKey, String libraryName) { int pageNumber = context.get(pageInfoKey); - Assert.assertNotEquals("Page number is wrong", pageNumber, readerPdfScreen.getPageNumber()); + Assert.assertNotEquals("Page number is wrong", pageNumber, readerPdfScreen.getPageNumber(libraryName)); } @When("Scroll page up on pdf reader screen") @@ -233,9 +233,9 @@ public void tapGoToFirstPage() { readerPdfScreen.getSettingsPdfScreen().tapGoToFirstPage(); } - @Then("The first page is opened on pdf reader screen") - public void isFirstPageOpened(){ - Assert.assertEquals("The first page is not opened", 1, readerPdfScreen.getPageNumber()); + @Then("The first page is opened on pdf reader screen in {string}") + public void isFirstPageOpened(String libraryName){ + Assert.assertEquals("The first page is not opened", 1, readerPdfScreen.getPageNumber(libraryName)); } @When("Tap Vertical scrolling on pdf settings screen") @@ -301,18 +301,18 @@ public void slidePdfPageSlider(EntireScreenDragDirection entireScreenDragDirecti readerPdfScreen.slidePageSlider(entireScreenDragDirection); } - @Then("The {string} saved page number is less than the current page number on the reader pdf screen") - public void checkThatSavedPdfPageNumberIsLessThanCurrentPdfPageNumber(String pageNumberKey) { + @Then("The {string} saved page number is less than the current page number on the reader pdf screen in {string}") + public void checkThatSavedPdfPageNumberIsLessThanCurrentPdfPageNumber(String pageNumberKey, String libraryName) { int savedPageNumber = context.get(pageNumberKey); - int currentPageNumber = readerPdfScreen.getPageNumber(); + int currentPageNumber = readerPdfScreen.getPageNumber(libraryName); Assert.assertTrue("Saved page number is greater that current page number on reader pdf screen. SavedPageNumber - " + savedPageNumber + ", currentPageNumber - " + currentPageNumber, savedPageNumber < currentPageNumber); } - @Then("The {string} saved page number is greater than the current page number on the reader pdf screen") - public void checkThatSavedPdfPageNumberIsGreaterThanCurrentPdfPageNumber(String pageNumberKey) { + @Then("The {string} saved page number is greater than the current page number on the reader pdf screen in {string}") + public void checkThatSavedPdfPageNumberIsGreaterThanCurrentPdfPageNumber(String pageNumberKey, String libraryName) { int savedPageNumber = context.get(pageNumberKey); - int currentPageNumber = readerPdfScreen.getPageNumber(); + int currentPageNumber = readerPdfScreen.getPageNumber(libraryName); Assert.assertTrue("Saved page number is less than current page number on reader pdf screen. SavedPageNumber - " + savedPageNumber + ", currentPageNumber - " + currentPageNumber, savedPageNumber > currentPageNumber); }