All Projects → znsio → teswiz

znsio / teswiz

Licence: MIT license
End-2-End framework for Native & Web Automation using Cucumber-jvm, Appium, Selenium WebDriver, Applitools & ReportPortal

Programming Languages

java
68154 projects - #9 most used programming language
Gherkin
971 projects
shell
77523 projects

Projects that are alternatives of or similar to teswiz

Mobileautomationframework
Single code base framework to test android and iOS app using appium (v6.1.0), maven, testng,java. Option to start appium server programmatically.
Stars: ✭ 66 (+164%)
Mutual labels:  cucumber, appium
Appiumtestdistribution
A tool for running android and iOS appium tests in parallel across devices... U like it STAR it !
Stars: ✭ 764 (+2956%)
Mutual labels:  cucumber, appium
mocha-cakes-2
A BDD plugin for Mocha testing framework
Stars: ✭ 44 (+76%)
Mutual labels:  cucumber
scenari
Clojure BDD library - Executable Specification with Behavior-Driven Development
Stars: ✭ 57 (+128%)
Mutual labels:  cucumber
allure-ruby
Allure integrations for Ruby test frameworks
Stars: ✭ 40 (+60%)
Mutual labels:  cucumber
base project for web automation projects
base project with example for web automation projects with serenity BDD, screenplay and cucumber
Stars: ✭ 17 (-32%)
Mutual labels:  cucumber
jdi-light
Powerful Framework for UI Automation Testing on Java
Stars: ✭ 84 (+236%)
Mutual labels:  applitools
karate
Test Automation Made Simple
Stars: ✭ 6,384 (+25436%)
Mutual labels:  cucumber
vscode-cucumber
Code snippets to write scenarios faster + Syntax highlight for .feature files
Stars: ✭ 24 (-4%)
Mutual labels:  cucumber
cucumber-performance
A performance testing framework for cucumber
Stars: ✭ 28 (+12%)
Mutual labels:  cucumber
codeceptjs-bdd
Javascript BDD UI Automation Framework. Exclusive LWC Shadow DOM Support. Playwright, Webdriver.io, Appium, Saucelabs.
Stars: ✭ 35 (+40%)
Mutual labels:  cucumber
restassured
Includes complete source code of restassured java discussed in the youtube and udemy course
Stars: ✭ 55 (+120%)
Mutual labels:  cucumber
capybara select2
Capybara helpers for https://select2.org select box (supports Select2 version 2/3/4)
Stars: ✭ 48 (+92%)
Mutual labels:  cucumber
verification-tests
Blackbox test suite for OpenShift.
Stars: ✭ 41 (+64%)
Mutual labels:  cucumber
kekiri
A .NET framework that supports writing low-ceremony BDD tests using Gherkin language
Stars: ✭ 19 (-24%)
Mutual labels:  cucumber
Appium
This is Chirag... and this Repo for Appium code...... You can see Appium tutorial video at given you tube channel
Stars: ✭ 23 (-8%)
Mutual labels:  appium
appium-dashboard-plugin
Appium plugin that provides complete test logs, video recording of test and device logs(logcat and syslogs) for easy debugging.
Stars: ✭ 82 (+228%)
Mutual labels:  appium
MasterAppiumFramework
Automation Testing | Mobile | Java | OOPS | Appium | TestNG | Maven | ExtentReport | Java mail API | Logging (Log4J2) | Design Patterns (Page Object Model, Singleton) | Page Factories | Jenkins | Data-Driven Testing using JSON file | Expected Data using XML file
Stars: ✭ 27 (+8%)
Mutual labels:  appium
robotframework-anywherelibrary
AnywhereLibrary is a cross platform(desktop browser,Android,iOS) testing library for Robot Framework that leverages the [Selenium 2(WebDriver)] libraries internally to control a web browser and [appium] as mobile test automation framework for use with native and hybrid app.
Stars: ✭ 62 (+148%)
Mutual labels:  appium
Selenium-Foundation
Selenium Foundation is an automation framework designed to extend and enhance the capabilities provided by Selenium (WebDriver).
Stars: ✭ 51 (+104%)
Mutual labels:  appium

