diff --git a/src/main/java/ru/mystamps/web/feature/collection/CollectionController.java b/src/main/java/ru/mystamps/web/feature/collection/CollectionController.java index f9f47ddb26..d8a82fa144 100644 --- a/src/main/java/ru/mystamps/web/feature/collection/CollectionController.java +++ b/src/main/java/ru/mystamps/web/feature/collection/CollectionController.java @@ -93,7 +93,6 @@ public String showInfoBySlug( return "collection/info"; } - // @todo #884 Add integration tests for collection estimation page @GetMapping(CollectionUrl.ESTIMATION_COLLECTION_PAGE) public String showPrices( @PathVariable("slug") String slug, diff --git a/src/main/webapp/WEB-INF/views/collection/estimation.html b/src/main/webapp/WEB-INF/views/collection/estimation.html index 9820d6a113..ecfb43d804 100644 --- a/src/main/webapp/WEB-INF/views/collection/estimation.html +++ b/src/main/webapp/WEB-INF/views/collection/estimation.html @@ -67,12 +67,12 @@
Series | diff --git a/src/test/robotframework/collection/estimation/logic.robot b/src/test/robotframework/collection/estimation/logic.robot new file mode 100644 index 0000000000..e5ff698768 --- /dev/null +++ b/src/test/robotframework/collection/estimation/logic.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Verify collection estimation scenarios +Library SeleniumLibrary +Resource ../../auth.steps.robot +Resource ../../selenium.utils.robot +Suite Setup Before Test Suite +Suite Teardown Close Browser +Force Tags collection estimation logic + +*** Test Cases *** +Message should be shown when a collection is empty + Go To ${SITE_URL}/collection/paid/estimation + Element Text Should Be id=empty-collection-msg In this collection is no stamps + +Series with its price should be taken into account + [Tags] unstable + Go To ${SITE_URL}/series/1 + Input Text id=paid-price 100 + Select From List By Value id=paid-currency ${expectedCurrency} + Submit Form id=add-series-form + Go To ${SITE_URL}/collection/paid/estimation + Table Cell Should Contain collection-estimation row=2 column=2 text=100.00 ${expectedCurrency} + # TODO: use "Table Footer Should Contain" instead, when it will be fixed. + # See https://github.com/Hi-Fi/robotframework-seleniumlibrary-java/issues/88 + Table Header Should Contain collection-estimation 100.00 ${expectedCurrency} + +Series without price should be shown but not taken into account + [Tags] unstable + Go To ${SITE_URL}/series/2 + Submit Form id=add-series-form + Go To ${SITE_URL}/collection/paid/estimation + Table Cell Should Contain collection-estimation row=3 column=2 text=${EMPTY} + # TODO: use "Table Footer Should Contain" instead, when it will be fixed. + # See https://github.com/Hi-Fi/robotframework-seleniumlibrary-java/issues/88 + Table Header Should Contain collection-estimation 100.00 ${expectedCurrency} + +*** Keywords *** +Before Test Suite + @{currencies}= Create List USD EUR RUB CZK + ${randomCurrency}= Evaluate random.choice(${currencies}) modules=random + Set Suite Variable ${expectedCurrency} ${randomCurrency} + Open Browser ${SITE_URL}/account/auth ${BROWSER} + Register Keyword To Run On Failure Log Source + Log In As login=paid password=test
---|