It is very easy to use teswiz in your framework. Follow these steps:
- Setup the prerequisites mentioned below [https://github.com/znsio/teswiz#prerequisites]
- Using your favorite IDE (I use IntelliJ Idea Community Edition), create a new Java-Gradle project
- Copy build.gradle.sample file to your newly created project's root folder and rename it to build.gradle
- Validate that build.gradle has the right version of teswiz
- For
android appautomation- Get APP_PACKAGE_NAME - example:
aapt dump badging temp/sampleApps/theapp.apk | grep package - Get APP_ACTIVITY - example:
aapt dump badging temp/ajio-8-3-4.apk | grep activity
- Get APP_PACKAGE_NAME - example:
- For
webautomation- Add
<>_BASE_URLin environments.json - example:THEAPP_BASE_URL=https://the-internet.herokuapp.com - Update
BASE_URLwith the above in config.properties - example:BASE_URL=THEAPP_BASE_URL
- Add
- For
electronautomation- Add
binarypath in browser_config.json - example:"binary": "C:\\path\\to\\chrome.exe" - Add
browserVersionin browser_config.json - example:"browserVersion": "latest"
- Add
- Create config.properties in some folder - ex:
**./configs**and provide default values - refer to src/test/resources/com/znsio/e2e/features/android/configs/theapp_local_config.properties - Create capabilities.json in some folder - ex:
**./caps**- refer to src/test/resources/com/znsio/e2e/features/android/caps/theapp_local_capabilities.json - Update
reportportal.propertiesfile present under 'src/test/resources' with the neccessary details for reporting - Validate the presence of **package.json ** at the root directory and execute npm install
- Implement the test
- Define your scenario in a feature file (
src/test/resources/<package_name>/<feature_dir>) - Create your step definitions (
src/test/java/<package_name>/steps) - Implement your business layer classes/methods (
src/test/java/<package_name>/businessLayer) - Implement your screen classes/methods (
src/test/java/<package_name>/screen) in the corresponding OS (Android/iOS) folders - Setup Applitools Visual AI Testing
- Define your scenario in a feature file (
- Update the run task in build.gradle with appropriate values for config.properties, pathToStepDef, pathToFeaturesDir, pathToLogProperties
- Refer to the Running the tests section