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); }