Skip to content

Releases: ITArray/automotion-java

2.1.1

03 Jul 05:35
6ec3898
Compare
Choose a tag to compare
  • Fixing all the OS-dependant separators in the system
  • General refactoring

1.4.5

14 Mar 17:04
Compare
Choose a tag to compare

In the version 1.4.5 there are new methods for validation. Also some bug fixes.

  • added methods for validation that element is inside of container with padding

1.4.4

28 Jan 19:54
Compare
Choose a tag to compare

New features:

  • ability to validate that elements have different size.
  • common bug fixes.

1.4.3

30 Dec 16:33
Compare
Choose a tag to compare

The most important features are:

  • fixing for many small issues
  • adapting of drawing results for mobile/web screens

1.4.2

07 Dec 22:39
Compare
Choose a tag to compare

This release includes:

  • Refactoring and re-structuring of the main components
  • improvement of stability and performance
  • added ability to compare the equality for offsets. It covers the testing of bootstrap web pages.
  • possibility to run the tests on a different zoom levels of the page

1.4.1

04 Dec 16:13
Compare
Choose a tag to compare

Visual testing for list of elements

Latest version allows to perform smart advanced verification for list of elements on the web or mobile page.
What You can do:

  • validate if elements are aligned in Grid view / List view
  • validate if elements are not overlapped with each other and have equal sizes
  • validate if elements are placed in one container and overlapped it

These feature allows to cover many different test cases that was impossible to test automatically before. Only 1-2 seconds and result is ready. This is awesome!

Example of usage:

    boolean result = responsiveValidator.init("Grid validation")
            .findElements(page.images())
            .alignedAsGrid(3, 4)
            .areNotOverlappedWithEachOther()
            .withSameSize()
            .insideOf(page.container(), "List View container")
            .drawMap()
            .validate();

   responsiveValidator.generateReport("Home Page");

Upgraded reporting.

In the version 1.4.1 we've added ability to set the Scenario name and Reports name.

Support for EDGE browser

Now You can easy run the tests on EDGE browser. Just need to set the BROWSER=EDGE and download appropriate MicrosoftWebDriver.exe with direct support for EDGE browser

1.4.0 - Responsive UI Validator

29 Nov 20:23
Compare
Choose a tag to compare

