All Projects → me-io → appium-driver-codeception

me-io / appium-driver-codeception

Licence: MIT license
Appium Driver for codeception

Programming Languages

PHP
23972 projects - #3 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to appium-driver-codeception

ios-ui-automation-overview
An overview of popular iOS UI testing solutions.
Stars: ✭ 23 (+21.05%)
Mutual labels:  appium, automation-test
codeception
▶️ Integration of Nette Framework to Codeception.
Stars: ✭ 27 (+42.11%)
Mutual labels:  codeception
Cerberus Source
User-friendly automated testing framework.
Stars: ✭ 172 (+805.26%)
Mutual labels:  appium
Autoline
建议你使用更新的AutoLink平台
Stars: ✭ 227 (+1094.74%)
Mutual labels:  appium
Selenium Jupiter
JUnit 5 extension for Selenium WebDriver
Stars: ✭ 185 (+873.68%)
Mutual labels:  appium
codeception-db-populator
Codeception DB module addon for populate database
Stars: ✭ 19 (+0%)
Mutual labels:  codeception
Scrapingoutsourcing
ScrapingOutsourcing专注分享爬虫代码 尽量每周更新一个
Stars: ✭ 164 (+763.16%)
Mutual labels:  appium
web-ui
python+selenium+pytest+allure UI 自动化框架
Stars: ✭ 199 (+947.37%)
Mutual labels:  appium
Crud
CRUD PORTO Containers for apiato and Angular2 modules generator, based on Laravel 5.4 and Angular 2.4+
Stars: ✭ 23 (+21.05%)
Mutual labels:  codeception
Mastering Junit5
A comprehensive collection of test examples created with JUnit 5
Stars: ✭ 223 (+1073.68%)
Mutual labels:  appium
Appium
📱 Automation for iOS, Android, and Windows Apps.
Stars: ✭ 14,469 (+76052.63%)
Mutual labels:  appium
Winappdriver
Windows Application Driver
Stars: ✭ 2,577 (+13463.16%)
Mutual labels:  appium
codeigniter-tettei-apps
『CodeIgniter徹底入門』のサンプルアプリケーション(CodeIgniter v3.1版)
Stars: ✭ 26 (+36.84%)
Mutual labels:  codeception
Appium
Python Appium objectpage
Stars: ✭ 180 (+847.37%)
Mutual labels:  appium
Codeception
Full-stack testing PHP framework
Stars: ✭ 4,401 (+23063.16%)
Mutual labels:  codeception
Automationtest
自动化测试,支持接口自动化、WEB UI自动化、APP UI自动化、性能测试
Stars: ✭ 171 (+800%)
Mutual labels:  appium
Reporting
Zebrunner Reporting Tool
Stars: ✭ 198 (+942.11%)
Mutual labels:  appium
Selion
Enabling Test Automation in Java
Stars: ✭ 252 (+1226.32%)
Mutual labels:  appium
clearth
Test automation tool for Clearing, Settlement and Back-Office Systems
Stars: ✭ 26 (+36.84%)
Mutual labels:  automation-test
symfony-skeleton
Skeleton rest-api based on symfony
Stars: ✭ 15 (-21.05%)
Mutual labels:  codeception

Appium Driver for Codeception

Appium driver for codeception for writing mobile tests.


Build Status downloads MIT License Donate

All Contributors PRs Welcome Code of Conduct Watch on GitHub Star on GitHub Tweet

Requirement

  1. PHP >= 7.0
  2. Appium
  3. Inspect App with Appium Desktop
  4. Devices:
    • Android
    • iOS
      • Install Xcode from the following link or run the following command inside your terminal:
        xcode-select --install
      • Install the Carthage dependency manager:
        brew install carthage

Table of Contents

Install

Just add me-io/appium-driver-codeception to your project's composer.json file:

{
    "require": {
        "me-io/appium-driver-codeception": "~1"
    }
}

and then run composer install. This will install codeception appium driver and all it's dependencies. Or run the following command

composer require me-io/appium-driver-codeception

Tests

Now lets run the following command at the root directory of your project:

codecept bootstrap

This command will creates a configuration file for codeception and tests directory and default test suites.

Writing tests for Android

Now, lets create a new configuration file android.suite.yml inside tests directory and put the following contents inside of it.

