diff --git a/src/test/java/features/Distributors.feature b/src/test/java/features/Distributors.feature index 0e981d6..ed4814e 100644 --- a/src/test/java/features/Distributors.feature +++ b/src/test/java/features/Distributors.feature @@ -29,7 +29,6 @@ Feature: Distributors | Axis 360 | AUDIOBOOK | Audiobooks | | Palace Marketplace | EBOOK | eBooks | | Palace Marketplace | AUDIOBOOK | Audiobooks | - | Biblioboard | EBOOK | eBooks | @logout @returnBooks @tier2 Scenario Outline: Getting and returning books from Book Detail View in LYRASIS Reads diff --git a/src/test/java/features/EpubOverdrive.feature b/src/test/java/features/EpubOverdrive.feature index 63feb4b..0301866 100644 --- a/src/test/java/features/EpubOverdrive.feature +++ b/src/test/java/features/EpubOverdrive.feature @@ -1,4 +1,4 @@ -Feature: Read EPUB from Overdrive in A1QA +Feature: Read EPUB from Overdrive in A1QA Test Library Background: Given Close tutorial screen @@ -114,117 +114,3 @@ Feature: Read EPUB from Overdrive in A1QA When Return to previous screen for epub and pdf And Click RETURN action button on Book details screen Then Check that book contains GET action button on Book details screen - - # @logout @returnBooks @tier2 -# Scenario: Epub: Font settings: Check of increasing and reducing the text size -# When Search for "The Woman in White" and save bookName as 'bookNameInfo' -# And Click GET action button on EBOOK book with 'bookNameInfo' bookName on catalog books screen and save book as 'bookInfo' -# And 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 -# And Scroll page forward from 7 to 9 times -# And Save font size as 'fontSize' -# And Open font settings -# And INCREASE_FONT of text -# Then Font size 'fontSize' is increased -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then Font size 'fontSize' is increased -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then Font size 'fontSize' is increased -# When Save font size as 'fontSize' -# And Open font settings -# And DECREASE_FONT of text -# Then Font size 'fontSize' is decreased -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then Font size 'fontSize' is decreased -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then Font size 'fontSize' is decreased - -# @logout @returnBooks @tier2 -# Scenario: Epub: Font settings: Check of font style -# When Search for "A Game of Thrones" and save bookName as 'bookNameInfo' -# And Click GET action button on EBOOK book with 'bookNameInfo' bookName on catalog books screen and save book as 'bookInfo' -# And 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 -# And Scroll page forward from 7 to 9 times -# And Open font settings -# And Change font style to FONT_SERIF -# Then Book text displays in FONT_SERIF font -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then Book text displays in FONT_SERIF font -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then Book text displays in FONT_SERIF font -# When Open font settings -# And Change font style to FONT_SANS -# Then Book text displays in FONT_SANS font -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then Book text displays in FONT_SANS font -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then Book text displays in FONT_SANS font -# When Open font settings -# And Change font style to FONT_DYSLEXIC -# Then Book text displays in FONT_DYSLEXIC font -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then Book text displays in FONT_DYSLEXIC font -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then Book text displays in FONT_DYSLEXIC font - -# @logout @returnBooks @tier2 -# Scenario: Epub: Font settings: Check of text theme -# When Search for "The Adventures of Sherlock Holmes" and save bookName as 'bookNameInfo' -# And Click GET action button on EBOOK book with 'bookNameInfo' bookName on catalog books screen and save book as 'bookInfo' -# And 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 -# And Scroll page forward from 7 to 9 times -# And Open font settings -# When Change contrast to BLACK_TEXT_ON_WHITE -# Then The BLACK_TEXT_ON_WHITE background is correct -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then The BLACK_TEXT_ON_WHITE background is correct -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then The BLACK_TEXT_ON_WHITE background is correct -# When Open font settings -# And Change contrast to BLACK_TEXT_ON_SEPIA -# Then The BLACK_TEXT_ON_SEPIA background is correct -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then The BLACK_TEXT_ON_SEPIA background is correct -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then The BLACK_TEXT_ON_SEPIA background is correct -# When Open font settings -# And Change contrast to WHITE_TEXT_ON_BLACK -# Then The WHITE_TEXT_ON_BLACK background is correct -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then The WHITE_TEXT_ON_BLACK background is correct -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then The WHITE_TEXT_ON_BLACK background is correct \ No newline at end of file diff --git a/src/test/java/features/EpubPalace.feature b/src/test/java/features/EpubPalace.feature index eff5c17..5ba6a49 100644 --- a/src/test/java/features/EpubPalace.feature +++ b/src/test/java/features/EpubPalace.feature @@ -16,7 +16,7 @@ Feature: Read EPUB in Palace Bookshelf And 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 'bookInfo' book is present on epub reader screen - When Scroll page forward from 3 to 5 times + When Scroll page forward from 3 to 7 times And Open navigation bar on reader epub screen And Save pageNumber as 'pageNumberKey' and chapterName as 'chapterNameKey' on epub reader screen And Tap on right book corner on epub reader screen @@ -30,6 +30,7 @@ Feature: Read EPUB in Palace Bookshelf When Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' And 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 + And Scroll page forward from 3 to 5 times And Open navigation bar on reader epub screen And Add bookmark on reader epub screen And Save pageNumber as 'pageNumberKey' and chapterName as 'chapterNameKey' on epub reader screen @@ -42,8 +43,6 @@ Feature: Read EPUB in Palace Bookshelf And Open bookmarks epub screen Then Bookmark with 'chapterNameKey' and 'deviceTimeDateKey' is displayed on bookmarks epub screen And Bookmark with 'chapterNameKey2' and 'deviceTimeDateKey2' is displayed on bookmarks epub screen - When Open random bookmark and save chapter name as 'chapterNameKey3' on bookmarks epub screen - Then 'chapterNameKey3' chapter name is displayed on reader epub screen @tier2 Scenario: Delete bookmarks @@ -58,14 +57,15 @@ Feature: Read EPUB in Palace Bookshelf And Add bookmark on reader epub screen And Save pageNumber as 'pageNumberKey' and chapterName as 'chapterNameKey' on epub reader screen And Save device time and date as 'deviceTimeDateKey' + And Scroll page forward from 3 to 6 times + And Add bookmark on reader epub screen And Open navigation bar on reader epub screen And Open bookmarks epub screen And Delete bookmark on bookmarks epub screen Then Bookmark with 'chapterNameKey' and 'deviceTimeDateKey' is not displayed on bookmarks epub screen When Return to reader epub screen from toc bookmarks epub screen - And Click on left book corner on epub reader screen - Then 'chapterNameKey' chapter name is displayed on reader epub screen - And Bookmark is not displayed on reader epub screen + And Delete bookmark on reader epub screen + Then Bookmark is not displayed on reader epub screen @tier2 Scenario: Navigate by Table of Contents Menu @@ -88,116 +88,6 @@ Feature: Read EPUB in Palace Bookshelf And Open font and background settings epub screen Then Font and background settings epub screen is opened -# @tier2 @exclude_android -# Scenario: Font settings: Check of increasing and reducing the text size -# When Click GET action button on EBOOK book with 'bookNameInfo' bookName on catalog books screen and save book as 'bookInfo' -# And 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 -# And Scroll page forward from 7 to 9 times -# And Save font size as 'fontSize' -# And Open font settings -# And INCREASE_FONT of text -# Then Font size 'fontSize' is increased -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then Font size 'fontSize' is increased -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then Font size 'fontSize' is increased -# When Save font size as 'fontSize' -# And I DECREASE_FONT of text -# Then Font size 'fontSize' is decreased -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then Font size 'fontSize' is decreased -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then Font size 'fontSize' is decreased - -# @tier2 @exclude_android -# Scenario: Font settings: Check of font style -# When Click GET action button on EBOOK book with 'bookNameInfo' bookName on catalog books screen and save book as 'bookInfo' -# And 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 -# And Scroll page forward from 7 to 9 times -# And Open font settings -# And Change font style to FONT_SERIF -# Then Book text displays in FONT_SERIF font -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then Book text displays in FONT_SERIF font -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then Book text displays in FONT_SERIF font -# When Open font settings -# And Change font style to FONT_SANS -# Then Book text displays in FONT_SANS font -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then Book text displays in FONT_SANS font -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then Book text displays in FONT_SANS font -# When Open font settings -# And Change font style to FONT_DYSLEXIC -# Then Book text displays in FONT_DYSLEXIC font -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then Book text displays in FONT_DYSLEXIC font -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then Book text displays in FONT_DYSLEXIC font - -# @tier2 @exclude_android -# Scenario: Font settings: Check of text theme -# When Click GET action button on EBOOK book with 'bookNameInfo' bookName on catalog books screen and save book as 'bookInfo' -# And 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 -# And Scroll page forward from 7 to 9 times -# And Open font settings -# And Change contrast to BLACK_TEXT_ON_WHITE -# Then The BLACK_TEXT_ON_WHITE background is correct -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then The BLACK_TEXT_ON_WHITE background is correct -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then The BLACK_TEXT_ON_WHITE background is correct -# When Open font settings -# And Change contrast to BLACK_TEXT_ON_SEPIA -# Then The BLACK_TEXT_ON_SEPIA background is correct -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then The BLACK_TEXT_ON_SEPIA background is correct -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then The BLACK_TEXT_ON_SEPIA background is correct -# When Open font settings -# And Change contrast to WHITE_TEXT_ON_BLACK -# Then The WHITE_TEXT_ON_BLACK background is correct -# When Restart app -# And Open Books -# And Open EBOOK book with READ action button and 'bookInfo' bookInfo on books screen -# And Click READ action button on book details screen -# Then The WHITE_TEXT_ON_BLACK background is correct -# When Return to previous screen from epub -# And Click READ action button on book details screen -# Then The WHITE_TEXT_ON_BLACK background is correct - @tier2 Scenario: Open book to last page read When Click GET action button on EBOOK book with 'bookNameInfo' bookName on Catalog books screen and save book as 'bookInfo' diff --git a/src/test/java/screens/epub/BookmarksEpubScreen.java b/src/test/java/screens/epub/BookmarksEpubScreen.java index 157fff9..1365787 100644 --- a/src/test/java/screens/epub/BookmarksEpubScreen.java +++ b/src/test/java/screens/epub/BookmarksEpubScreen.java @@ -30,7 +30,7 @@ public class BookmarksEpubScreen extends Screen { new AndroidLocator(By.id("tocBookmarksList")), new IosLocator(By.xpath("//XCUIElementTypeTable"))), "Bookmarks tab"); private final IButton btnDelete = getElementFactory().getButton(LocatorUtils.getLocator( - new AndroidLocator(By.xpath("//android.widget.ImageView[contains(@resource-id,\"bookmarkDelete\")]")), + new AndroidLocator(By.xpath("//android.widget.Button[@text=\"Delete\"]")), new IosLocator(By.name("Delete"))), "Delete bookmark button"); private static final String BTN_DELETE_LOC_ANDROID = "//android.widget.ImageView[contains(@resource-id,\"bookmarkDelete\")]"; @@ -57,6 +57,9 @@ public boolean isBookmarkScreenOpened() { public boolean isBookmarkPresent(String expectedBookmarkTitle, String bookmarkDateTime) { LocalDateTime expectedLocalDateTime = DateUtils.getExpectedLocalDateTime(bookmarkDateTime); + if (expectedBookmarkTitle == null) { + expectedBookmarkTitle = ""; + } AqualityServices.getLogger().info("expected bookmark info: "); AqualityServices.getLogger().info("expected bookmark title-" + expectedBookmarkTitle); @@ -67,10 +70,11 @@ public boolean isBookmarkPresent(String expectedBookmarkTitle, String bookmarkDa AqualityServices.getLogger().info("expected hour-" + expectedLocalDateTime.getHour()); boolean isBookmarkPresent = false; - System.out.println("List size: " + getListOfBookmarkTitles().size()); - for (int i = 0; i < getListOfBookmarkTitles().size(); i++) { String actualBookmarkTitle = getListOfBookmarkTitles().get(i); + if(actualBookmarkTitle == null) { + actualBookmarkTitle = ""; + } LocalDateTime actualLocalDateTime = getActualLocalDateTime(getListOfBookmarkTimeDates().get(i)); AqualityServices.getLogger().info("bookmark number " + i + " info: "); AqualityServices.getLogger().info("actual bookmark title-" + actualBookmarkTitle); @@ -116,7 +120,7 @@ public void openBookmark(int bookmarkNumber) { public void deleteBookmark(int bookmarkNumber) { ActionProcessorUtils.doForAndroid(() -> { - getListOfDeleteBtns().get(bookmarkNumber).click(); + getListOfDeleteBtns().get(bookmarkNumber + 1).click(); btnDelete.click(); }); @@ -131,11 +135,6 @@ private List getListOfDeleteBtns() { return getElementFactory().findElements(By.xpath(BTN_DELETE_LOC_ANDROID), ElementType.BUTTON); } - private LocalDateTime getExpectedLocalDateTimeIos(String stringExpectedDateTime) { - DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern("y-M-dd HH:m:s"); - return LocalDateTime.parse(deleteSomeCharactersForExpectedDateTime(stringExpectedDateTime), dateTimeFormatter); - } - private String deleteSomeCharactersForExpectedDateTime(String stringExpectedDateTime) { return stringExpectedDateTime.split("\\+")[0].replace("T", " "); } @@ -150,7 +149,7 @@ private LocalDateTime getActualLocalDateTime(String stringActualDateTime) { DateTimeFormatter dateTimeFormatter = ActionProcessorUtils.doForAndroid(() -> DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); if(dateTimeFormatter == null) { - ActionProcessorUtils.doForIos(() -> DateTimeFormatter.ofPattern("dd.MM.yyyy, HH:mm")); + dateTimeFormatter = ActionProcessorUtils.doForIos(() -> DateTimeFormatter.ofPattern("dd.MM.yyyy, HH:mm")); } return LocalDateTime.parse(deleteSomeCharactersForActualDateTime(stringActualDateTime), Objects.requireNonNull(dateTimeFormatter)); } diff --git a/src/test/java/screens/epub/FontAndBackgroundSettingsEpubScreen.java b/src/test/java/screens/epub/FontAndBackgroundSettingsEpubScreen.java index 9df9386..87f3aa7 100644 --- a/src/test/java/screens/epub/FontAndBackgroundSettingsEpubScreen.java +++ b/src/test/java/screens/epub/FontAndBackgroundSettingsEpubScreen.java @@ -11,6 +11,6 @@ public class FontAndBackgroundSettingsEpubScreen extends Screen { public FontAndBackgroundSettingsEpubScreen() { super(LocatorUtils.getLocator( new AndroidLocator(By.xpath("//android.widget.FrameLayout[contains(@resource-id,\"custom\")]")), - new IosLocator(By.xpath("//XCUIElementTypeButton[@name=\"Sans font\"]"))), "Font and Background settings screen"); + new IosLocator(By.xpath("//XCUIElementTypeButton[@name=\"Font selector: Sans font\"]"))), "Font and Background settings screen"); } } diff --git a/src/test/java/screens/epub/NavigationBarScreen.java b/src/test/java/screens/epub/NavigationBarScreen.java index c6dc336..9a2bf28 100644 --- a/src/test/java/screens/epub/NavigationBarScreen.java +++ b/src/test/java/screens/epub/NavigationBarScreen.java @@ -15,7 +15,7 @@ public class NavigationBarScreen extends Screen { private final IButton btnTOC = getElementFactory().getButton(LocatorUtils.getLocator( new AndroidLocator(By.xpath("//android.widget.Button[contains(@resource-id,\"readerMenuTOC\")]")), - new IosLocator(By.xpath("//XCUIElementTypeNavigationBar/XCUIElementTypeButton[@name=\"Table of contents and bookmarks\"]"))), "TOC button"); + new IosLocator(By.xpath("//XCUIElementTypeNavigationBar/XCUIElementTypeButton[@name=\"viewBookmarksAndTocButton\"]"))), "TOC button"); private final IButton btnAddBookmark = getElementFactory().getButton(LocatorUtils.getLocator( new AndroidLocator(By.id("readerMenuAddBookmark")), new IosLocator(By.xpath("//XCUIElementTypeNavigationBar/XCUIElementTypeButton[@name=\"Add Bookmark\"]"))), "Add Bookmark button"); diff --git a/src/test/java/screens/epub/ReaderEpubScreen.java b/src/test/java/screens/epub/ReaderEpubScreen.java index bed1878..49abd09 100644 --- a/src/test/java/screens/epub/ReaderEpubScreen.java +++ b/src/test/java/screens/epub/ReaderEpubScreen.java @@ -104,7 +104,7 @@ public String getPageNumber() { public String getChapterName() { String chapterName = ActionProcessorUtils.doForIos(() -> { String chapter = lblChapterName.getAttribute(IosAttributes.NAME); - return StringUtils.substringAfter(chapter, "("); + return StringUtils.substringBetween(chapter, "(", ")"); }); if(chapterName == null) { diff --git a/src/test/resources/devices.json b/src/test/resources/devices.json index bbed6a2..a18492a 100644 --- a/src/test/resources/devices.json +++ b/src/test/resources/devices.json @@ -5,12 +5,6 @@ "platformVersion": "17" } }, - "iPhone14ProMax_16": { - "capabilities": { - "deviceName": "iPhone 14 Pro Max", - "platformVersion": "16" - } - }, "iPhone13ProMax_15": { "capabilities": { "deviceName": "iPhone 13 Pro Max", @@ -35,16 +29,10 @@ "platformVersion": "16" } }, - "iPhone8_15": { - "capabilities": { - "deviceName": "iPhone 8", - "platformVersion": "15" - } - }, - "SamsungGalaxyS23Ultra_13": { + "SamsungGalaxyS24Ultra_14": { "capabilities": { - "deviceName": "Samsung Galaxy S23 Ultra", - "platformVersion": "13.0" + "deviceName": "Samsung Galaxy S24 Ultra", + "platformVersion": "14.0" } }, "SamsungGalaxyS22Ultra_12": { @@ -65,12 +53,6 @@ "platformVersion": "12.0" } }, - "GooglePixel8Pro_14": { - "capabilities": { - "deviceName": "Google Pixel 8 Pro", - "platformVersion": "14.0" - } - }, "GooglePixel7Pro_13": { "capabilities": { "deviceName": "Google Pixel 7 Pro", diff --git a/src/test/resources/localization/catalog/actionButtonsForBooksAndAlerts_android.properties b/src/test/resources/localization/catalog/actionButtonsForBooksAndAlerts_android.properties index efd6f83..f717746 100644 --- a/src/test/resources/localization/catalog/actionButtonsForBooksAndAlerts_android.properties +++ b/src/test/resources/localization/catalog/actionButtonsForBooksAndAlerts_android.properties @@ -9,4 +9,5 @@ download=Download signOut="" notNow="" cancel=Cancel -allow=Allow \ No newline at end of file +allow=Allow +play_sample=Play Sample \ No newline at end of file