Responsive UI Validator

  • Responsive UI Validator allows to validate UI on web or mobile page using lots of criterias. Also it allows tu build thr HTMl report after validation.

        ResponsiveUIValidator uiValidator = new    ResponsiveUIValidator(driver);
    
    
        boolean result = uiValidator.init()
               .findElement({rootEelement}, "Name of element")
               .sameOffsetLeftAs({element} "Panel 1")
               .sameOffsetLeftAs({element} "Button 1")
               .sameOffsetRightAs({element} "Button 2")
               .sameOffsetRightAs({element}, "Button 3)
               .withCssValue("border", "2px", "solid", "#FBDCDC")
               .withCssValue("border-radius", "4px")
               .withoutCssValue("color", "#FFFFFF")
               .sameSizeAs({list_elements},)
               .insideOf({element}, "Container")
               .notOverlapWith({element}, "Other element")
               .withTopElement({element}, 10, 15)
               .changeMetricsUnitsTo(ResponsiveUIValidator.Units.PERCENT)
               .widthBetween(50, 55)
               .heightBetween(90, 95)
               .drawMap()
               .validate();
    
    
        uiValidator.generateReport();
    

1.3.1

12 Nov 09:02
Compare
Choose a tag to compare

This release contains next important items and changes:

  • Support for Selenium 3.0. Now You need to put binary "geckodriver" into src/main/resources/drivers to run tests on Firefox.
  • We added ability to use Automotion for running automation tests on UWP Windows platform. For this just need to add next environment variables:
    • For Windows UWP:

      IS_MOBILE=True
      PLATFORM=Windows
      APP={Application Family Name}!App
      EXECUTOR=http://{host}:{port}
      DEVICE=Device name or ID
      
  • Few bug fixes and approving of stability.

1.2.1

12 Nov 08:28
Compare
Choose a tag to compare

Automotion

This is JAVA library for the running of mobile, web or API automated tests.

Steps to connect

  • Repo:
    • add dependecy:

          <dependency>
              <groupId>net.itarray</groupId>
              <artifactId>automotion</artifactId>
              <version>1.3.0</version>
          </dependency>
      

Steps of adding to the project

  • Create instance of WebDriverFactory and call getDriver:

        WebDriverFactory driverFactory = new WebDriverFactory();
        WebDriver driver = driverFactory.getDriver();
    
  • Extend Your page classes from BaseWebMobileElement class to have access to methods:

        getWebElement(final By by)
        getWebElement(ExpectedCondition<WebElement> expectedCondition)
    
        getMobileElement(final By by, int timeOfWaiting)
        getMobileElement(final By by)
    
        getWebElements(final By by)
        getWebElements(ExpectedCondition<List<WebElement>> expectedCondition)  
    

Steps of using during test run

! Do not forget to put Chrome and Gecko drivers into Your project src/test/resources/drivers !

  • Specify env variables or system properties (example):
    • For Web local run:

      IS_LOCAL=True
      BROWSER=Firefox|Chrome|IE|Safari
      
    • For Web remote run:

      IS_REMOTE=True
      BROWSER=Firefox|Chrome|IE|Safari
      EXECUTOR=http://{host}:{port}/wd/hub
      (optional available with Chrome only) MOBILE_DEVICE_EMULATION=Google Nexus 5|Apple iPhone 6|Samsung Galaxy S5
      
    • For Web Mobile run:

      IS_MOBILE=True
      PLATFORM=Android|iOS
      BROWSER=Chrome|Safari
      EXECUTOR=http://{host}:{port}/wd/hub
      DEVICE=Device name
      
    • For Web Headless run (with PhantomJS without browser):

      IS_HEADLESS=True
      BROWSER=Firefox|Chrome|IE|Safari
      PHANTOM_JS_PATH=C://phantomjs.exe
      
    • For Native Mobile run:

      IS_MOBILE=True
      PLATFORM=Android|iOS
      APP={path_to_app}
      EXECUTOR=http://{host}:{port}/wd/hub
      DEVICE=Device name
      

Possibilities

  • Verification that elements are aligned correctly on the web or mobile page
    • Elements horizontally are aligned correctly:

      PageValidator.elementsAreAlignedHorizontally(List<WebElement> elements) - boolean
      
    • Elements vertically are aligned correctly:

      PageValidator.elementsAreAlignedVertically(List<WebElement> elements) - boolean
      
    • Elements are aligned properly in general:

      PageValidator.elementsAreAlignedProperly(List<WebElement> elements) - boolean
      
  • Helpers that are useful in the very different situations:
    • Generate UUID with specified length:

      Helper.getGeneratedStringWithLength(int length) - String
      
    • Create image file on fly:

      Helper.createFile(String filename) - File. Will be saved in the folder "target/" that is been created after building
      
    • Parse JSON text:

      Parser.getJSONValue(String textToParse, String key) - String
      
    • Parse XML text based on SAX algorithm:

      Parser.getXMLValue(String xmlToParse, String xpath) - String
      Parser.getXMLValues(String xmlToParse, String xpath) - List<String>
      
    • Smart Text finder. Can find the string even in the broken text with corrupted characters:

      TextFinder.textIsFound(String whatToFind, String whereToFind) - bool. Default derivation is 30% (0.3). It means that accuracy of searching will be 70%
      TextFinder.setDerivation(int newValue) - void. New value between 0 and 1.
      
    • Mail checker (IMAP). Possible to connect to any IMAP mail box (Gmail for example) and get the list of mails with access to the mail details.

      MailService mailService = new MailService();
      mailService
                 .setFolder(MailService.MailFolder.INBOX) // (INBOX, SPAM, TRASH)
                 .login(String IMAP_Server, int IMAP_Port, String email, String passwordToEmail);
      
      
      mailService.isLoggedIn()) - boolean
      mailService.getMessageCount() - integer
      mailService.getMessages() - Message[]
      mailService.getLastMessage() - Message - last message
      
    • Language validator. Algorithm based on semantic approach of languages validation on the web page. Allowed methods:

      LanguageChecker.getRecognisedLanguage(String textToValidate) - Optional<LdLocale> 
      Allowed method .get() to get access to the details. E.g LanguageChecker.getRecognisedLanguage(String textToValidate).get().getLanguage() will return "en"
      
      LanguageChecker.isCorrectLanguageOnThePage(WebDriver driver, String lang) - boolean. String lang is 2-chars abbreviature. E.g "en" or "es"
      
    • Web and mobile WebDriver Helpers that are useful in the very different situations:

      • All the methods are collected in both classes: MobileHelper and DriverHelper. The most useful pf them are:

        DriverHelper.scrollDownWeb(WebDriver driver) 
        DriverHelper.scrollUpWeb(WebDriver driver) 
        DriverHelper.scrollDownMobile(AppiumDriver driver)
        DriverHelper.scrollUpMobile(AppiumDriver driver)
        DriverHelper.scrollDownMobile(AppiumDriver driver, int duration) - duration not less than 500ms
        DriverHelper.scrollUpMobile(AppiumDriver driver, int duration) - duration not less than 500ms
        DriverHelper.scrollDownMobileElement(AppiumDriver driver, MobileElement element)
        DriverHelper.scrollUpMobileElement(AppiumDriver driver, MobileElement element)
        DriverHelper.scrollDownMobileElement(AppiumDriver driver, MobileElement element, int duration) - duration not less than 500ms
        DriverHelper.scrollUpMobileElement(AppiumDriver driver, MobileElement element, int duration) - duration not less than 500ms
        
        DriverHelper.hideKeyboard(AppiumDriver driver) - super method that perform hiding of keyboard for Android and iOS
        
        DriverHelper.click(WebDriver driver, WebElement element) - Smart click that will try to click few times
        
        DriverHelper.clickByLocation(WebDriver driver, WebElement element, ClickPoint clickPoint)
        DriverHelper.clickByLocation(AppiumDriver driver, MobileElement element, ClickPoint clickPoint) - methods for clickin on the elements with specified point of click.
        Allowed ClickPoint are: ClickPoint.TOP_LEFT, ClickPoint.TOP_RIGHT, ClickPoint.BOTTOM_LEFT, ClickPoint.BOTTOM_RIGHT, ClickPoint.CENTER
        
        DriverHelper.clickJQuery(WebDriver driver, WebElement element) - click method that is performed by triggering JQuery native method
        
        DriverHelper.waitForPageIsReady(WebDriver driver) - wait for page is loaded and all the backgrounded process are finished
        
        MobileHelper.turnOnWifi() - turn on WiFI on Android Mobile device
        MobileHelper.turnOffWifi() - turn off WiFI on Android Mobile device
        MobileHelper.turnOnMobileData() - turn on Mobile data on Android Mobile device
        MobileHelper.turnOffMobileData() - turn off Mobile data on Android Mobile device
        MobileHelper.turnOnAirplaneMode() - turn on Airplane mode on Android Mobile device
        MobileHelper.turnOffAirplaneMode() - turn off Airplane mode on Android Mobile device
        
        MobileHelper.openAndroidNotifications(AppiumDriver driver) - open notification tray on Android devices
        
  • API calls. This part is very important because allows to perform different kind of HTTP(s) request with parameters.
    • Example of sending POST request:

      new ConnectionFactory(String baseUrl).sendPost(Map map, String endpoint, String token, boolean withMediaFile) - return Map<Integer, String> where Integer is response code and String is response body
      Parameter map contains usual HTTP Pair-Values set of data in the representation of Java Map interface. 
      String endpoint - is the ending of URL e.g "/api/v1/users".
      Parameter boolean withMediaFile is for advanced usage if You want to generate and upload some file
      Parameter token - is authorisation token if we want to perform request with auth. If not, just leave this parameter as empty string
      
    • Example of sending GET request:

      new ConnectionFactory(String baseUrl).sendGet(String endpoint, String token) - return Map<Integer, String> where Integer is response code and String is response body
      String endpoint - is the ending of URL e.g "/api/v1/users?id=1"
      Parameter token - is authorisation token if we want to perform request with auth. If not, just leave this parameter as empty string
      
    • Example of sending PUT request:

      new ConnectionFactory(String baseUrl).sendPut(Map map, String endpoint, String token) - return Map<Integer, String> where Integer is response code and String is response body
      Parameter map contains usual HTTP Pair-Values set of data in the representation of Java Map interface. 
      String endpoint - is the ending of URL e.g "/api/v1/users".
      Parameter token - is authorisation token if we want to perform request with auth. If not, just leave this parameter as empty string
      
    • Example of sending DELETE request:

      new ConnectionFactory(String baseUrl).sendDelete(String endpoint, String token) - return Map<Integer, String> where Integer is response code and String is response body
      String endpoint - is the ending of URL e.g "/api/v1/users?id=1"
      Parameter token - is authorisation token if we want to perform request with auth. If not, just leave this parameter as empty string
      

Contact

Denys Zaiats
[email protected]