class_name: AndroidGuy
modules:
  enabled:
    # Enable appium driver
    - \Appium\AppiumDriver 
    -  Asserts
  config:
    # Configuration for appium driver
    \Appium\AppiumDriver:
      host: 0.0.0.0
      port: 4723
      dummyRemote: false
      resetAfterSuite: true
      resetAfterCest: false
      resetAfterTest: false
      resetAfterStep: false
      capabilities:
        platformName: 'Android'
        deviceName: 'Android device'
        automationName: 'Appium'
        appPackage: io.selendroid.testapp
        fullReset: false
        noReset: false
        newCommandTimeout: 7200
        nativeInstrumentsLib: true
        connection_timeout: 500
        request_timeout: 500
        autoAcceptAlerts: true
        appActivity: io.selendroid.testapp.HomeScreenActivity
        skipUnlock: true

Note: deviceName should be set as Android device only for real device. For Android Emulator use the name of the virtual device.

Writing tests for iOS

Now, lets create a new configuration file ios.suite.yml inside tests directory and put the following contents inside of it.

class_name: IosGuy
modules:
  enabled:
    # Enable appium driver
    - \Appium\AppiumDriver
    -  Asserts
  config:
    # Configuration for appium driver
    \Appium\AppiumDriver:
      host: 0.0.0.0
      port: 4723
      dummyRemote: false
      resetAfterSuite: true
      resetAfterCest: false
      resetAfterTest: false
      resetAfterStep: false
      capabilities:
        # PATH OF YOUR APP (something like  /Users/username/Documents/ios.app)
        app: ''
        # xcideOrgId is Apple developer team identifier string.
        xcodeOrgId: ''
        # xcodeSigningId is a string representing a signing certificate. iPhone Developer by default.
        xcodeSigningId: 'iPhone Developer'
        platformName: 'iOS'
        platformVersion: '11.2'
        deviceName: 'iPhone8'
        # Your device udid
        udid: ''
        useNewWDA: false
        newCommandTimeout: 7200
        automationName: 'XCUITest'
        autoAcceptAlerts: true
        fullReset: false
        noReset: true
        nativeInstrumentsLib: true
        connection_timeout: 500
        request_timeout: 500
        skipUnlock: true
        clearSystemFiles: true
        showIOSLog: true

Generating Actor classes

Now we need to generate actor class for the AndroidGuy/IosGuy that we defined in android.suite.yml/ios.suite.yml. To generate the actor class for AndroidGuy/IosGuy run the following command inside your terminal:

codecept build

Your First Android Test

To create your first android test create a new directory android inside tests folder. After creating the android folder create a new file FirstAndroidCest.php and put the following contents inside of it:

class FirstAndroidCest
{
    public function changeLanguage(AndroidGuy $I)
    {
        $I->implicitWait([
            'ms' => 3500,
        ]);
        $text = $I->byId('id_of_button')->getText();
        $I->assertEquals('Hello, World!', $text);
    }
}

Your First iOS Test

To create your first iOS test create a new directory ios inside tests folder. After creating the ios directory create a new file FirstIosCest.php and put the following contents inside of it:

class FirstIosCest
{
    public function lockPhone(Ios $I)
    {
        $I->implicitWait([
            'ms' => 10000,
        ]);
        $I->assertEquals('Hello, World!', 'Hello, World!');
        $I->amGoingTo("lock phone");
        $I->lock([null]);
    }
}

Running tests

Run the appium server by running the following command:

appium

NOTE: If you want to change IP/Port run the appium command like this:

appium -a <IP Address> -p <Port>

After running the appium server now you need to start android emulator and install the application that you want to test. If you don't know how to start the emulator you can follow the following guide Setup Genymotion Android Emulators on Mac OS

Now run the following command inside your terminal to run the tests:

# For Android
codecept run android FirstAndroidCest.php --steps

# For iOS
codecept run ios FirstIosCest.php --steps

Note: While following the steps that are mentioned here if you get codecept command not found error try to run codecept command like this ./vendor/bin/codecept.

Contributors

A huge thanks to all of our contributors:


Mohamed Meabed

💻 📢

Zeeshan Ahmad

💻 🐛 ⚠️ 📖

License

The code is available under the MIT license.

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].