GithubHelp home page GithubHelp logo

aaronksaunders / ionic-e2e-react-webdriverio-appium Goto Github PK

View Code? Open in Web Editor NEW
5.0 3.0 4.0 1.02 MB

Example ReactJS App for Ionic v6 E2E Testing using WebdriverIO and Appium to Test On Device

Java 1.52% TypeScript 82.47% HTML 1.10% CSS 9.92% Swift 4.08% Ruby 0.91%
appium-tests appium-ionic webdriverio ionic-framework ionic6 capacitor appium-android appium-ios

ionic-e2e-react-webdriverio-appium's Introduction

ionic-e2e-react-webdriverio-appium

Example ReactJS App for Ionic v6 E2E Testing using WebdriverIO and Appium to Test On Device

Overview

Looking to integrate e2e testing a an ionic-framework application and the sample provided by Ionic in written in Angular and it is based on cordova and not capacitor so I have started this project to figure things out

  • sample based on the list template provided by ionic
  • source code is in react js
  • tests currently work in android emulator and in the webbrowser
  • This still a work in progress but it is based on latest versions on Ionic and Capacitor so it shoul get on started better than the other sample
  • The project hasn't been cleaned up, there are still some artifacts from the original Ionic Project

IOS Quirk

For the application path for the IOS application, you will need to manually set that based on the specific device/emulator that are deploying to. unlike android it appears that the IOS build is directly to the device.

if you look at line 32 in the wdio.ios.config.ts you will see the path that you will need to change. To get the specific path i have run the build command with the --verbose flag to output the appropriate information

ionic capacitor run ios --target 1DB27F13-4EF3-4D45-A67B-88C69B53EF84 --verbose

Android setup

If you're starting from scratch, you'll need to set appium up on your system.

Generally, you should follow the appium docs, but here's the short version.

Install appium globally:

npm i --location=global appium

Install the Android driver:

appium driver install uiautomator2

Make sure you have a device created in Android Studio's Device Manager.

Build the app as an APK and launch it on the device in the simulator.

In wdio.android.config.ts, modify appium:deviceName to be your device's exact name, and change appium:platformVersion to your device's Android version.

Also ensure the appium:app path is correct for your system.

You can now run the tests:

'npm run ionic-e2e:run:android`

iOS setup

Make sure you have appium installed globally:

npm i --location=global appium

Install the iOS driver:

appium driver install xcuitest

You now need to set up code signing for the webdriveragent app used by the xcuitest driver.

If you do not do this, all your builds will fail with Error 65.

First, open the Xcode project:

open ~/.appium/node_modules/appium-xcuitest-driver/node_modules/appium-webdriveragent/WebDriverAgent.xcodeproj

Then, try to build the project. It will fail and say signing needs to be configured. Click the error message and set up signing for your paid Apple Developer account team.

Save the project and exit.

Next, in Xcode, create a device to use for simulation. Or attach a physical iPhone for testing.

Now list the devices with Xcode command line tools:

xctrace list devices

In wdio.ios.config.ts, you will need to update the following:

  • appium:deviceName: Use your device's name as listed.
  • appium:udid: Add the device ID as listed.
  • appium:platformVersion: Specify the version of iOS used by the device.

You should now be able to run the tests:

'npm run ionic-e2e:run:ios`

References

ionic-e2e-react-webdriverio-appium's People

Contributors

aaronksaunders avatar ptmkenny avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

ionic-e2e-react-webdriverio-appium's Issues

Current status of support for iOS?

Thanks for contributing this; it's very helpful because I tried to convert the Ionic Angular example before I found this and was running into a lot of trouble.

Is iOS supported? The README says tests currently work in android emulator and in the webbrowser, so I'm guessing no, but then there is a note about adding the app path for iOS, so I'm confused.

I tried running npm run ionic-e2e:run:ios but I get an error:

Execution of 2 workers started at 2023-10-09T08:02:31.944Z

Error: spawn appium ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn appium',
  path: 'appium',
  spawnargs: [ '--base-path', '/', '--relaxed-security', '--log', './appium.log' ]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.