Skip to content

Major change in release and requires properties files migration

Compare
Choose a tag to compare
@mkrishna4u mkrishna4u released this 20 Jun 17:39
· 268 commits to main since this release

The major changes in this release are:

  1. Converted all *.properties file to *.yaml file for better configuration. this requires migration from old *.properties to .yaml file by taking the sample file from src/main/resources/sample-config/ directory and copying your key values from *.properties file to corresponding *.yaml files.
    NOTE: Keep the yaml file structure as is but you can still be able to add additional properties as a child properties of additionalProps element.

  2. In your pom.xml file you can specify smart-testauto-framework version to 5.0.0 and change the corresponding versions for other 3rd party libraies as per smart-testauto-framework pom file.

  3. SmartCucumberUiScenarioContext and SmartCucumberApiScenarioContext scenario context classes are very generic and useful to maintain the scenario context among multiple step definitions (that can be defined in single file or in multiple step definition files). Inject these scenario context classes in each Step Definition class file (whichever is applicable). Note scenario must be set in beforeScenario hook (@ Before) and scenarioContext must be closed in afterScenario hook (@ After) to proper maintain the scenario lifecycle and data cleanup.

  4. Java code changes may be required, it is not hard as there is a corresponding implementation provided by the framework.

  5. Generic implementation of relational database is provided using SqlDatabaseActionhandler class that can be registered to database configuration profile and can be accessed using SmartDatabaseManager class. Also if you want to add support for any other database like MongoDB or anything else you can create your database action handler class that should extends AbstractDatabaseActionHandler class and configure it in database profile. After that it will be accessible using SmartDatabasemanager class to perform CRUD operations.

  6. Generic implementation for api crud operations is provided using AbstractApiActionHandler class. You can create your own api action handler class that should extend the AbstractApiActionHandler class and configure it into ApiConfig.yaml file. Refer ApiConfig.yaml present in sample-config directory. After that your api action handler class will be available using SmartApiTestManager class to perform HTTP operations (GET, POST, PUT, DELETE...) on the target server.

  7. You can run test cases in sequential way or parallel way by specifying the system property in mvn command: -Dparallel.threads=. If THREAD-COUNT is 1 then it is not parallel else it will be parallel execution of the thread. Also we have to make sure that in your TestNG TestRunner class you must specify the following code:

    @ CucumberOptions(
    features = {
    "cucumber-testcases/features/ui" },
    plugin = {"pretty", "json:test-results/cucumber-reports/json/smart-testauto-results.json"},
    glue = {"stepdefs.features.ui" }
    )
    @ Listeners(SmartUiTestNGExecutionListener.class)
    public class TestRunner extends AbstractTestNGCucumberTests {
    @ Override
    @ DataProvider(parallel = true)
    public Object[][] scenarios() {
    return super.scenarios();
    }
    }

  8. You can use the configuration from sample projects given below:
    https://github.com/mkrishna4u/smart-testauto-quickstart-java
    https://github.com/mkrishna4u/smart-testauto-quickstart-android-native-java

  9. This upgrade will break the native windows application support using WinAppDriver (From microsoft) as it is not w3c compliant and not selenium 4.2.2 compliant and appium 8.x.x version does not support it. But still you can use *SI classes to perform operations on windows applications.

  10. This version support fully data driven test automation that you can extends by adding your own database action handlers and api action handlers.

  11. OrmDatabaseHandler class is removed in support to SqlDatabaseActionHandler class and SmartDatabaseManager.