0.0.3 0.0.3 CI CodeQL

Important changes:

flowchart LR
  id(BROWSER_CONFIG_FILE - Provide custom browser configuration) 
flowchart LR;
  id1(driver.waitForVisibilityOf)--is now changed to---id2(driver.waitForClickabilityOf);
  style id1 fill:#f9f
  style id2 fill:#bbf

What is this repository about?

This repository implements automated tests for Android & iOS apps, specified using cucumber-jvm and intelligently run them against

  • Android
  • iOS
  • Windows Apps
  • Web

Applitools (https://applitools.com/) Visual AI, and Applitools Ultrafast Grid (https://applitools.com/product-ultrafast-test-cloud/) is integrated with this framework, to provide Visual AI testing as part of functional automation.

Reports will be uploaded to reportportal.io, that you would need to setup separately, and provide the server details in src/test/resources/reportportal.properties file or provide the path to the file using this environment variable: REPORT_PORTAL_FILE

Test can run on local browsers / devices, or against any cloud provider, such as HeadSpin, BrowserStack, SauceLabs, pCloudy.

Tech stack used

Getting Started, or how can you use teswiz?

It is very easy to use teswiz in your framework. Follow these steps:

  1. Setup the prerequisites mentioned below [https://github.com/znsio/teswiz#prerequisites]
  2. Using your favorite IDE (I use IntelliJ Idea Community Edition), create a new Java-Gradle project
  3. Copy build.gradle.sample file to your newly created project's root folder and rename it to build.gradle
  4. Create capabilities.json in some folder - ex: ./capabilities - refer to src/test/resources/com/znsio/e2e/features/android/caps/capabilities.json
  5. Create config.properties in some folder - ex: ./configurations and provide default values - refer to src/test/resources/com/znsio/e2e/features/android/configs/config.properties
  6. Update the run task in build.gradle with appropriate values for config.properties, pathToStepDef, pathToFeaturesDir, pathToLogProperties
  7. Refer to the Running the tests section

Prerequisites

Running the tests

Run on Android

To run all the tests against the Android platform, run the following command:

PLATFORM=android ./gradlew run

Run on Local devices:

The framework, by default, automatically figures out if there are multiple devices connected to the machine, and if so, will run the tests in parallel

Run on pCloudy's Device Farm:

To enable running the tests on pCloudy's Device Farm, the following additional environment variables need to be provided:

  • RUN_IN_CI=true - Default is false
  • CLOUD_USER - pCloudy username
  • CLOUD_KEY - pCloudy password

Sample command:

PLATFORM=android RUN_IN_CI=true CLOUD_USER=myusername CLOUD_KEY=abcd1234abcd ./gradlew run

For other cloud configurations, refer here: https://github.com/AppiumTestDistribution/AppiumTestDistribution

Run on iOS

PLATFORM=iOS ./gradlew run

Run on Windows

PLATFORM=windows ./gradlew run

Run on Web

PLATFORM=web ./gradlew run

Running Multi-User simulations

The framework now supports running multiuser scenarios. This means 1 cucumber scenario can orchestrate the interaction between multiple instances of the application-under-test in multiple platforms - ex: Android and Web

Example:

multi-user-example-annotated.png

In the above example You can run these tests as below:

To run tests on android & web platforms

TAG=@multiuser-android-web

Current restriction - 1 android device & max 2 web browsers

To run tests on web platforms

TAG=@multiuser-web-web 

Current restriction - max 2 web browsers

Running Multi-User scenarios in Mobile Emulation View of Web Browsers

The framework now supports launching web browsers in Mobile Emulation View. Instead of passing simple browser names in steps like 'chrome', 'firefox', etc, you can pass more informative parameters like 'chrome-mobile1', 'safari-mobile2', etc

These informative parameters refer to Browser Config json file for actual device names

Example:

mobile-emulation-on-web-browser.png

Additional configurations

Running the tests with Applitools Visual AI

To enable Applitools Visual Testing in your test execution, the following additional environment variables need to be provided:

  • IS_VISUAL=true - to enable Visual Testing using Applitools
  • APPLITOOLS_API_KEY=<API_KEY> - Sets the API key as provided by Applitools
  • To run Visual Tests against dedicated Applitools instance, add a property serverUrl in applitools_config.json. Ex: "serverUrl": "https://eyesapi.applitools.com"
    • By Default, the free public Applitools cloud will be used

To enable Applitools Ultrafast Grid, follow these steps:

  • In applitools_config.json, setuseUFG": true
  • In applitools_config.json, set testConcurrency": 5 to the appropriate concurrency level as per your Applitools license
  • In RunCukesTest file, or any file where you have your custom hooks, add the following lines:
import com.applitools.eyes.selenium.*;
import com.applitools.eyes.visualgrid.model.*;

In beforeScenario, add the specific browser and device configurations to Configuration and add that to the TestExecutionContext - context as shown below:

@Before
public void beforeTestScenario (Scenario scenario) {
    LOGGER.info(String.format("ThreadID: %d: in overridden beforeTestScenario%n", Thread.currentThread().getId()));
    Configuration ufgConfig = new Configuration();
    ufgConfig.addBrowser(1024, 1024, BrowserType.CHROME);
    ufgConfig.addBrowser(1024, 1024, BrowserType.FIREFOX);
    ufgConfig.addDeviceEmulation(DeviceName.iPhone_X, ScreenOrientation.PORTRAIT);
    ufgConfig.addDeviceEmulation(DeviceName.OnePlus_7T_Pro, ScreenOrientation.LANDSCAPE);
    context.addTestState(APPLITOOLS.UFG_CONFIG, ufgConfig);
}

IF you have useUFG set to true, and if you do not specify the Ultrafast Grid configuration, then teswiz has a default set of browser and devices specified which will be used for Visual Validation. The default configuration is shown below:

  ufgConfig.addBrowser(1024, 1024, BrowserType.CHROME);
  ufgConfig.addBrowser(1024, 1024, BrowserType.FIREFOX);
  ufgConfig.addBrowser(1024, 1024, BrowserType.SAFARI);
  ufgConfig.addBrowser(1024, 1024, BrowserType.EDGE_CHROMIUM);
  ufgConfig.addBrowser(1600, 1200, BrowserType.CHROME);
  ufgConfig.addBrowser(1600, 1200, BrowserType.FIREFOX);
  ufgConfig.addBrowser(1600, 1200, BrowserType.SAFARI);
  ufgConfig.addBrowser(1600, 1200, BrowserType.EDGE_CHROMIUM);
  ufgConfig.addDeviceEmulation(DeviceName.iPhone_X, ScreenOrientation.PORTRAIT);
  ufgConfig.addDeviceEmulation(DeviceName.iPad_Pro, ScreenOrientation.LANDSCAPE);
  ufgConfig.addDeviceEmulation(DeviceName.Nexus_5X, ScreenOrientation.PORTRAIT);
  ufgConfig.addDeviceEmulation(DeviceName.Nexus_6P, ScreenOrientation.LANDSCAPE);

Running a subset of tests:

To run a subset of tests, for a given platform, the following additional environment variables need to be provided:

  • TAG=@schedule - This will run all tests tagged with the platform name provided, except tests tagged as "@wip"
  • TAG="@schedule and @signup" - This will run all tests tagged with the name schedule AND signup for the platform name provided, except tests tagged as "@wip"
  • TAG="@schedule or @signup" - This will run all tests tagged with the name schedule OR signup for the platform name provided, except tests tagged as "@wip"

Sample commands:

PLATFORM=android TAG=@schedule ./gradlew run`

PLATFORM=android TAG="@schedule and @signup" ./gradlew run`

PLATFORM=android TAG="@schedule or @signup" ./gradlew run`

Using a different apk for execution (Android):

To run tests using a specific apk (instead of the one specified in caps/capabilities.json, OR, caps/pcloudy_capabilties.json, the following additional environment variable need to be provided:

  • APP_PATH='<path to apk>'

Sample command:

APP_PATH=~/Downloads/MyLatestApp.apk PLATFORM=android ./gradlew run

Configuration parameters

The config.properties file has the following properties. Highlighting the defaults, and options for each here.

These can be overridden by providing the same either as environment variables or system properties.

# ATD properties
RUNNER=distribute -> ATD property. We will always use distributed
FRAMEWORK=cucumber -> ATD property. We will always use cucumber
RUNNER_LEVEL=methods -> ATD property. We will always use methods
CAPS=./caps/capabilities.json -> Path to capabilties.json file

# teswiz configuration properties. Can be overridden using environment variables or system properties

APP_NAME=teswiz -> Name of your application
APP_PACKAGE_NAME=io.cloudgrey.the_app -> android app package name
APP_PATH=./temp/abc.apk -> path to android / windows app name
APPLITOOLS_CONFIGURATION=./configs/applitools_config.json -> Applitools configuration 
BASE_URL_FOR_WEB=BASE_URL -> Key name of the property in TEST_DATA_FILE for environment specific base url
BROWSER=chrome -> Which browser to use for Web execution? Supported: chrome || firefox
                  Browsers should to be installed. Corresponding WebDriver for the browser will be downloaded automatically
BUILD_ID=BUILDID -> The key name of the environment variable that has the corresponding build id of the test execution
CLEANUP_DEVICE_BEFORE_STARTING_EXECUTION=true -> Uninstall app from local Android devices before starting test execution
CLOUD_KEY=<auth / api key> for pCloudy / Headspin
CLOUD_USER=<username / email> for pCloudy -> Not required for Headspin
CLOUD_NAME=headspin|pCloudy -> REQUIRED when running against pCloudy / Headspin
CLOUD_UPLOAD_APP=false -> Upload the app to pCloudy / headspin before running the tests
DEVICE_LAB_URL=<root url for device farm>
ENVIRONMENT_CONFIG_FILE=./src/test/resources/environments.json -> Environment specific configuration file
IS_VISUAL=false -> Should enable Applitools Visual Testing? If yes, set to true
LOG_DIR=target -> Where should logs be created?
LOG_PROPERTIES_FILE=./src/test/resources/log4j.properties -> log4j configuration file
MAX_NUMBER_OF_APPIUM_DRIVERS -> The max number of drivers on cloud to create for multiuser android tests, default value is 5
MAX_NUMBER_OF_WEB_DRIVERS -> The max number of web drivers on cloud to create for multiuser web tests, default value is 5
PLATFORM=android -> Run tests against? Supported: android | iOS | windows | web
PARALLEL=1 -> How many tests should be run in parallel?
PROXY_KEY=HTTP_PROXY -> If proxy should be set, what is the environment variable specifying the proxy?
PROXY_URL=<proxy_url> -> What is the proxy url to be used if PROXY_KEY is set
WEBDRIVER_MANAGER_PROXY_KEY=HTTP_PROXY -> If proxy should be used for WebDriverManager, what is the environment variable specifying the proxy?
WEBDRIVER_MANAGER_PROXY_URL=<proxy_url> -> What is the proxy url to be used for WebDriverManager if WEBDRIVER_MANAGER_PROXY_KEY is set
REMOTE_WEBDRIVER_GRID_PORT=<environment variable name which holds the port to be used for RemoteWebDriver>
REPORT_PORTAL_FILE=src/test/resources/reportportal.properties -> ReportPortal.io configuration
RUN_IN_CI=false -> Are tests running in CI?
TARGET_ENVIRONMENT=prod -> Which environment are the tests running against? Should map to envrionments specified in ENVIRONMENT_CONFIG_FILE
TEST_DATA_FILE=./src/test/resources/testData.json -> Environment specific static test data
BROWSER_CONFIG_FILE=./src/test/resources/com/znsio/e2e/features/configs/browser_config.json -> json containing browser configurations

Troubleshooting / FAQs

Setting Environment Variables:

You can set environment variables

From Mac OSX or Linux:

export PLATFORM=android

From Windows:

set PLATFORM=android
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].