├── .editorconfig ├── .gitignore ├── .gradle ├── 6.7 │ ├── fileChanges │ │ └── last-build.bin │ ├── fileHashes │ │ └── fileHashes.lock │ └── gc.properties ├── buildOutputCleanup │ ├── buildOutputCleanup.lock │ └── cache.properties ├── checksums │ └── checksums.lock ├── configuration-cache │ └── gc.properties └── vcs-1 │ └── gc.properties ├── .idea ├── .name ├── checkstyle-idea.xml ├── compiler.xml ├── jarRepositories.xml ├── libraries │ ├── Maven__aopalliance_aopalliance_1_0.xml │ ├── Maven__com_beust_jcommander_1_78.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_9.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_8_9.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_8_9.xml │ ├── Maven__com_google_code_findbugs_jsr305_1_3_9.xml │ ├── Maven__com_google_code_gson_gson_2_8_6.xml │ ├── Maven__com_google_errorprone_error_prone_annotations_2_1_3.xml │ ├── Maven__com_google_guava_guava_25_0_jre.xml │ ├── Maven__com_google_inject_guice_no_aop_4_2_2.xml │ ├── Maven__com_google_j2objc_j2objc_annotations_1_1.xml │ ├── Maven__com_jcraft_jzlib_1_1_3.xml │ ├── Maven__com_squareup_okhttp3_okhttp_3_11_0.xml │ ├── Maven__com_squareup_okio_okio_1_14_0.xml │ ├── Maven__commons_codec_commons_codec_1_13.xml │ ├── Maven__commons_io_commons_io_2_8_0.xml │ ├── Maven__dnsjava_dnsjava_2_1_8.xml │ ├── Maven__io_github_bonigarcia_webdrivermanager_4_2_2.xml │ ├── Maven__io_netty_netty_all_4_0_51_Final.xml │ ├── Maven__javax_inject_javax_inject_1.xml │ ├── Maven__junit_junit_4_12.xml │ ├── Maven__net_bytebuddy_byte_buddy_1_8_15.xml │ ├── Maven__net_lightbody_bmp_browsermob_core_2_1_5.xml │ ├── Maven__net_lightbody_bmp_littleproxy_1_1_0_beta_bmp_17.xml │ ├── Maven__net_lightbody_bmp_mitm_2_1_5.xml │ ├── Maven__net_sf_jopt_simple_jopt_simple_4_6.xml │ ├── Maven__org_apache_ant_ant_1_10_3.xml │ ├── Maven__org_apache_ant_ant_launcher_1_10_3.xml │ ├── Maven__org_apache_commons_commons_compress_1_20.xml │ ├── Maven__org_apache_commons_commons_exec_1_3.xml │ ├── Maven__org_apache_commons_commons_lang3_3_11.xml │ ├── Maven__org_apache_commons_commons_math3_3_2.xml │ ├── Maven__org_apache_httpcomponents_client5_httpclient5_5_0_1.xml │ ├── Maven__org_apache_httpcomponents_core5_httpcore5_5_0_1.xml │ ├── Maven__org_apache_httpcomponents_core5_httpcore5_h2_5_0_1.xml │ ├── Maven__org_bouncycastle_bcpkix_jdk15on_1_58.xml │ ├── Maven__org_bouncycastle_bcprov_jdk15on_1_58.xml │ ├── Maven__org_checkerframework_checker_compat_qual_2_0_0.xml │ ├── Maven__org_codehaus_mojo_animal_sniffer_annotations_1_14.xml │ ├── Maven__org_hamcrest_hamcrest_core_1_3.xml │ ├── Maven__org_jsoup_jsoup_1_13_1.xml │ ├── Maven__org_openjdk_jmh_jmh_core_1_19.xml │ ├── Maven__org_openjdk_jmh_jmh_generator_annprocess_1_19.xml │ ├── Maven__org_rauschig_jarchivelib_1_1_0.xml │ ├── Maven__org_seleniumhq_selenium_selenium_api_3_141_59.xml │ ├── Maven__org_seleniumhq_selenium_selenium_chrome_driver_3_141_59.xml │ ├── Maven__org_seleniumhq_selenium_selenium_edge_driver_3_141_59.xml │ ├── Maven__org_seleniumhq_selenium_selenium_firefox_driver_3_141_59.xml │ ├── Maven__org_seleniumhq_selenium_selenium_ie_driver_3_141_59.xml │ ├── Maven__org_seleniumhq_selenium_selenium_opera_driver_3_141_59.xml │ ├── Maven__org_seleniumhq_selenium_selenium_remote_driver_3_141_59.xml │ ├── Maven__org_seleniumhq_selenium_selenium_safari_driver_3_141_59.xml │ ├── Maven__org_seleniumhq_selenium_selenium_support_3_141_59.xml │ ├── Maven__org_slf4j_jcl_over_slf4j_1_7_25.xml │ ├── Maven__org_slf4j_slf4j_api_1_7_25.xml │ ├── Maven__org_slf4j_slf4j_api_1_7_30.xml │ ├── Maven__org_testng_testng_7_3_0.xml │ └── Maven__org_yaml_snakeyaml_1_21.xml ├── misc.xml ├── modules.xml ├── uiDesigner.xml ├── vcs.xml └── workspace.xml ├── Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition.iml ├── README.md ├── chapter1-defining-high-quality-attributes ├── chapter1-defining-high-quality-attributes.iml ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── attributes │ │ │ │ ├── BonusPointsDiscountCalculator.java │ │ │ │ ├── CustomerOrder.java │ │ │ │ ├── DiscountCalculator.java │ │ │ │ ├── EmailFactory.java │ │ │ │ ├── EmailLogger.java │ │ │ │ ├── FileLogger.java │ │ │ │ ├── GoldCustomerOrder.java │ │ │ │ ├── GoldDiscountCalculator.java │ │ │ │ ├── Logger.java │ │ │ │ ├── OrderType.java │ │ │ │ ├── PlatinumCustomerOrder.java │ │ │ │ ├── PlatinumDiscountCalculator.java │ │ │ │ ├── RegularDiscountCalculator.java │ │ │ │ ├── SilverDiscountCalculator.java │ │ │ │ ├── SmsFactory.java │ │ │ │ └── SmsLogger.java │ │ └── resources │ │ │ └── chromedriver.exe │ └── test │ │ └── java │ │ └── OrderTests.java └── target │ └── classes │ └── chromedriver.exe ├── chapter10-test-data-preparation ├── Chapter 10- Test Data Preparation.iml ├── chapter10-test-data-preparation.iml ├── debug.log ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ ├── configuration │ │ │ │ ├── BillingInfoDefaultValues.java │ │ │ │ ├── BrowserSettings.java │ │ │ │ ├── ConfigurationService.java │ │ │ │ ├── UrlDeterminer.java │ │ │ │ ├── UrlSettings.java │ │ │ │ ├── User.java │ │ │ │ └── WebSettings.java │ │ │ ├── core │ │ │ │ ├── Browser.java │ │ │ │ ├── BrowserService.java │ │ │ │ ├── CookiesService.java │ │ │ │ ├── DialogButton.java │ │ │ │ ├── DialogService.java │ │ │ │ ├── Driver.java │ │ │ │ ├── DriverDecorator.java │ │ │ │ ├── Element.java │ │ │ │ ├── ElementDecorator.java │ │ │ │ ├── ElementFindService.java │ │ │ │ ├── LogElement.java │ │ │ │ ├── LoggingDriver.java │ │ │ │ ├── NavigationService.java │ │ │ │ ├── WebCoreDriver.java │ │ │ │ └── WebCoreElement.java │ │ │ ├── facadedesignpattern │ │ │ │ ├── classic │ │ │ │ │ ├── CartPage │ │ │ │ │ │ ├── CartPage.java │ │ │ │ │ │ ├── CartPageAssertions.java │ │ │ │ │ │ └── CartPageElements.java │ │ │ │ │ ├── CheckoutPage │ │ │ │ │ │ ├── CheckoutAssertions.java │ │ │ │ │ │ ├── CheckoutElements.java │ │ │ │ │ │ └── CheckoutPage.java │ │ │ │ │ ├── EShopPage.java │ │ │ │ │ ├── MainPage │ │ │ │ │ │ ├── MainPage.java │ │ │ │ │ │ ├── MainPageAssertions.java │ │ │ │ │ │ └── MainPageElements.java │ │ │ │ │ ├── NavigatableEShopPage.java │ │ │ │ │ ├── PurchaseFacade.java │ │ │ │ │ ├── PurchaseInfo.java │ │ │ │ │ └── Sections │ │ │ │ │ │ ├── BreadcrumbSection.java │ │ │ │ │ │ ├── CartInfoSection.java │ │ │ │ │ │ ├── MainMenuSection.java │ │ │ │ │ │ └── SearchSection.java │ │ │ │ └── templatemethods │ │ │ │ │ ├── CartPage │ │ │ │ │ ├── CartPage.java │ │ │ │ │ ├── CartPageAssertions.java │ │ │ │ │ └── CartPageElements.java │ │ │ │ │ ├── CheckoutPage │ │ │ │ │ ├── CheckoutAssertions.java │ │ │ │ │ ├── CheckoutElements.java │ │ │ │ │ └── CheckoutPage.java │ │ │ │ │ ├── EShopPage.java │ │ │ │ │ ├── MainPage │ │ │ │ │ ├── MainPage.java │ │ │ │ │ ├── MainPageAssertions.java │ │ │ │ │ └── MainPageElements.java │ │ │ │ │ ├── NavigatableEShopPage.java │ │ │ │ │ ├── NewPurchaseFacade.java │ │ │ │ │ ├── PurchaseFacade.java │ │ │ │ │ ├── PurchaseInfo.java │ │ │ │ │ └── Sections │ │ │ │ │ ├── BreadcrumbSection.java │ │ │ │ │ ├── CartInfoSection.java │ │ │ │ │ ├── MainMenuSection.java │ │ │ │ │ └── SearchSection.java │ │ │ └── multifilepageobjectpagesectionsappfluent │ │ │ │ ├── App.java │ │ │ │ ├── CartPage │ │ │ │ ├── CartPage.java │ │ │ │ └── CartPageElements.java │ │ │ │ ├── EShopPage.java │ │ │ │ ├── LoggingSingletonDriver.java │ │ │ │ ├── MainPage │ │ │ │ ├── MainPage.java │ │ │ │ └── MainPageElements.java │ │ │ │ ├── NavigatableEShopPage.java │ │ │ │ ├── Sections │ │ │ │ ├── BreadcrumbSection.java │ │ │ │ ├── CartInfoSection.java │ │ │ │ ├── MainMenuSection.java │ │ │ │ └── SearchSection.java │ │ │ │ └── SingletonFactory.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── testFrameworkSettings.dev.json │ │ │ └── testFrameworkSettings.qa.json │ └── test │ │ └── java │ │ ├── datastubs │ │ └── UsingDataStubsTests.java │ │ ├── facadedesignpattern │ │ ├── classic │ │ │ └── ProductPurchaseTestsWithPageObjects.java │ │ └── templatemethods │ │ │ └── ProductPurchaseTestsWithPageObjects.java │ │ └── multifilepageobjectpagesectionsappfluent │ │ └── ProductPurchaseTestsWithPageObjects.java └── target │ └── classes │ ├── application.properties │ ├── testFrameworkSettings.dev.json │ └── testFrameworkSettings.qa.json ├── chapter2-optimize-refactor-flaky-tests ├── chapter2-optimize-refactor-flaky-tests.iml ├── pom.xml ├── src │ ├── main │ │ ├── java │ │ │ └── decorators │ │ │ │ ├── Browser.java │ │ │ │ ├── Driver.java │ │ │ │ ├── DriverDecorator.java │ │ │ │ ├── Element.java │ │ │ │ ├── ElementDecorator.java │ │ │ │ ├── LogElement.java │ │ │ │ ├── LoggingDriver.java │ │ │ │ ├── WebCoreDriver.java │ │ │ │ └── WebCoreElement.java │ │ └── resources │ │ │ └── chromedriver.exe │ └── test │ │ └── java │ │ ├── decorators │ │ └── ProductPurchaseTests.java │ │ ├── hardcodedpauses │ │ └── ProductPurchaseTests.java │ │ └── webdriverwait │ │ └── ProductPurchaseTests.java └── target │ └── classes │ └── chromedriver.exe ├── chapter3-speeding-up-tests ├── Chapter 3- Optimize the Tests.iml ├── chapter3-speeding-up-tests.iml ├── debug.log ├── pom.xml └── src │ ├── main │ └── java │ │ ├── instrumentedcode │ │ ├── Browser.java │ │ ├── Driver.java │ │ ├── DriverDecorator.java │ │ ├── Element.java │ │ ├── ElementDecorator.java │ │ ├── LogElement.java │ │ ├── LoggingDriver.java │ │ ├── WebCoreDriver.java │ │ └── WebCoreElement.java │ │ ├── reusebrowser │ │ ├── Browser.java │ │ ├── Driver.java │ │ ├── DriverDecorator.java │ │ ├── Element.java │ │ ├── ElementDecorator.java │ │ ├── LogElement.java │ │ ├── LoggingDriver.java │ │ ├── WebCoreDriver.java │ │ ├── WebCoreElement.java │ │ └── browserinfrastructure │ │ │ ├── BaseTest.java │ │ │ ├── BaseTestBehaviorObserver.java │ │ │ ├── BrowserBehavior.java │ │ │ ├── BrowserConfiguration.java │ │ │ ├── BrowserLaunchTestBehaviorObserver.java │ │ │ ├── ExecutionBrowser.java │ │ │ ├── ExecutionSubject.java │ │ │ ├── TestBehaviorObserver.java │ │ │ └── TestExecutionSubject.java │ │ ├── reusebrowsercleansession │ │ ├── Browser.java │ │ ├── Driver.java │ │ ├── DriverDecorator.java │ │ ├── Element.java │ │ ├── ElementDecorator.java │ │ ├── LogElement.java │ │ ├── LoggingDriver.java │ │ ├── WebCoreDriver.java │ │ ├── WebCoreElement.java │ │ └── browserinfrastructure │ │ │ ├── BaseTest.java │ │ │ ├── BaseTestBehaviorObserver.java │ │ │ ├── BrowserBehavior.java │ │ │ ├── BrowserConfiguration.java │ │ │ ├── BrowserLaunchTestBehaviorObserver.java │ │ │ ├── ExecutionBrowser.java │ │ │ ├── ExecutionSubject.java │ │ │ ├── TestBehaviorObserver.java │ │ │ └── TestExecutionSubject.java │ │ └── waitforajax │ │ ├── Browser.java │ │ ├── Driver.java │ │ ├── DriverDecorator.java │ │ ├── Element.java │ │ ├── ElementDecorator.java │ │ ├── LogElement.java │ │ ├── LoggingDriver.java │ │ ├── WebCoreDriver.java │ │ └── WebCoreElement.java │ └── test │ └── java │ ├── blackholeproxypattern │ └── CaptureHttpTrafficTests.java │ ├── instrumentedcode │ └── ProductPurchaseTests.java │ ├── reusebrowser │ └── ProductPurchaseTests.java │ ├── reusebrowsercleansession │ └── ProductPurchaseTests.java │ └── waitforajax │ └── ProductPurchaseTests.java ├── chapter4-tests-readability ├── chapter4-tests-readability.iml ├── pom.xml └── src │ ├── main │ └── java │ │ ├── core │ │ ├── Browser.java │ │ ├── Driver.java │ │ ├── DriverDecorator.java │ │ ├── Element.java │ │ ├── ElementDecorator.java │ │ ├── LogElement.java │ │ ├── LoggingDriver.java │ │ ├── WebCoreDriver.java │ │ └── WebCoreElement.java │ │ └── pages │ │ ├── v0 │ │ └── singlefilepageobject │ │ │ ├── CartPage.java │ │ │ └── MainPage.java │ │ ├── v1 │ │ └── singlefilepageobjectnondry │ │ │ ├── CartPage.java │ │ │ └── MainPage.java │ │ ├── v2 │ │ └── singlefilepageobjectbasepage │ │ │ ├── BaseEShopPage.java │ │ │ ├── CartPage.java │ │ │ └── MainPage.java │ │ ├── v3 │ │ └── singlefilepageobjectssections │ │ │ ├── CartPage.java │ │ │ ├── MainPage.java │ │ │ └── Sections │ │ │ ├── BreadcrumbSection.java │ │ │ ├── CartInfoSection.java │ │ │ ├── MainMenuSection.java │ │ │ └── SearchSection.java │ │ └── v4 │ │ └── singlefilepageobjectbasepagesections │ │ ├── BaseEShopPage.java │ │ ├── CartPage.java │ │ ├── MainPage.java │ │ └── sections │ │ ├── BreadcrumbSection.java │ │ ├── CartInfoSection.java │ │ ├── MainMenuSection.java │ │ └── SearchSection.java │ └── test │ └── java │ └── pages │ ├── v0 │ └── singlefilepageobject │ │ ├── ProductPurchaseTestsWithPageObjects.java │ │ └── ProductPurchaseWithoutPagesObjectsTests.java │ └── v4 │ └── singlefilepageobjectbasepagesections │ └── ProductPurchaseTestsWithPageObjects.java ├── chapter5-tests-maintainability ├── chapter5-tests-maintainability.iml ├── pom.xml └── src │ ├── main │ └── java │ │ ├── core │ │ ├── Browser.java │ │ ├── Driver.java │ │ ├── DriverDecorator.java │ │ ├── Element.java │ │ ├── ElementDecorator.java │ │ ├── LogElement.java │ │ ├── LoggingDriver.java │ │ ├── WebCoreDriver.java │ │ └── WebCoreElement.java │ │ ├── facadedesignpattern │ │ ├── classic │ │ │ ├── CartPage │ │ │ │ ├── CartPage.java │ │ │ │ ├── CartPageAssertions.java │ │ │ │ └── CartPageElements.java │ │ │ ├── CheckoutPage │ │ │ │ ├── CheckoutAssertions.java │ │ │ │ ├── CheckoutElements.java │ │ │ │ └── CheckoutPage.java │ │ │ ├── EShopPage.java │ │ │ ├── MainPage │ │ │ │ ├── MainPage.java │ │ │ │ ├── MainPageAssertions.java │ │ │ │ └── MainPageElements.java │ │ │ ├── NavigatableEShopPage.java │ │ │ ├── PurchaseFacade.java │ │ │ ├── PurchaseInfo.java │ │ │ └── Sections │ │ │ │ ├── BreadcrumbSection.java │ │ │ │ ├── CartInfoSection.java │ │ │ │ ├── MainMenuSection.java │ │ │ │ └── SearchSection.java │ │ └── templatemethods │ │ │ ├── CartPage │ │ │ ├── CartPage.java │ │ │ ├── CartPageAssertions.java │ │ │ └── CartPageElements.java │ │ │ ├── CheckoutPage │ │ │ ├── CheckoutAssertions.java │ │ │ ├── CheckoutElements.java │ │ │ └── CheckoutPage.java │ │ │ ├── EShopPage.java │ │ │ ├── MainPage │ │ │ ├── MainPage.java │ │ │ ├── MainPageAssertions.java │ │ │ └── MainPageElements.java │ │ │ ├── NavigatableEShopPage.java │ │ │ ├── NewPurchaseFacade.java │ │ │ ├── PurchaseFacade.java │ │ │ ├── PurchaseInfo.java │ │ │ └── Sections │ │ │ ├── BreadcrumbSection.java │ │ │ ├── CartInfoSection.java │ │ │ ├── MainMenuSection.java │ │ │ └── SearchSection.java │ │ └── pages │ │ ├── v0 │ │ └── singlefilepageobject │ │ │ ├── CartPage.java │ │ │ └── MainPage.java │ │ ├── v1 │ │ └── singlefilepageobjectnondry │ │ │ ├── CartPage.java │ │ │ └── MainPage.java │ │ ├── v11 │ │ └── multifilepageobjectnavibasepagegeneric │ │ │ ├── .idea │ │ │ ├── checkstyle-idea.xml │ │ │ ├── misc.xml │ │ │ ├── modules.xml │ │ │ ├── vcs.xml │ │ │ └── workspace.xml │ │ │ ├── AssertableEShopPage.java │ │ │ ├── BaseAssertions.java │ │ │ ├── BaseElements.java │ │ │ ├── BreadcrumbSection.java │ │ │ ├── CartInfoSection.java │ │ │ ├── CartPage │ │ │ ├── CartPage.java │ │ │ ├── CartPageAssertions.java │ │ │ └── CartPageElements.java │ │ │ ├── EShopPage.java │ │ │ ├── MainMenuSection.java │ │ │ ├── MainPage │ │ │ ├── MainPage.java │ │ │ ├── MainPageAssertions.java │ │ │ └── MainPageElements.java │ │ │ ├── NavigatableAssertableEShopPage.java │ │ │ ├── NavigatableEShopPage.java │ │ │ ├── NewInstanceFactory.java │ │ │ ├── SearchSection.java │ │ │ └── multifilepageobjectnavibasepagegeneric.iml │ │ ├── v2 │ │ └── singlefilepageobjectbasepage │ │ │ ├── BaseEShopPage.java │ │ │ ├── CartPage.java │ │ │ └── MainPage.java │ │ ├── v3 │ │ └── singlefilepageobjectssections │ │ │ ├── CartPage.java │ │ │ ├── MainPage.java │ │ │ └── Sections │ │ │ ├── BreadcrumbSection.java │ │ │ ├── CartInfoSection.java │ │ │ ├── MainMenuSection.java │ │ │ └── SearchSection.java │ │ ├── v4 │ │ └── singlefilepageobjectbasepagesections │ │ │ ├── BaseEShopPage.java │ │ │ ├── CartPage.java │ │ │ ├── MainPage.java │ │ │ └── Sections │ │ │ ├── BreadcrumbSection.java │ │ │ ├── CartInfoSection.java │ │ │ ├── MainMenuSection.java │ │ │ └── SearchSection.java │ │ ├── v5 │ │ └── singlefilepageobjectnavibasepagesections │ │ │ ├── CartPage.java │ │ │ ├── EShopPage.java │ │ │ ├── MainPage.java │ │ │ ├── NavigatableEShopPage.java │ │ │ └── Sections │ │ │ ├── BreadcrumbSection.java │ │ │ ├── CartInfoSection.java │ │ │ ├── MainMenuSection.java │ │ │ └── SearchSection.java │ │ └── v6 │ │ └── multifilepageobjectnavibasepagesections │ │ ├── CartPage │ │ ├── CartPage.java │ │ └── CartPageElements.java │ │ ├── EShopPage.java │ │ ├── MainPage │ │ ├── MainPage.java │ │ ├── MainPageAssertions.java │ │ └── MainPageElements.java │ │ ├── NavigatableEShopPage.java │ │ └── Sections │ │ ├── BreadcrumbSection.java │ │ ├── CartInfoSection.java │ │ ├── MainMenuSection.java │ │ └── SearchSection.java │ └── test │ └── java │ ├── facadedesignpattern │ ├── classic │ │ └── ProductPurchaseTestsWithPageObjects.java │ └── templatemethods │ │ └── ProductPurchaseTestsWithPageObjects.java │ └── pages │ ├── v0 │ └── singlefilepageobject │ │ ├── ProductPurchaseTestsWithPageObjects.java │ │ └── ProductPurchaseWithoutPagesObjectsTests.java │ ├── v4 │ └── singlefilepageobjectbasepagesections │ │ └── ProductPurchaseTestsWithPageObjects.java │ ├── v5 │ └── singlefilepageobjectnavibasepagesections │ │ └── ProductPurchaseTestsWithPageObjects.java │ └── v6 │ └── multifilepageobjectnavibasepagesections │ └── ProductPurchaseTestsWithPageObjects.java ├── chapter6-api-usability ├── Chapter 6- API Usability.iml ├── chapter6-api-usability.iml ├── pom.xml └── src │ ├── main │ └── java │ │ ├── core │ │ ├── Browser.java │ │ ├── BrowserService.java │ │ ├── CookiesService.java │ │ ├── DialogButton.java │ │ ├── DialogService.java │ │ ├── Driver.java │ │ ├── DriverDecorator.java │ │ ├── Element.java │ │ ├── ElementDecorator.java │ │ ├── ElementFindService.java │ │ ├── LogElement.java │ │ ├── LoggingDriver.java │ │ ├── NavigationService.java │ │ ├── WebCoreDriver.java │ │ └── WebCoreElement.java │ │ └── pages │ │ ├── v10 │ │ └── multifilepageobjectpagesectionsappfluent │ │ │ ├── App.java │ │ │ ├── CartPage │ │ │ ├── CartPage.java │ │ │ └── CartPageElements.java │ │ │ ├── EShopPage.java │ │ │ ├── LoggingSingletonDriver.java │ │ │ ├── MainPage │ │ │ ├── MainPage.java │ │ │ └── MainPageElements.java │ │ │ ├── NavigatableEShopPage.java │ │ │ ├── Sections │ │ │ ├── BreadcrumbSection.java │ │ │ ├── CartInfoSection.java │ │ │ ├── MainMenuSection.java │ │ │ └── SearchSection.java │ │ │ └── SingletonFactory.java │ │ ├── v6 │ │ └── multifilepageobjectnavibasepagesections │ │ │ ├── CartPage │ │ │ ├── CartPage.java │ │ │ └── CartPageElements.java │ │ │ ├── EShopPage.java │ │ │ ├── MainPage │ │ │ ├── MainPage.java │ │ │ ├── MainPageAssertions.java │ │ │ └── MainPageElements.java │ │ │ ├── NavigatableEShopPage.java │ │ │ └── Sections │ │ │ ├── BreadcrumbSection.java │ │ │ ├── CartInfoSection.java │ │ │ ├── MainMenuSection.java │ │ │ └── SearchSection.java │ │ ├── v7 │ │ └── multifilepageobjectsectionsdriverinterfaces │ │ │ ├── CartPage │ │ │ ├── CartPage.java │ │ │ └── CartPageElements.java │ │ │ ├── EShopPage.java │ │ │ ├── MainPage │ │ │ ├── MainPage.java │ │ │ ├── MainPageAssertions.java │ │ │ └── MainPageElements.java │ │ │ ├── NavigatableEShopPage.java │ │ │ └── Sections │ │ │ ├── BreadcrumbSection.java │ │ │ ├── CartInfoSection.java │ │ │ ├── MainMenuSection.java │ │ │ └── SearchSection.java │ │ ├── v8 │ │ └── multifilepageobjectsectionssingleton │ │ │ ├── CartPage │ │ │ ├── CartPage.java │ │ │ └── CartPageElements.java │ │ │ ├── EShopPage.java │ │ │ ├── LoggingSingletonDriver.java │ │ │ ├── MainPage │ │ │ ├── MainPage.java │ │ │ ├── MainPageAssertions.java │ │ │ └── MainPageElements.java │ │ │ ├── NavigatableEShopPage.java │ │ │ ├── Sections │ │ │ ├── BreadcrumbSection.java │ │ │ ├── CartInfoSection.java │ │ │ ├── MainMenuSection.java │ │ │ └── SearchSection.java │ │ │ └── SingletonFactory.java │ │ └── v9 │ │ └── multifilepageobjectpagesectionsapp │ │ ├── App.java │ │ ├── CartPage │ │ ├── CartPage.java │ │ └── CartPageElements.java │ │ ├── EShopPage.java │ │ ├── LoggingSingletonDriver.java │ │ ├── MainPage │ │ ├── MainPage.java │ │ ├── MainPageAssertions.java │ │ └── MainPageElements.java │ │ ├── NavigatableEShopPage.java │ │ ├── Sections │ │ ├── BreadcrumbSection.java │ │ ├── CartInfoSection.java │ │ ├── MainMenuSection.java │ │ └── SearchSection.java │ │ └── SingletonFactory.java │ └── test │ └── java │ └── pages │ ├── v10 │ └── multifilepageobjectpagesectionsappfluent │ │ └── ProductPurchaseTestsWithPageObjects.java │ ├── v6 │ └── multifilepageobjectnavibasepagesections │ │ └── ProductPurchaseTestsWithPageObjects.java │ ├── v7 │ └── multifilepageobjectsectionsdriverinterfaces │ │ └── ProductPurchaseTestsWithPageObjects.java │ ├── v8 │ └── multifilepageobjectsectionssingleton │ │ └── ProductPurchaseTestsWithPageObjects.java │ └── v9 │ └── multifilepageobjectpagesectionsapp │ └── ProductPurchaseTestsWithPageObjects.java ├── chapter7-extensibility ├── chapter7-extensibility.iml ├── pom.xml └── src │ ├── main │ └── java │ │ ├── core │ │ ├── App.java │ │ ├── Browser.java │ │ ├── DialogButton.java │ │ ├── Driver.java │ │ ├── DriverDecorator.java │ │ ├── Element.java │ │ ├── ElementDecorator.java │ │ ├── LogElement.java │ │ ├── LoggingDriver.java │ │ ├── LoggingListener.java │ │ ├── LoggingSingletonDriver.java │ │ ├── SingletonFactory.java │ │ ├── WebCoreDriver.java │ │ ├── WebCoreElement.java │ │ ├── interfaces │ │ │ ├── BrowserService.java │ │ │ ├── CookiesService.java │ │ │ ├── DialogService.java │ │ │ ├── ElementFindService.java │ │ │ ├── ElementWaitService.java │ │ │ └── NavigationService.java │ │ ├── locators │ │ │ ├── ClassFindStrategy.java │ │ │ ├── CssFindStrategy.java │ │ │ ├── FindStrategy.java │ │ │ ├── IdContainingFindStrategy.java │ │ │ ├── IdFindStrategy.java │ │ │ ├── InnerTextContainsFindStrategy.java │ │ │ ├── LinkTextFindStrategy.java │ │ │ ├── TagFindStrategy.java │ │ │ └── XPathFindStrategy.java │ │ └── wait │ │ │ ├── ToBeClickableWaitStrategy.java │ │ │ ├── ToBeVisibleWaitStrategy.java │ │ │ ├── ToExistsWaitStrategy.java │ │ │ ├── Wait.java │ │ │ ├── WaitStrategy.java │ │ │ └── WaitStrategyFactory.java │ │ └── pages │ │ └── v10 │ │ └── multifilepageobjectpagesectionsappfluent │ │ ├── CartPage │ │ ├── CartPage.java │ │ └── CartPageElements.java │ │ ├── EShopPage.java │ │ ├── MainPage │ │ ├── MainPage.java │ │ └── MainPageElements.java │ │ ├── NavigatableEShopPage.java │ │ └── Sections │ │ ├── BreadcrumbSection.java │ │ ├── CartInfoSection.java │ │ ├── MainMenuSection.java │ │ └── SearchSection.java │ └── test │ └── java │ └── pages │ └── v10 │ └── multifilepageobjectpagesectionsappfluent │ └── ProductPurchaseTestsWithPageObjects.java ├── chapter8-assessment-system ├── chapter8-assessment-system.iml ├── pom.xml └── src │ ├── main │ └── java │ │ ├── core │ │ ├── Browser.java │ │ ├── BrowserService.java │ │ ├── CookiesService.java │ │ ├── DialogButton.java │ │ ├── DialogService.java │ │ ├── Driver.java │ │ ├── DriverDecorator.java │ │ ├── Element.java │ │ ├── ElementDecorator.java │ │ ├── ElementFindService.java │ │ ├── LogElement.java │ │ ├── LoggingDriver.java │ │ ├── NavigationService.java │ │ ├── WebCoreDriver.java │ │ └── WebCoreElement.java │ │ ├── facadedesignpattern │ │ ├── classic │ │ │ ├── CartPage │ │ │ │ ├── CartPage.java │ │ │ │ ├── CartPageAssertions.java │ │ │ │ └── CartPageElements.java │ │ │ ├── CheckoutPage │ │ │ │ ├── CheckoutAssertions.java │ │ │ │ ├── CheckoutElements.java │ │ │ │ └── CheckoutPage.java │ │ │ ├── EShopPage.java │ │ │ ├── MainPage │ │ │ │ ├── MainPage.java │ │ │ │ ├── MainPageAssertions.java │ │ │ │ └── MainPageElements.java │ │ │ ├── NavigatableEShopPage.java │ │ │ ├── PurchaseFacade.java │ │ │ ├── PurchaseInfo.java │ │ │ └── Sections │ │ │ │ ├── BreadcrumbSection.java │ │ │ │ ├── CartInfoSection.java │ │ │ │ ├── MainMenuSection.java │ │ │ │ └── SearchSection.java │ │ └── templatemethods │ │ │ ├── CartPage │ │ │ ├── CartPage.java │ │ │ ├── CartPageAssertions.java │ │ │ └── CartPageElements.java │ │ │ ├── CheckoutPage │ │ │ ├── CheckoutAssertions.java │ │ │ ├── CheckoutElements.java │ │ │ └── CheckoutPage.java │ │ │ ├── EShopPage.java │ │ │ ├── MainPage │ │ │ ├── MainPage.java │ │ │ ├── MainPageAssertions.java │ │ │ └── MainPageElements.java │ │ │ ├── NavigatableEShopPage.java │ │ │ ├── NewPurchaseFacade.java │ │ │ ├── PurchaseFacade.java │ │ │ ├── PurchaseInfo.java │ │ │ └── Sections │ │ │ ├── BreadcrumbSection.java │ │ │ ├── CartInfoSection.java │ │ │ ├── MainMenuSection.java │ │ │ └── SearchSection.java │ │ └── multifilepageobjectpagesectionsappfluent │ │ ├── App.java │ │ ├── CartPage │ │ ├── CartPage.java │ │ └── CartPageElements.java │ │ ├── EShopPage.java │ │ ├── LoggingSingletonDriver.java │ │ ├── MainPage │ │ ├── MainPage.java │ │ └── MainPageElements.java │ │ ├── NavigatableEShopPage.java │ │ ├── Sections │ │ ├── BreadcrumbSection.java │ │ ├── CartInfoSection.java │ │ ├── MainMenuSection.java │ │ └── SearchSection.java │ │ └── SingletonFactory.java │ └── test │ └── java │ ├── facadedesignpattern │ ├── classic │ │ └── ProductPurchaseTestsWithPageObjects.java │ └── templatemethods │ │ └── ProductPurchaseTestsWithPageObjects.java │ └── pages │ └── v10 │ └── multifilepageobjectpagesectionsappfluent │ └── ProductPurchaseTestsWithPageObjects.java ├── chapter9-benchmarking ├── chapter9-benchmarking.iml ├── pom.xml ├── src │ └── main │ │ ├── java │ │ ├── META-INF │ │ │ └── MANIFEST.MF │ │ ├── core │ │ │ ├── BenchmarkRunner.java │ │ │ ├── Browser.java │ │ │ ├── Driver.java │ │ │ ├── DriverDecorator.java │ │ │ ├── Element.java │ │ │ ├── ElementDecorator.java │ │ │ ├── LogElement.java │ │ │ ├── LoggingDriver.java │ │ │ ├── WebCoreDriver.java │ │ │ ├── WebCoreElement.java │ │ │ └── browserinfrastructure │ │ │ │ ├── BaseBenchmark.java │ │ │ │ ├── BaseTestBehaviorObserver.java │ │ │ │ ├── BrowserBehavior.java │ │ │ │ ├── BrowserConfiguration.java │ │ │ │ ├── BrowserLaunchTestBehaviorObserver.java │ │ │ │ ├── ExecutionBrowser.java │ │ │ │ ├── ExecutionSubject.java │ │ │ │ ├── TestBehaviorObserver.java │ │ │ │ └── TestExecutionSubject.java │ │ └── facades │ │ │ ├── CartPage │ │ │ ├── CartPage.java │ │ │ ├── CartPageAssertions.java │ │ │ └── CartPageElements.java │ │ │ ├── CheckoutPage │ │ │ ├── CheckoutAssertions.java │ │ │ ├── CheckoutElements.java │ │ │ └── CheckoutPage.java │ │ │ ├── EShopPage.java │ │ │ ├── MainPage │ │ │ ├── MainPage.java │ │ │ ├── MainPageAssertions.java │ │ │ └── MainPageElements.java │ │ │ ├── NavigatableEShopPage.java │ │ │ ├── NewPurchaseFacade.java │ │ │ ├── PurchaseFacade.java │ │ │ ├── PurchaseInfo.java │ │ │ └── Sections │ │ │ ├── BreadcrumbSection.java │ │ │ ├── CartInfoSection.java │ │ │ ├── MainMenuSection.java │ │ │ └── SearchSection.java │ │ └── resources │ │ └── META-INF │ │ └── MANIFEST.MF └── target │ └── classes │ └── META-INF │ ├── BenchmarkList │ ├── CompilerHints │ └── MANIFEST.MF ├── design-patterns-for-high-quality-automated-tests.iml ├── out └── artifacts │ └── chapter9_benchmarking_jar │ ├── Chapter 9- Benchmarking.jar │ ├── animal-sniffer-annotations-1.14.jar │ ├── ant-1.10.3.jar │ ├── ant-launcher-1.10.3.jar │ ├── aopalliance-1.0.jar │ ├── byte-buddy-1.8.15.jar │ ├── checker-compat-qual-2.0.0.jar │ ├── commons-codec-1.13.jar │ ├── commons-compress-1.20.jar │ ├── commons-exec-1.3.jar │ ├── commons-io-2.8.0.jar │ ├── commons-lang3-3.11.jar │ ├── commons-math3-3.2.jar │ ├── error_prone_annotations-2.1.3.jar │ ├── gson-2.8.6.jar │ ├── guava-25.0-jre.jar │ ├── guice-4.2.2-no_aop.jar │ ├── hamcrest-core-1.3.jar │ ├── httpclient5-5.0.1.jar │ ├── httpcore5-5.0.1.jar │ ├── httpcore5-h2-5.0.1.jar │ ├── j2objc-annotations-1.1.jar │ ├── jarchivelib-1.1.0.jar │ ├── javax.inject-1.jar │ ├── jcommander-1.78.jar │ ├── jmh-core-1.19.jar │ ├── jmh-generator-annprocess-1.19.jar │ ├── jopt-simple-4.6.jar │ ├── jsoup-1.13.1.jar │ ├── jsr305-1.3.9.jar │ ├── junit-4.12.jar │ ├── okhttp-3.11.0.jar │ ├── okio-1.14.0.jar │ ├── selenium-api-3.141.59.jar │ ├── selenium-chrome-driver-3.141.59.jar │ ├── selenium-firefox-driver-3.141.59.jar │ ├── selenium-remote-driver-3.141.59.jar │ ├── selenium-support-3.141.59.jar │ ├── slf4j-api-1.7.30.jar │ ├── snakeyaml-1.21.jar │ ├── testng-7.3.0.jar │ └── webdrivermanager-4.2.2.jar └── pom.xml /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.class 3 | *.class 4 | -------------------------------------------------------------------------------- /.gradle/6.7/fileChanges/last-build.bin: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.gradle/6.7/fileHashes/fileHashes.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/.gradle/6.7/fileHashes/fileHashes.lock -------------------------------------------------------------------------------- /.gradle/6.7/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/.gradle/6.7/gc.properties -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/buildOutputCleanup.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/.gradle/buildOutputCleanup/buildOutputCleanup.lock -------------------------------------------------------------------------------- /.gradle/buildOutputCleanup/cache.properties: -------------------------------------------------------------------------------- 1 | #Mon Jan 11 16:44:23 EET 2021 2 | gradle.version=6.7 3 | -------------------------------------------------------------------------------- /.gradle/checksums/checksums.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/.gradle/checksums/checksums.lock -------------------------------------------------------------------------------- /.gradle/configuration-cache/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/.gradle/configuration-cache/gc.properties -------------------------------------------------------------------------------- /.gradle/vcs-1/gc.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/.gradle/vcs-1/gc.properties -------------------------------------------------------------------------------- /.idea/.name: -------------------------------------------------------------------------------- 1 | design-patterns-for-high-quality-automated-tests -------------------------------------------------------------------------------- /.idea/checkstyle-idea.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /.idea/jarRepositories.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 9 | 10 | 14 | 15 | 19 | 20 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_beust_jcommander_1_78.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_8_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_8_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_8_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_code_findbugs_jsr305_1_3_9.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_code_gson_gson_2_8_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_errorprone_error_prone_annotations_2_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_guava_guava_25_0_jre.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_inject_guice_no_aop_4_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_google_j2objc_j2objc_annotations_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_jcraft_jzlib_1_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_squareup_okhttp3_okhttp_3_11_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_squareup_okio_okio_1_14_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_codec_commons_codec_1_13.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_io_commons_io_2_8_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__dnsjava_dnsjava_2_1_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_github_bonigarcia_webdrivermanager_4_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__io_netty_netty_all_4_0_51_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_inject_javax_inject_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__junit_junit_4_12.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_bytebuddy_byte_buddy_1_8_15.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_lightbody_bmp_browsermob_core_2_1_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_lightbody_bmp_littleproxy_1_1_0_beta_bmp_17.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_lightbody_bmp_mitm_2_1_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__net_sf_jopt_simple_jopt_simple_4_6.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_ant_ant_1_10_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_ant_ant_launcher_1_10_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_compress_1_20.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_exec_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_lang3_3_11.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_commons_commons_math3_3_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_client5_httpclient5_5_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_core5_httpcore5_5_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_apache_httpcomponents_core5_httpcore5_h2_5_0_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_bouncycastle_bcpkix_jdk15on_1_58.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_bouncycastle_bcprov_jdk15on_1_58.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_checkerframework_checker_compat_qual_2_0_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_codehaus_mojo_animal_sniffer_annotations_1_14.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jsoup_jsoup_1_13_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_openjdk_jmh_jmh_core_1_19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_openjdk_jmh_jmh_generator_annprocess_1_19.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_rauschig_jarchivelib_1_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_seleniumhq_selenium_selenium_api_3_141_59.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_seleniumhq_selenium_selenium_chrome_driver_3_141_59.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_seleniumhq_selenium_selenium_edge_driver_3_141_59.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_seleniumhq_selenium_selenium_firefox_driver_3_141_59.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_seleniumhq_selenium_selenium_ie_driver_3_141_59.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_seleniumhq_selenium_selenium_opera_driver_3_141_59.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_seleniumhq_selenium_selenium_remote_driver_3_141_59.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_seleniumhq_selenium_selenium_safari_driver_3_141_59.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_seleniumhq_selenium_selenium_support_3_141_59.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_jcl_over_slf4j_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_25.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_slf4j_api_1_7_30.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_testng_testng_7_3_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_yaml_snakeyaml_1_21.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/BonusPointsDiscountCalculator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public interface BonusPointsDiscountCalculator { 17 | double calculateBonusPointsDiscount(double totalPrice, int points); 18 | } 19 | -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/DiscountCalculator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public interface DiscountCalculator { 17 | double calculateRegularDiscount(double totalPrice); 18 | 19 | double calculateBonusPointsDiscount(double totalPrice, int points) throws NoSuchMethodException; 20 | } 21 | -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/EmailFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public class EmailFactory { 17 | public static void sendEmail(String errorMessage) { 18 | // send email logic 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/EmailLogger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public class EmailLogger implements Logger { 17 | public void createLogEntry(String errorMessage) { 18 | EmailFactory.sendEmail(errorMessage); 19 | } 20 | } -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/FileLogger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | import java.io.BufferedWriter; 17 | import java.io.IOException; 18 | import java.nio.file.Files; 19 | import java.nio.file.Path; 20 | import java.nio.file.Paths; 21 | 22 | public class FileLogger implements Logger { 23 | public void createLogEntry(String error) throws IOException { 24 | Path path = Paths.get("C:\\errors.txt"); 25 | BufferedWriter writer = Files.newBufferedWriter(path); 26 | writer.write(error); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/GoldCustomerOrder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public class GoldCustomerOrder extends CustomerOrder { 17 | public GoldCustomerOrder() { 18 | super(new EmailLogger()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/GoldDiscountCalculator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public class GoldDiscountCalculator implements DiscountCalculator { 17 | public double calculateRegularDiscount(double totalPrice) { 18 | return totalPrice - 50; 19 | } 20 | 21 | public double calculateBonusPointsDiscount(double totalPrice, int points) { 22 | return totalPrice - points * 1; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/Logger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | import java.io.IOException; 17 | 18 | public interface Logger { 19 | void createLogEntry(String errorMessage) throws IOException; 20 | } 21 | -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/OrderType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public enum OrderType { 17 | NORMAL, 18 | SILVER, 19 | GOLD, 20 | PLATINUM 21 | } 22 | -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/PlatinumCustomerOrder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public class PlatinumCustomerOrder extends CustomerOrder { 17 | public PlatinumCustomerOrder() { 18 | super(new SmsLogger()); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/PlatinumDiscountCalculator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public class PlatinumDiscountCalculator implements DiscountCalculator { 17 | public double calculateRegularDiscount(double totalPrice) { 18 | return totalPrice - 100; 19 | } 20 | 21 | public double calculateBonusPointsDiscount(double totalPrice, int points) throws NoSuchMethodException { 22 | throw new NoSuchMethodException("Not applicable for Platinum orders."); 23 | } 24 | } -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/RegularDiscountCalculator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public interface RegularDiscountCalculator { 17 | double calculateRegularDiscount(double totalPrice); 18 | } 19 | -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/SilverDiscountCalculator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public class SilverDiscountCalculator implements DiscountCalculator { 17 | public double calculateRegularDiscount(double totalPrice) { 18 | return totalPrice - 20; 19 | } 20 | 21 | public double calculateBonusPointsDiscount(double totalPrice, int points) { 22 | return totalPrice - points * 0.5; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/SmsFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public class SmsFactory { 17 | public static void sendSms(String errorMessage) { 18 | // send SMS logic 19 | } 20 | } -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/java/attributes/SmsLogger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package attributes; 15 | 16 | public class SmsLogger implements Logger { 17 | public void createLogEntry(String errorMessage) { 18 | SmsFactory.sendSms(errorMessage); 19 | } 20 | } -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/src/main/resources/chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/chapter1-defining-high-quality-attributes/src/main/resources/chromedriver.exe -------------------------------------------------------------------------------- /chapter1-defining-high-quality-attributes/target/classes/chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/chapter1-defining-high-quality-attributes/target/classes/chromedriver.exe -------------------------------------------------------------------------------- /chapter10-test-data-preparation/Chapter 10- Test Data Preparation.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/debug.log: -------------------------------------------------------------------------------- 1 | [1111/163413.719:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) 2 | [1111/164017.089:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) 3 | [1111/180038.522:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) 4 | [1111/185602.428:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) 5 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/configuration/BrowserSettings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package configuration; 15 | 16 | public class BrowserSettings { 17 | private int pageLoadTimeout; 18 | private int scriptTimeout; 19 | 20 | public int getPageLoadTimeout() { 21 | return pageLoadTimeout; 22 | } 23 | 24 | public int getScriptTimeout() { 25 | return scriptTimeout; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return "BrowserSettings{" + 31 | "pageLoadTimeout=" + pageLoadTimeout + 32 | ", scriptTimeout=" + scriptTimeout + 33 | '}'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/configuration/UrlSettings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package configuration; 15 | 16 | public class UrlSettings { 17 | private String shopUrl; 18 | private String accountUrl; 19 | 20 | public String getShopUrl() { 21 | return shopUrl; 22 | } 23 | 24 | public String getAccountUrl() { 25 | return accountUrl; 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return "UrlSettings{" + 31 | "shopUrl='" + shopUrl + '\'' + 32 | ", accountUrl='" + accountUrl + '\'' + 33 | '}'; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/core/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public enum Browser { 17 | CHROME, 18 | FIREFOX, 19 | EDGE, 20 | OPERA, 21 | SAFARI, 22 | INTERNET_EXPLORER, 23 | } 24 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/core/BrowserService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import java.io.IOException; 17 | 18 | public interface BrowserService { 19 | void start(Browser browser) throws IOException; 20 | void quit(); 21 | void waitForAjax(); 22 | void waitUntilPageLoadsCompletely(); 23 | } 24 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/core/CookiesService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public interface CookiesService { 17 | // void addCookie(String cookieName, String cookieValue, String path); 18 | // 19 | // void deleteAllCookies(); 20 | // 21 | // void deleteCookie(String cookieName); 22 | // 23 | // List getAllCookies(); 24 | // 25 | // String getCookie(String cookieName); 26 | } 27 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/core/DialogButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public enum DialogButton { 17 | OK, 18 | CANCEL, 19 | OPEN, 20 | YES, 21 | NO, 22 | CLOSE, 23 | RUN, 24 | SAVE, 25 | } 26 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/core/DialogService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public interface DialogService { 17 | // void handle(Function function, DialogButton dialogButton); 18 | } 19 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/core/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.By; 17 | import org.openqa.selenium.support.ui.WebDriverWait; 18 | 19 | import java.io.IOException; 20 | import java.util.List; 21 | 22 | public abstract class Driver implements NavigationService, BrowserService, CookiesService, ElementFindService, DialogService { 23 | public abstract WebDriverWait getBrowserWait(); 24 | } 25 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/core/Element.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public abstract class Element { 19 | public abstract By getBy(); 20 | public abstract String getText(); 21 | public abstract Boolean isEnabled(); 22 | public abstract Boolean isDisplayed(); 23 | public abstract void typeText(String text) throws InterruptedException; 24 | public abstract void click(); 25 | public abstract String getAttribute(String attributeName); 26 | public abstract void waitToExists(); 27 | public abstract Element findElement(By locator); 28 | } 29 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/core/ElementFindService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | import java.util.List; 19 | 20 | public interface ElementFindService { 21 | Element findElement(By locator); 22 | List findElements(By locator); 23 | } 24 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/core/NavigationService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public interface NavigationService { 17 | void goToUrl(String url); 18 | String getUrl(); 19 | } 20 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/facadedesignpattern/classic/CheckoutPage/CheckoutAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.classic.CheckoutPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class CheckoutAssertions { 19 | private final CheckoutElements elements; 20 | 21 | public CheckoutAssertions(CheckoutElements elements) { 22 | this.elements = elements; 23 | } 24 | 25 | public void assertOrderReceived() 26 | { 27 | Assert.assertEquals(elements.receivedMessage().getText(), "Order received"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/facadedesignpattern/classic/MainPage/MainPageAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.classic.MainPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class MainPageAssertions { 19 | private final MainPageElements elements; 20 | 21 | public MainPageAssertions(MainPageElements mainPageElements) { 22 | elements = mainPageElements; 23 | } 24 | 25 | public void assertProductBoxLink(String name, String expectedLink) { 26 | var actualLink = elements.getProductBoxByName(name).getAttribute("href"); 27 | Assert.assertEquals(actualLink, expectedLink); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/facadedesignpattern/classic/NavigatableEShopPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.classic; 15 | 16 | import core.Driver; 17 | 18 | public abstract class NavigatableEShopPage extends EShopPage { 19 | public NavigatableEShopPage(Driver driver) { 20 | super(driver); 21 | } 22 | 23 | protected abstract String getUrl(); 24 | 25 | public void open() 26 | { 27 | driver.goToUrl(getUrl()); 28 | waitForPageLoad(); 29 | } 30 | 31 | protected abstract void waitForPageLoad(); 32 | } 33 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/facadedesignpattern/templatemethods/CheckoutPage/CheckoutAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.templatemethods.CheckoutPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class CheckoutAssertions { 19 | private final CheckoutElements elements; 20 | 21 | public CheckoutAssertions(CheckoutElements elements) { 22 | this.elements = elements; 23 | } 24 | 25 | public void assertOrderReceived() 26 | { 27 | Assert.assertEquals(elements.receivedMessage().getText(), "Order received"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/java/facadedesignpattern/templatemethods/MainPage/MainPageAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.templatemethods.MainPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class MainPageAssertions { 19 | private final MainPageElements elements; 20 | 21 | public MainPageAssertions(MainPageElements mainPageElements) { 22 | elements = mainPageElements; 23 | } 24 | 25 | public void assertProductBoxLink(String name, String expectedLink) 26 | { 27 | var actualLink = elements.getProductBoxByName(name).getAttribute("href"); 28 | Assert.assertEquals(actualLink, expectedLink); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /chapter10-test-data-preparation/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Automate The Planet Ltd. 3 | # Author: Anton Angelov 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # You may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # 13 | 14 | environment=qa -------------------------------------------------------------------------------- /chapter10-test-data-preparation/target/classes/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2021 Automate The Planet Ltd. 3 | # Author: Anton Angelov 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # You may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, 9 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | # See the License for the specific language governing permissions and 11 | # limitations under the License. 12 | # 13 | 14 | environment=qa -------------------------------------------------------------------------------- /chapter2-optimize-refactor-flaky-tests/src/main/java/decorators/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package decorators; 15 | 16 | public enum Browser { 17 | CHROME, 18 | FIREFOX, 19 | EDGE, 20 | OPERA, 21 | SAFARI, 22 | INTERNET_EXPLORER 23 | } 24 | -------------------------------------------------------------------------------- /chapter2-optimize-refactor-flaky-tests/src/main/java/decorators/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package decorators; 15 | 16 | import org.openqa.selenium.By; 17 | import java.util.List; 18 | 19 | public abstract class Driver { 20 | public abstract void start(Browser browser); 21 | public abstract void quit(); 22 | public abstract void goToUrl(String url); 23 | public abstract Element findElement(By locator); 24 | public abstract List findElements(By locator); 25 | } 26 | -------------------------------------------------------------------------------- /chapter2-optimize-refactor-flaky-tests/src/main/java/decorators/Element.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package decorators; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public abstract class Element { 19 | public abstract By getBy(); 20 | public abstract String getText(); 21 | public abstract Boolean isEnabled(); 22 | public abstract Boolean isDisplayed(); 23 | public abstract void typeText(String text) throws InterruptedException; 24 | public abstract void click(); 25 | public abstract String getAttribute(String attributeName); 26 | } 27 | -------------------------------------------------------------------------------- /chapter2-optimize-refactor-flaky-tests/src/main/resources/chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/chapter2-optimize-refactor-flaky-tests/src/main/resources/chromedriver.exe -------------------------------------------------------------------------------- /chapter2-optimize-refactor-flaky-tests/target/classes/chromedriver.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/chapter2-optimize-refactor-flaky-tests/target/classes/chromedriver.exe -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/Chapter 3- Optimize the Tests.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/debug.log: -------------------------------------------------------------------------------- 1 | [1105/144848.479:ERROR:directory_reader_win.cc(43)] FindFirstFile: The system cannot find the path specified. (0x3) 2 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/instrumentedcode/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package instrumentedcode; 15 | 16 | public enum Browser { 17 | CHROME, 18 | FIREFOX, 19 | EDGE, 20 | OPERA, 21 | SAFARI, 22 | INTERNET_EXPLORER 23 | } 24 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/instrumentedcode/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package instrumentedcode; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | import java.util.List; 19 | 20 | public abstract class Driver { 21 | public abstract void start(Browser browser); 22 | 23 | public abstract void quit(); 24 | 25 | public abstract void goToUrl(String url); 26 | 27 | public abstract Element findElement(By locator); 28 | 29 | public abstract List findElements(By locator); 30 | } 31 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/instrumentedcode/Element.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package instrumentedcode; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public abstract class Element { 19 | public abstract By getBy(); 20 | 21 | public abstract String getText(); 22 | 23 | public abstract Boolean isEnabled(); 24 | 25 | public abstract Boolean isDisplayed(); 26 | 27 | public abstract void typeText(String text) throws InterruptedException; 28 | 29 | public abstract void click(); 30 | 31 | public abstract String getAttribute(String attributeName); 32 | } 33 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/reusebrowser/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package reusebrowser; 15 | 16 | public enum Browser { 17 | NOT_SET, 18 | CHROME, 19 | FIREFOX, 20 | EDGE, 21 | OPERA, 22 | SAFARI, 23 | INTERNET_EXPLORER 24 | } 25 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/reusebrowser/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package reusebrowser; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | import java.util.List; 19 | 20 | public abstract class Driver { 21 | public abstract void start(Browser browser); 22 | 23 | public abstract void quit(); 24 | 25 | public abstract void goToUrl(String url); 26 | 27 | public abstract Element findElement(By locator); 28 | 29 | public abstract List findElements(By locator); 30 | 31 | public abstract void waitForAjax(); 32 | 33 | public abstract void waitUntilPageLoadsCompletely(); 34 | } 35 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/reusebrowser/Element.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package reusebrowser; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public abstract class Element { 19 | public abstract By getBy(); 20 | 21 | public abstract String getText(); 22 | 23 | public abstract Boolean isEnabled(); 24 | 25 | public abstract Boolean isDisplayed(); 26 | 27 | public abstract void typeText(String text) throws InterruptedException; 28 | 29 | public abstract void click(); 30 | 31 | public abstract String getAttribute(String attributeName); 32 | } 33 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/reusebrowser/browserinfrastructure/BrowserBehavior.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package reusebrowser.browserinfrastructure; 15 | 16 | public enum BrowserBehavior { 17 | NOT_SET, 18 | REUSE_IF_STARTED, 19 | RESTART_EVERY_TIME, 20 | RESTART_ON_FAIL, 21 | } 22 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/reusebrowser/browserinfrastructure/ExecutionBrowser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package reusebrowser.browserinfrastructure; 15 | 16 | import reusebrowser.Browser; 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | @Target({ElementType.TYPE, ElementType.METHOD}) 24 | @Retention(RetentionPolicy.RUNTIME) 25 | public @interface ExecutionBrowser { 26 | Browser browser() default Browser.CHROME; 27 | 28 | BrowserBehavior browserBehavior() default BrowserBehavior.RESTART_EVERY_TIME; 29 | } -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/reusebrowser/browserinfrastructure/TestBehaviorObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package reusebrowser.browserinfrastructure; 15 | 16 | import org.testng.ITestResult; 17 | 18 | import java.lang.reflect.Method; 19 | 20 | public interface TestBehaviorObserver { 21 | void preTestInit(ITestResult testResult, Method memberInfo); 22 | 23 | void postTestInit(ITestResult testResult, Method memberInfo); 24 | 25 | void preTestCleanup(ITestResult testResult, Method memberInfo); 26 | 27 | void postTestCleanup(ITestResult testResult, Method memberInfo); 28 | 29 | void testInstantiated(Method memberInfo); 30 | } 31 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/reusebrowsercleansession/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package reusebrowsercleansession; 15 | 16 | public enum Browser { 17 | NOT_SET, 18 | CHROME, 19 | FIREFOX, 20 | EDGE, 21 | OPERA, 22 | SAFARI, 23 | INTERNET_EXPLORER 24 | } 25 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/reusebrowsercleansession/Element.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package reusebrowsercleansession; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public abstract class Element { 19 | public abstract By getBy(); 20 | 21 | public abstract String getText(); 22 | 23 | public abstract Boolean isEnabled(); 24 | 25 | public abstract Boolean isDisplayed(); 26 | 27 | public abstract void typeText(String text) throws InterruptedException; 28 | 29 | public abstract void click(); 30 | 31 | public abstract String getAttribute(String attributeName); 32 | } 33 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/reusebrowsercleansession/browserinfrastructure/BrowserBehavior.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package reusebrowsercleansession.browserinfrastructure; 15 | 16 | public enum BrowserBehavior { 17 | NOT_SET, 18 | REUSE_IF_STARTED, 19 | RESTART_EVERY_TIME, 20 | RESTART_ON_FAIL 21 | } 22 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/reusebrowsercleansession/browserinfrastructure/TestBehaviorObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package reusebrowsercleansession.browserinfrastructure; 15 | 16 | import org.testng.ITestResult; 17 | 18 | import java.lang.reflect.Method; 19 | 20 | public interface TestBehaviorObserver { 21 | void preTestInit(ITestResult testResult, Method memberInfo); 22 | 23 | void postTestInit(ITestResult testResult, Method memberInfo); 24 | 25 | void preTestCleanup(ITestResult testResult, Method memberInfo); 26 | 27 | void postTestCleanup(ITestResult testResult, Method memberInfo); 28 | 29 | void testInstantiated(Method memberInfo); 30 | } 31 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/waitforajax/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package waitforajax; 15 | 16 | public enum Browser { 17 | CHROME, 18 | FIREFOX, 19 | EDGE, 20 | OPERA, 21 | SAFARI, 22 | INTERNET_EXPLORER 23 | } 24 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/waitforajax/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package waitforajax; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | import java.util.List; 19 | 20 | public abstract class Driver { 21 | public abstract void start(Browser browser); 22 | 23 | public abstract void quit(); 24 | 25 | public abstract void goToUrl(String url); 26 | 27 | public abstract Element findElement(By locator); 28 | 29 | public abstract List findElements(By locator); 30 | 31 | public abstract void waitForAjax(); 32 | 33 | public abstract void waitUntilPageLoadsCompletely(); 34 | } 35 | -------------------------------------------------------------------------------- /chapter3-speeding-up-tests/src/main/java/waitforajax/Element.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package waitforajax; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public abstract class Element { 19 | public abstract By getBy(); 20 | 21 | public abstract String getText(); 22 | 23 | public abstract Boolean isEnabled(); 24 | 25 | public abstract Boolean isDisplayed(); 26 | 27 | public abstract void typeText(String text) throws InterruptedException; 28 | 29 | public abstract void click(); 30 | 31 | public abstract String getAttribute(String attributeName); 32 | } 33 | -------------------------------------------------------------------------------- /chapter4-tests-readability/src/main/java/core/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public enum Browser { 17 | CHROME, 18 | FIREFOX, 19 | EDGE, 20 | OPERA, 21 | SAFARI, 22 | INTERNET_EXPLORER 23 | } 24 | -------------------------------------------------------------------------------- /chapter4-tests-readability/src/main/java/core/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | import java.util.List; 19 | 20 | public abstract class Driver { 21 | public abstract void start(Browser browser); 22 | 23 | public abstract void quit(); 24 | 25 | public abstract void goToUrl(String url); 26 | 27 | public abstract Element findElement(By locator); 28 | 29 | public abstract List findElements(By locator); 30 | 31 | public abstract void waitForAjax(); 32 | 33 | public abstract void waitUntilPageLoadsCompletely(); 34 | } 35 | -------------------------------------------------------------------------------- /chapter4-tests-readability/src/main/java/core/Element.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public abstract class Element { 19 | public abstract By getBy(); 20 | 21 | public abstract String getText(); 22 | 23 | public abstract Boolean isEnabled(); 24 | 25 | public abstract Boolean isDisplayed(); 26 | 27 | public abstract void typeText(String text) throws InterruptedException; 28 | 29 | public abstract void click(); 30 | 31 | public abstract String getAttribute(String attributeName); 32 | 33 | public abstract Element findElement(By locator); 34 | } 35 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/core/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public enum Browser { 17 | CHROME, 18 | FIREFOX, 19 | EDGE, 20 | OPERA, 21 | SAFARI, 22 | INTERNET_EXPLORER 23 | } -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/core/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | import java.util.List; 19 | 20 | public abstract class Driver { 21 | public abstract void start(Browser browser); 22 | 23 | public abstract void quit(); 24 | 25 | public abstract void goToUrl(String url); 26 | 27 | public abstract Element findElement(By locator); 28 | 29 | public abstract List findElements(By locator); 30 | 31 | public abstract void waitForAjax(); 32 | 33 | public abstract void waitUntilPageLoadsCompletely(); 34 | } 35 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/core/Element.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public abstract class Element { 19 | public abstract By getBy(); 20 | 21 | public abstract String getText(); 22 | 23 | public abstract Boolean isEnabled(); 24 | 25 | public abstract Boolean isDisplayed(); 26 | 27 | public abstract void typeText(String text) throws InterruptedException; 28 | 29 | public abstract void click(); 30 | 31 | public abstract String getAttribute(String attributeName); 32 | 33 | public abstract Element findElement(By locator); 34 | 35 | public abstract void waitToExists(); 36 | } 37 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/facadedesignpattern/classic/CheckoutPage/CheckoutAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.classic.CheckoutPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class CheckoutAssertions { 19 | private final CheckoutElements elements; 20 | 21 | public CheckoutAssertions(CheckoutElements elements) { 22 | this.elements = elements; 23 | } 24 | 25 | public void assertOrderReceived() { 26 | Assert.assertEquals(elements.receivedMessage().getText(), "Order received"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/facadedesignpattern/classic/MainPage/MainPageAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.classic.MainPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class MainPageAssertions { 19 | private final MainPageElements elements; 20 | 21 | public MainPageAssertions(MainPageElements mainPageElements) { 22 | elements = mainPageElements; 23 | } 24 | 25 | public void assertProductBoxLink(String name, String expectedLink) { 26 | var actualLink = elements.getProductBoxByName(name).getAttribute("href"); 27 | Assert.assertEquals(actualLink, expectedLink); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/facadedesignpattern/classic/NavigatableEShopPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.classic; 15 | 16 | import core.Driver; 17 | 18 | public abstract class NavigatableEShopPage extends EShopPage { 19 | public NavigatableEShopPage(Driver driver) { 20 | super(driver); 21 | } 22 | 23 | protected abstract String getUrl(); 24 | 25 | public void open() { 26 | driver.goToUrl(getUrl()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/facadedesignpattern/templatemethods/CheckoutPage/CheckoutAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.templatemethods.CheckoutPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class CheckoutAssertions { 19 | private final CheckoutElements elements; 20 | 21 | public CheckoutAssertions(CheckoutElements elements) { 22 | this.elements = elements; 23 | } 24 | 25 | public void assertOrderReceived() { 26 | Assert.assertEquals(elements.receivedMessage().getText(), "Order received"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/facadedesignpattern/templatemethods/MainPage/MainPageAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.templatemethods.MainPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class MainPageAssertions { 19 | private final MainPageElements elements; 20 | 21 | public MainPageAssertions(MainPageElements mainPageElements) { 22 | elements = mainPageElements; 23 | } 24 | 25 | public void assertProductBoxLink(String name, String expectedLink) { 26 | var actualLink = elements.getProductBoxByName(name).getAttribute("href"); 27 | Assert.assertEquals(actualLink, expectedLink); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/facadedesignpattern/templatemethods/NavigatableEShopPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.templatemethods; 15 | 16 | import core.Driver; 17 | 18 | public abstract class NavigatableEShopPage extends EShopPage { 19 | public NavigatableEShopPage(Driver driver) { 20 | super(driver); 21 | } 22 | 23 | protected abstract String getUrl(); 24 | 25 | public void open() { 26 | driver.goToUrl(getUrl()); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/pages/v11/multifilepageobjectnavibasepagegeneric/.idea/checkstyle-idea.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 15 | 16 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/pages/v11/multifilepageobjectnavibasepagegeneric/.idea/misc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/pages/v11/multifilepageobjectnavibasepagegeneric/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/pages/v11/multifilepageobjectnavibasepagegeneric/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/pages/v11/multifilepageobjectnavibasepagegeneric/BaseAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package pages.v11.multifilepageobjectnavibasepagegeneric; 15 | 16 | public abstract class BaseAssertions { 17 | protected ElementsT elements() { 18 | return NewInstanceFactory.createByTypeParameter(getClass(), 0); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/pages/v11/multifilepageobjectnavibasepagegeneric/BaseElements.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package pages.v11.multifilepageobjectnavibasepagegeneric; 15 | 16 | import core.Driver; 17 | 18 | public abstract class BaseElements { 19 | protected final Driver driver; 20 | 21 | public BaseElements(Driver driver) { 22 | this.driver = driver; 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/pages/v11/multifilepageobjectnavibasepagegeneric/CartPage/CartPageAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package pages.v11.multifilepageobjectnavibasepagegeneric.CartPage; 15 | 16 | import pages.v11.multifilepageobjectnavibasepagegeneric.BaseAssertions; 17 | 18 | public class CartPageAssertions extends BaseAssertions { 19 | } 20 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/pages/v11/multifilepageobjectnavibasepagegeneric/MainPage/MainPageAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package pages.v11.multifilepageobjectnavibasepagegeneric.MainPage; 15 | 16 | import org.testng.Assert; 17 | import pages.v11.multifilepageobjectnavibasepagegeneric.BaseAssertions; 18 | 19 | public class MainPageAssertions extends BaseAssertions { 20 | public void assertProductBoxLink(String name, String expectedLink) { 21 | var actualLink = elements().getProductBoxByName(name).getAttribute("href"); 22 | Assert.assertEquals(actualLink, expectedLink); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/pages/v11/multifilepageobjectnavibasepagegeneric/NavigatableEShopPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package pages.v11.multifilepageobjectnavibasepagegeneric; 15 | 16 | import core.Driver; 17 | 18 | public abstract class NavigatableEShopPage extends EShopPage { 19 | public NavigatableEShopPage(Driver driver) { 20 | super(driver); 21 | } 22 | 23 | protected abstract String getUrl(); 24 | 25 | public void open() { 26 | driver.goToUrl(getUrl()); 27 | waitForPageLoad(); 28 | } 29 | 30 | protected abstract void waitForPageLoad(); 31 | } 32 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/pages/v11/multifilepageobjectnavibasepagegeneric/multifilepageobjectnavibasepagegeneric.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/pages/v5/singlefilepageobjectnavibasepagesections/NavigatableEShopPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package pages.v5.singlefilepageobjectnavibasepagesections; 15 | 16 | import core.Driver; 17 | 18 | public abstract class NavigatableEShopPage extends EShopPage { 19 | public NavigatableEShopPage(Driver driver) { 20 | super(driver); 21 | } 22 | 23 | protected abstract String getUrl(); 24 | 25 | public void open() { 26 | driver.goToUrl(getUrl()); 27 | waitForPageLoad(); 28 | } 29 | 30 | protected abstract void waitForPageLoad(); 31 | } 32 | -------------------------------------------------------------------------------- /chapter5-tests-maintainability/src/main/java/pages/v6/multifilepageobjectnavibasepagesections/NavigatableEShopPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package pages.v6.multifilepageobjectnavibasepagesections; 15 | 16 | import core.Driver; 17 | 18 | public abstract class NavigatableEShopPage extends EShopPage { 19 | public NavigatableEShopPage(Driver driver) { 20 | super(driver); 21 | } 22 | 23 | protected abstract String getUrl(); 24 | 25 | public void open() { 26 | driver.goToUrl(getUrl()); 27 | waitForPageLoad(); 28 | } 29 | 30 | protected abstract void waitForPageLoad(); 31 | } 32 | -------------------------------------------------------------------------------- /chapter6-api-usability/Chapter 6- API Usability.iml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /chapter6-api-usability/src/main/java/core/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public enum Browser { 17 | CHROME, 18 | FIREFOX, 19 | EDGE, 20 | OPERA, 21 | SAFARI, 22 | INTERNET_EXPLORER 23 | } 24 | -------------------------------------------------------------------------------- /chapter6-api-usability/src/main/java/core/BrowserService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public interface BrowserService { 17 | void start(Browser browser); 18 | 19 | void quit(); 20 | 21 | void waitForAjax(); 22 | 23 | void waitUntilPageLoadsCompletely(); 24 | } 25 | -------------------------------------------------------------------------------- /chapter6-api-usability/src/main/java/core/CookiesService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public interface CookiesService { 17 | // void addCookie(String cookieName, String cookieValue, String path); 18 | // 19 | // void deleteAllCookies(); 20 | // 21 | // void deleteCookie(String cookieName); 22 | // 23 | // List getAllCookies(); 24 | // 25 | // String getCookie(String cookieName); 26 | } 27 | -------------------------------------------------------------------------------- /chapter6-api-usability/src/main/java/core/DialogButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public enum DialogButton { 17 | OK, 18 | CANCEL, 19 | OPEN, 20 | YES, 21 | NO, 22 | CLOSE, 23 | RUN, 24 | SAVE, 25 | } 26 | -------------------------------------------------------------------------------- /chapter6-api-usability/src/main/java/core/DialogService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public interface DialogService { 17 | // void handle(Function function, DialogButton dialogButton); 18 | } 19 | -------------------------------------------------------------------------------- /chapter6-api-usability/src/main/java/core/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public abstract class Driver implements NavigationService, BrowserService, CookiesService, ElementFindService, DialogService { 17 | } -------------------------------------------------------------------------------- /chapter6-api-usability/src/main/java/core/Element.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public abstract class Element { 19 | public abstract By getBy(); 20 | 21 | public abstract String getText(); 22 | 23 | public abstract Boolean isEnabled(); 24 | 25 | public abstract Boolean isDisplayed(); 26 | 27 | public abstract void typeText(String text) throws InterruptedException; 28 | 29 | public abstract void click(); 30 | 31 | public abstract String getAttribute(String attributeName); 32 | 33 | public abstract Element findElement(By locator); 34 | 35 | public abstract void waitToExists(); 36 | } 37 | -------------------------------------------------------------------------------- /chapter6-api-usability/src/main/java/core/ElementFindService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | import java.util.List; 19 | 20 | public interface ElementFindService { 21 | Element findElement(By locator); 22 | 23 | List findElements(By locator); 24 | } 25 | -------------------------------------------------------------------------------- /chapter6-api-usability/src/main/java/core/NavigationService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public interface NavigationService { 17 | void goToUrl(String url); 18 | 19 | String getUrl(); 20 | } 21 | -------------------------------------------------------------------------------- /chapter6-api-usability/src/main/java/pages/v6/multifilepageobjectnavibasepagesections/NavigatableEShopPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package pages.v6.multifilepageobjectnavibasepagesections; 15 | 16 | import core.Driver; 17 | 18 | public abstract class NavigatableEShopPage extends EShopPage { 19 | public NavigatableEShopPage(Driver driver) { 20 | super(driver); 21 | } 22 | 23 | protected abstract String getUrl(); 24 | 25 | public void open() { 26 | driver.goToUrl(getUrl()); 27 | waitForPageLoad(); 28 | } 29 | 30 | protected abstract void waitForPageLoad(); 31 | } 32 | -------------------------------------------------------------------------------- /chapter6-api-usability/src/main/java/pages/v9/multifilepageobjectpagesectionsapp/MainPage/MainPageAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package pages.v9.multifilepageobjectpagesectionsapp.MainPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class MainPageAssertions { 19 | private final MainPageElements elements; 20 | 21 | public MainPageAssertions(MainPageElements mainPageElements) { 22 | elements = mainPageElements; 23 | } 24 | 25 | public void assertProductBoxLink(String name, String expectedLink) { 26 | var actualLink = elements.getProductBoxByName(name).getAttribute("href"); 27 | Assert.assertEquals(actualLink, expectedLink); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public enum Browser { 17 | CHROME, 18 | FIREFOX, 19 | EDGE, 20 | OPERA, 21 | SAFARI, 22 | INTERNET_EXPLORER, 23 | } 24 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/DialogButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public enum DialogButton { 17 | OK, 18 | CANCEL, 19 | OPEN, 20 | YES, 21 | NO, 22 | CLOSE, 23 | RUN, 24 | SAVE, 25 | } 26 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import core.interfaces.*; 17 | 18 | public abstract class Driver implements NavigationService, BrowserService, CookiesService, ElementFindService, DialogService, ElementWaitService { 19 | } -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/interfaces/BrowserService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.interfaces; 15 | 16 | import core.Browser; 17 | 18 | public interface BrowserService { 19 | void start(Browser browser); 20 | 21 | void quit(); 22 | 23 | void waitForAjax(); 24 | 25 | void waitUntilPageLoadsCompletely(); 26 | } 27 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/interfaces/CookiesService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.interfaces; 15 | 16 | public interface CookiesService { 17 | // void addCookie(String cookieName, String cookieValue, String path); 18 | // 19 | // void deleteAllCookies(); 20 | // 21 | // void deleteCookie(String cookieName); 22 | // 23 | // List getAllCookies(); 24 | // 25 | // String getCookie(String cookieName); 26 | } 27 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/interfaces/DialogService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.interfaces; 15 | 16 | public interface DialogService { 17 | // void handle(Function function, DialogButton dialogButton); 18 | } 19 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/interfaces/ElementWaitService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.interfaces; 15 | 16 | import core.Element; 17 | import core.wait.WaitStrategy; 18 | 19 | public interface ElementWaitService { 20 | void wait(Element element, WaitStrategy waitStrategy); 21 | } 22 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/interfaces/NavigationService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.interfaces; 15 | 16 | public interface NavigationService { 17 | void goToUrl(String url); 18 | 19 | String getUrl(); 20 | } 21 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/locators/ClassFindStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.locators; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public class ClassFindStrategy extends FindStrategy { 19 | public ClassFindStrategy(String value) { 20 | super(value); 21 | } 22 | 23 | @Override 24 | public By convert() { 25 | return By.xpath(String.format("//*[@class='%s']", getValue())); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/locators/CssFindStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.locators; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public class CssFindStrategy extends FindStrategy { 19 | public CssFindStrategy(String value) { 20 | super(value); 21 | } 22 | 23 | @Override 24 | public By convert() { 25 | return By.cssSelector(getValue()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/locators/FindStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.locators; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public abstract class FindStrategy { 19 | private final String value; 20 | 21 | protected FindStrategy(String value) { 22 | this.value = value; 23 | } 24 | 25 | public String getValue() { 26 | return value; 27 | } 28 | 29 | public abstract By convert(); 30 | } 31 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/locators/IdContainingFindStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.locators; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public class IdContainingFindStrategy extends FindStrategy { 19 | public IdContainingFindStrategy(String value) { 20 | super(value); 21 | } 22 | 23 | @Override 24 | public By convert() { 25 | return By.cssSelector(String.format("[id*='%s']", getValue())); 26 | } 27 | } -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/locators/IdFindStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.locators; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public class IdFindStrategy extends FindStrategy { 19 | public IdFindStrategy(String value) { 20 | super(value); 21 | } 22 | 23 | @Override 24 | public By convert() { 25 | return By.id(getValue()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/locators/InnerTextContainsFindStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.locators; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public class InnerTextContainsFindStrategy extends FindStrategy { 19 | public InnerTextContainsFindStrategy(String value) { 20 | super(value); 21 | } 22 | 23 | @Override 24 | public By convert() { 25 | return By.xpath(String.format("//*[contains(text(), '%s')]", getValue())); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/locators/LinkTextFindStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.locators; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public class LinkTextFindStrategy extends FindStrategy { 19 | public LinkTextFindStrategy(String value) { 20 | super(value); 21 | } 22 | 23 | @Override 24 | public By convert() { 25 | return By.linkText(getValue()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/locators/TagFindStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.locators; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public class TagFindStrategy extends FindStrategy { 19 | public TagFindStrategy(String value) { 20 | super(value); 21 | } 22 | 23 | @Override 24 | public By convert() { 25 | return By.tagName(getValue()); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/locators/XPathFindStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.locators; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public class XPathFindStrategy extends FindStrategy { 19 | public XPathFindStrategy(String value) { 20 | super(value); 21 | } 22 | 23 | @Override 24 | public By convert() { 25 | return By.xpath(getValue()); 26 | } 27 | 28 | @Override 29 | public String toString() { 30 | return String.format("xpath = %s", getValue()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /chapter7-extensibility/src/main/java/core/wait/Wait.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.wait; 15 | 16 | public class Wait { 17 | public static WaitStrategyFactory to() { 18 | return new WaitStrategyFactory(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/core/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public enum Browser { 17 | CHROME, 18 | FIREFOX, 19 | EDGE, 20 | OPERA, 21 | SAFARI, 22 | INTERNET_EXPLORER, 23 | } 24 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/core/BrowserService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public interface BrowserService { 17 | void start(Browser browser); 18 | 19 | void quit(); 20 | 21 | void waitForAjax(); 22 | 23 | void waitUntilPageLoadsCompletely(); 24 | } 25 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/core/CookiesService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public interface CookiesService { 17 | // void addCookie(String cookieName, String cookieValue, String path); 18 | // 19 | // void deleteAllCookies(); 20 | // 21 | // void deleteCookie(String cookieName); 22 | // 23 | // List getAllCookies(); 24 | // 25 | // String getCookie(String cookieName); 26 | } 27 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/core/DialogButton.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public enum DialogButton { 17 | OK, 18 | CANCEL, 19 | OPEN, 20 | YES, 21 | NO, 22 | CLOSE, 23 | RUN, 24 | SAVE, 25 | } 26 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/core/DialogService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public interface DialogService { 17 | // void handle(Function function, DialogButton dialogButton); 18 | } 19 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/core/Driver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.support.ui.WebDriverWait; 17 | 18 | public abstract class Driver implements NavigationService, BrowserService, CookiesService, ElementFindService, DialogService { 19 | public abstract WebDriverWait getBrowserWait(); 20 | } 21 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/core/Element.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public abstract class Element { 19 | public abstract By getBy(); 20 | 21 | public abstract String getText(); 22 | 23 | public abstract Boolean isEnabled(); 24 | 25 | public abstract Boolean isDisplayed(); 26 | 27 | public abstract void typeText(String text) throws InterruptedException; 28 | 29 | public abstract void click(); 30 | 31 | public abstract String getAttribute(String attributeName); 32 | 33 | public abstract void waitToExists(); 34 | 35 | public abstract Element findElement(By locator); 36 | } 37 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/core/ElementFindService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | import java.util.List; 19 | 20 | public interface ElementFindService { 21 | Element findElement(By locator); 22 | 23 | List findElements(By locator); 24 | } 25 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/core/NavigationService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public interface NavigationService { 17 | void goToUrl(String url); 18 | 19 | String getUrl(); 20 | } 21 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/facadedesignpattern/classic/CheckoutPage/CheckoutAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.classic.CheckoutPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class CheckoutAssertions { 19 | private final CheckoutElements elements; 20 | 21 | public CheckoutAssertions(CheckoutElements elements) { 22 | this.elements = elements; 23 | } 24 | 25 | public void assertOrderReceived() 26 | { 27 | Assert.assertEquals(elements.receivedMessage().getText(), "Order received"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/facadedesignpattern/classic/MainPage/MainPageAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.classic.MainPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class MainPageAssertions { 19 | private final MainPageElements elements; 20 | 21 | public MainPageAssertions(MainPageElements mainPageElements) { 22 | elements = mainPageElements; 23 | } 24 | 25 | public void assertProductBoxLink(String name, String expectedLink) { 26 | var actualLink = elements.getProductBoxByName(name).getAttribute("href"); 27 | Assert.assertEquals(actualLink, expectedLink); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/facadedesignpattern/classic/NavigatableEShopPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.classic; 15 | 16 | import core.Driver; 17 | 18 | public abstract class NavigatableEShopPage extends EShopPage { 19 | public NavigatableEShopPage(Driver driver) { 20 | super(driver); 21 | } 22 | 23 | protected abstract String getUrl(); 24 | 25 | public void open() 26 | { 27 | driver.goToUrl(getUrl()); 28 | waitForPageLoad(); 29 | } 30 | 31 | protected abstract void waitForPageLoad(); 32 | } 33 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/facadedesignpattern/templatemethods/CheckoutPage/CheckoutAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.templatemethods.CheckoutPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class CheckoutAssertions { 19 | private final CheckoutElements elements; 20 | 21 | public CheckoutAssertions(CheckoutElements elements) { 22 | this.elements = elements; 23 | } 24 | 25 | public void assertOrderReceived() 26 | { 27 | Assert.assertEquals(elements.receivedMessage().getText(), "Order received"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/facadedesignpattern/templatemethods/MainPage/MainPageAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.templatemethods.MainPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class MainPageAssertions { 19 | private final MainPageElements elements; 20 | 21 | public MainPageAssertions(MainPageElements mainPageElements) { 22 | elements = mainPageElements; 23 | } 24 | 25 | public void assertProductBoxLink(String name, String expectedLink) 26 | { 27 | var actualLink = elements.getProductBoxByName(name).getAttribute("href"); 28 | Assert.assertEquals(actualLink, expectedLink); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /chapter8-assessment-system/src/main/java/facadedesignpattern/templatemethods/NavigatableEShopPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facadedesignpattern.templatemethods; 15 | 16 | import core.Driver; 17 | 18 | public abstract class NavigatableEShopPage extends EShopPage { 19 | public NavigatableEShopPage(Driver driver) { 20 | super(driver); 21 | } 22 | 23 | protected abstract String getUrl(); 24 | 25 | public void open() 26 | { 27 | driver.goToUrl(getUrl()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/java/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: core.BenchmarkRunner 3 | 4 | -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/java/core/Browser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | public enum Browser { 17 | NOT_SET, 18 | CHROME, 19 | FIREFOX, 20 | EDGE, 21 | OPERA, 22 | SAFARI, 23 | INTERNET_EXPLORER 24 | } 25 | -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/java/core/Element.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core; 15 | 16 | import org.openqa.selenium.By; 17 | 18 | public abstract class Element { 19 | public abstract By getBy(); 20 | 21 | public abstract String getText(); 22 | 23 | public abstract Boolean isEnabled(); 24 | 25 | public abstract Boolean isDisplayed(); 26 | 27 | public abstract void typeText(String text) throws InterruptedException; 28 | 29 | public abstract void click(); 30 | 31 | public abstract String getAttribute(String attributeName); 32 | 33 | public abstract void waitToExists(); 34 | 35 | public abstract Element findElement(By locator); 36 | } 37 | -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/java/core/browserinfrastructure/BrowserBehavior.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.browserinfrastructure; 15 | 16 | public enum BrowserBehavior { 17 | NOT_SET, 18 | REUSE_IF_STARTED, 19 | RESTART_EVERY_TIME, 20 | RESTART_ON_FAIL 21 | } 22 | -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/java/core/browserinfrastructure/ExecutionBrowser.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.browserinfrastructure; 15 | 16 | import core.Browser; 17 | 18 | import java.lang.annotation.ElementType; 19 | import java.lang.annotation.Retention; 20 | import java.lang.annotation.RetentionPolicy; 21 | import java.lang.annotation.Target; 22 | 23 | @Target({ElementType.TYPE, ElementType.METHOD}) 24 | @Retention(RetentionPolicy.RUNTIME) 25 | public @interface ExecutionBrowser { 26 | Browser browser() default Browser.CHROME; 27 | 28 | BrowserBehavior browserBehavior() default BrowserBehavior.RESTART_EVERY_TIME; 29 | } -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/java/core/browserinfrastructure/TestBehaviorObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.browserinfrastructure; 15 | 16 | public interface TestBehaviorObserver { 17 | void preTestInit(Class currentClass); 18 | 19 | void postTestInit(Class currentClass); 20 | 21 | void preTestCleanup(Class currentClass); 22 | 23 | void postTestCleanup(Class currentClass); 24 | 25 | void testInstantiated(Class currentClass); 26 | } 27 | -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/java/core/browserinfrastructure/TestExecutionSubject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package core.browserinfrastructure; 15 | 16 | public interface TestExecutionSubject { 17 | void attach(TestBehaviorObserver observer); 18 | 19 | void detach(TestBehaviorObserver observer); 20 | 21 | void preTestInit(Class currentClass); 22 | 23 | void postTestInit(Class currentClass); 24 | 25 | void preTestCleanup(Class currentClass); 26 | 27 | void postTestCleanup(Class currentClass); 28 | 29 | void testInstantiated(Class currentClass); 30 | } 31 | -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/java/facades/CheckoutPage/CheckoutAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facades.CheckoutPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class CheckoutAssertions { 19 | private final CheckoutElements elements; 20 | 21 | public CheckoutAssertions(CheckoutElements elements) { 22 | this.elements = elements; 23 | } 24 | 25 | public void assertOrderReceived() { 26 | Assert.assertEquals(elements.receivedMessage().getText(), "Order received"); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/java/facades/MainPage/MainPageAssertions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facades.MainPage; 15 | 16 | import org.testng.Assert; 17 | 18 | public class MainPageAssertions { 19 | private final MainPageElements elements; 20 | 21 | public MainPageAssertions(MainPageElements mainPageElements) { 22 | elements = mainPageElements; 23 | } 24 | 25 | public void assertProductBoxLink(String name, String expectedLink) { 26 | var actualLink = elements.getProductBoxByName(name).getAttribute("href"); 27 | Assert.assertEquals(actualLink, expectedLink); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/java/facades/NavigatableEShopPage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facades; 15 | 16 | import core.Driver; 17 | 18 | public abstract class NavigatableEShopPage extends EShopPage { 19 | public NavigatableEShopPage(Driver driver) { 20 | super(driver); 21 | } 22 | 23 | protected abstract String getUrl(); 24 | 25 | public void open() { 26 | driver.goToUrl(getUrl()); 27 | waitForPageLoad(); 28 | } 29 | 30 | protected abstract void waitForPageLoad(); 31 | } 32 | -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/java/facades/Sections/BreadcrumbSection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facades.Sections; 15 | 16 | import core.Driver; 17 | import core.Element; 18 | import org.openqa.selenium.By; 19 | 20 | public class BreadcrumbSection { 21 | private final Driver driver; 22 | 23 | public BreadcrumbSection(Driver driver) { 24 | this.driver = driver; 25 | } 26 | 27 | private Element breadcrumb() { 28 | return driver.findElement(By.className("woocommerce-breadcrumb")); 29 | } 30 | 31 | public void openBreadcrumbItem(String itemToOpen) { 32 | breadcrumb().findElement(By.linkText(itemToOpen)).click(); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/java/facades/Sections/SearchSection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 Automate The Planet Ltd. 3 | * Author: Anton Angelov 4 | * Licensed under the Apache License, Version 2.0 (the "License"); 5 | * You may not use this file except in compliance with the License. 6 | * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 7 | * Unless required by applicable law or agreed to in writing, software 8 | * distributed under the License is distributed on an "AS IS" BASIS, 9 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10 | * See the License for the specific language governing permissions and 11 | * limitations under the License. 12 | */ 13 | 14 | package facades.Sections; 15 | 16 | import core.Driver; 17 | import core.Element; 18 | import org.openqa.selenium.By; 19 | 20 | public class SearchSection { 21 | private final Driver driver; 22 | 23 | public SearchSection(Driver driver) { 24 | this.driver = driver; 25 | } 26 | 27 | private Element searchField() { 28 | return driver.findElement(By.id("woocommerce-product-search-field-0")); 29 | } 30 | 31 | public void searchForItem(String searchText) throws InterruptedException { 32 | searchField().typeText(searchText); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /chapter9-benchmarking/src/main/resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: core.BenchmarkRunner 3 | Class-Path: snakeyaml-1.21.jar j2objc-annotations-1.1.jar testng-7.3.0.j 4 | ar jopt-simple-4.6.jar okhttp-3.11.0.jar httpcore5-h2-5.0.1.jar aopalli 5 | ance-1.0.jar httpclient5-5.0.1.jar httpcore5-5.0.1.jar guice-4.2.2-no_a 6 | op.jar commons-exec-1.3.jar commons-compress-1.20.jar commons-io-2.8.0. 7 | jar selenium-api-3.141.59.jar jcommander-1.78.jar hamcrest-core-1.3.jar 8 | jmh-generator-annprocess-1.19.jar jmh-core-1.19.jar commons-lang3-3.11 9 | .jar animal-sniffer-annotations-1.14.jar jarchivelib-1.1.0.jar ant-1.10 10 | .3.jar selenium-support-3.141.59.jar byte-buddy-1.8.15.jar guava-25.0-j 11 | re.jar selenium-firefox-driver-3.141.59.jar javax.inject-1.jar webdrive 12 | rmanager-4.2.2.jar jsr305-1.3.9.jar slf4j-api-1.7.30.jar selenium-chrom 13 | e-driver-3.141.59.jar gson-2.8.6.jar commons-math3-3.2.jar okio-1.14.0. 14 | jar junit-4.12.jar ant-launcher-1.10.3.jar selenium-remote-driver-3.141 15 | .59.jar commons-codec-1.13.jar error_prone_annotations-2.1.3.jar checke 16 | r-compat-qual-2.0.0.jar jsoup-1.13.1.jar 17 | 18 | -------------------------------------------------------------------------------- /chapter9-benchmarking/target/classes/META-INF/BenchmarkList: -------------------------------------------------------------------------------- 1 | JMH S 20 core.BenchmarkRunner S 62 core.generated.BenchmarkRunner_benchmarkWebDriverClick_jmhTest S 23 benchmarkWebDriverClick S 11 AverageTime E A 1 1 1 E I 1 0 E E I 2 10 E E E E E E E E E U 7 SECONDS E E 2 | -------------------------------------------------------------------------------- /chapter9-benchmarking/target/classes/META-INF/CompilerHints: -------------------------------------------------------------------------------- 1 | dontinline,*.*_all_jmhStub 2 | dontinline,*.*_avgt_jmhStub 3 | dontinline,*.*_sample_jmhStub 4 | dontinline,*.*_ss_jmhStub 5 | dontinline,*.*_thrpt_jmhStub 6 | inline,core/BenchmarkRunner.benchmarkWebDriverClick 7 | inline,core/browserinfrastructure/BaseBenchmark$PluginState.doSetup 8 | inline,core/browserinfrastructure/BaseBenchmark$PluginState.doTearDown 9 | inline,core/browserinfrastructure/BaseBenchmark.setup 10 | inline,core/browserinfrastructure/BaseBenchmark.tearDown 11 | -------------------------------------------------------------------------------- /chapter9-benchmarking/target/classes/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Main-Class: core.BenchmarkRunner 3 | Class-Path: snakeyaml-1.21.jar j2objc-annotations-1.1.jar testng-7.3.0.j 4 | ar jopt-simple-4.6.jar okhttp-3.11.0.jar httpcore5-h2-5.0.1.jar aopalli 5 | ance-1.0.jar httpclient5-5.0.1.jar httpcore5-5.0.1.jar guice-4.2.2-no_a 6 | op.jar commons-exec-1.3.jar commons-compress-1.20.jar commons-io-2.8.0. 7 | jar selenium-api-3.141.59.jar jcommander-1.78.jar hamcrest-core-1.3.jar 8 | jmh-generator-annprocess-1.19.jar jmh-core-1.19.jar commons-lang3-3.11 9 | .jar animal-sniffer-annotations-1.14.jar jarchivelib-1.1.0.jar ant-1.10 10 | .3.jar selenium-support-3.141.59.jar byte-buddy-1.8.15.jar guava-25.0-j 11 | re.jar selenium-firefox-driver-3.141.59.jar javax.inject-1.jar webdrive 12 | rmanager-4.2.2.jar jsr305-1.3.9.jar slf4j-api-1.7.30.jar selenium-chrom 13 | e-driver-3.141.59.jar gson-2.8.6.jar commons-math3-3.2.jar okio-1.14.0. 14 | jar junit-4.12.jar ant-launcher-1.10.3.jar selenium-remote-driver-3.141 15 | .59.jar commons-codec-1.13.jar error_prone_annotations-2.1.3.jar checke 16 | r-compat-qual-2.0.0.jar jsoup-1.13.1.jar 17 | 18 | -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/Chapter 9- Benchmarking.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/Chapter 9- Benchmarking.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/animal-sniffer-annotations-1.14.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/animal-sniffer-annotations-1.14.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/ant-1.10.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/ant-1.10.3.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/ant-launcher-1.10.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/ant-launcher-1.10.3.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/aopalliance-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/aopalliance-1.0.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/byte-buddy-1.8.15.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/byte-buddy-1.8.15.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/checker-compat-qual-2.0.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/checker-compat-qual-2.0.0.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/commons-codec-1.13.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/commons-codec-1.13.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/commons-compress-1.20.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/commons-compress-1.20.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/commons-exec-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/commons-exec-1.3.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/commons-io-2.8.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/commons-io-2.8.0.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/commons-lang3-3.11.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/commons-lang3-3.11.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/commons-math3-3.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/commons-math3-3.2.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/error_prone_annotations-2.1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/error_prone_annotations-2.1.3.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/gson-2.8.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/gson-2.8.6.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/guava-25.0-jre.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/guava-25.0-jre.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/guice-4.2.2-no_aop.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/guice-4.2.2-no_aop.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/hamcrest-core-1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/hamcrest-core-1.3.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/httpclient5-5.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/httpclient5-5.0.1.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/httpcore5-5.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/httpcore5-5.0.1.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/httpcore5-h2-5.0.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/httpcore5-h2-5.0.1.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/j2objc-annotations-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/j2objc-annotations-1.1.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/jarchivelib-1.1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/jarchivelib-1.1.0.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/javax.inject-1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/javax.inject-1.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/jcommander-1.78.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/jcommander-1.78.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/jmh-core-1.19.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/jmh-core-1.19.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/jmh-generator-annprocess-1.19.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/jmh-generator-annprocess-1.19.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/jopt-simple-4.6.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/jopt-simple-4.6.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/jsoup-1.13.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/jsoup-1.13.1.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/jsr305-1.3.9.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/jsr305-1.3.9.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/junit-4.12.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/junit-4.12.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/okhttp-3.11.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/okhttp-3.11.0.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/okio-1.14.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/okio-1.14.0.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/selenium-api-3.141.59.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/selenium-api-3.141.59.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/selenium-chrome-driver-3.141.59.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/selenium-chrome-driver-3.141.59.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/selenium-firefox-driver-3.141.59.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/selenium-firefox-driver-3.141.59.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/selenium-remote-driver-3.141.59.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/selenium-remote-driver-3.141.59.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/selenium-support-3.141.59.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/selenium-support-3.141.59.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/slf4j-api-1.7.30.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/slf4j-api-1.7.30.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/snakeyaml-1.21.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/snakeyaml-1.21.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/testng-7.3.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/testng-7.3.0.jar -------------------------------------------------------------------------------- /out/artifacts/chapter9_benchmarking_jar/webdrivermanager-4.2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AutomateThePlanet/Design-Patterns-for-High-Quality-Automated-Tests-Java-Edition/eb5c5db3bfefabde22eb4bb048d089be211520eb/out/artifacts/chapter9_benchmarking_jar/webdrivermanager-4.2.2.jar --------------------------------------------------------------------------------