Browsed by
Author: Tyler Deren

Appium and Protractor for real device automated testing (Mac OS/iOS 10.3+)

Appium and Protractor for real device automated testing (Mac OS/iOS 10.3+)

Recently, I had a client who requested their protractor integration tests for a Angular application be set-up so that they are capable of running on a local testing environment using real device hardware. After going through the official ‘Getting Started’ guides for Appium, I felt they did not provide enough detail to get things running smoothly with Protractor and a web application. This guide should provide a comprehensive one-stop solution if you are having problems setting up Appium and Protractor with a web application. This article will only focus on setting up a local test environment for Mac OS using Appium, Protractor and a iPad Mini connected to the Mac OS with a USB cable.

Java, XCode and Homebrew Setup Guide

  1. The first step is to install the Java JDK from the official Oracle page and only has to be done if you do not yet have the Java JDK installed. Go to the Java JDK page and select the Java SE Development Kit for your operating system. For this article, I will be using Mac OS X. Once the binary has finished downloading, install the Java JDK.
  2. The next step is to install XCode. Only follow this step if you do not have XCode installed. The easiest way to install this would be to go to the Mac App Store and search for ‘XCode’.
  3. Once XCode is installed, we need an optional component called XCode Command-line tools. You can install these by opening up the terminal and typing xcode-select --install
  4. Next, install Homebrew by entering the following into the terminal:  ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  5. Update our bash profile:  nano ~/.bash_profile and then enter  export JAVA_HOME=$(/usr/libexec/java_home) Save the file and exit.
  6. At this point, it might be a good idea to close your current terminal window and fire up a new instance of one.

Install Node and Appium

  1. With Homebrew installed, we gain access to the helpful  brew  terminal command. Let’s update Homebrew by entering  brew update .
  2. Next, install Node:  brew install node
  3. Once Node is installed, it also installs the Node Package Manager (NPM). Let’s update npm:  npm install -g npm Note: If you receive an error like ‘npm command not found’, try closing your current terminal window and opening another.
  4. Once our initial dependencies are met, it’s time to install Appium. Enter  npm install -g appium in the terminal window to install appium globally.
  5. Next, install wd.js with npm install wd  wd is a library designed to be a maleable implementation of the webdriver protocol in Node, exposing functionality via a number of programming paradigms.
  6. Next we need Carthage, a web server and opinionated framework for building data manipulation-centric API services in Node.js for web, mobile or IoT apps.
    1. cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent
    2. brew install carthage
    3. npm i -g webpack
    4. ./Scripts/bootstrap.sh -d
  7. Appium has another dependency when doing real-device testing, libimobiledevice, a cross-platform software library that talks the protocols to support iPhone®, iPod Touch®, iPad® and Apple TV® devices. Install it by entering  brew install libimobiledevice into the terminal

Verify Prerequisites are met with Appium Doctor

  1. appium-doctor is a handy utility which verifies you have all of the necessary dependencies top properly run Appium against the environment you specify.  npm install -g appium-doctor to install Appium Doctor
  2. Run appium doctor with  appium-doctor --ios
  3. Examine the output. If Appium Doctor complains that you are missing something, verify you never missed a step.

Install iOS Deploy and iOS Debug Proxy

  1. At this point, we have all of the dependencies to run Appium. However, for automated testing on a iPad device we need additional dependencies in order to properly run our Protractor integration tests. The first of these is ios-deploy. Install it through npm:  npm install -g ios-deploy
  2. Finally, we need the iOS WebKit Debug Proxy (iwdp) which proxies requests from usbmuxd daemon over a websocket connection, allowing developers to send commands to MobileSafari and UIWebViews on real and simulated iOS devices. Install it via  brew install ios-webkit-debug-proxy

Setting up Protractor Capabilities

  1. For real (local) device testing, you need a valid  xcodeOrgId ,  xcodeSigningId and  udid in your protractor capabilities
    1. xcodeOrgId: APPLE TEAM ID
    2. xcodeSigningId: ‘iPhone Developer’
    3. autoWebview: true,
    4. udid: ‘auto’
  2. The Apple Team ID can be found on the Apple Developer page. Do not change the xcodeSigningId value.
  3. The udid is the unique ID for the real iOS device you have connected to your Mac. Set the value to ‘auto’ for automatic detection

Putting it all together

  1. Once everything is installed, let’s start the appium REST server and the iOS Debug Proxy. First, appium can be started by entering  appium in the terminal. Give it some time to boot up.
  2. Launch the iOS Debug Proxy  ios_webkit_debug_proxy -c null:27753,:27753-27853
  3. Run your Protractor tests:  protractor conf.ipad-dev.js --baseUrl="http://myUrl.com" --specs="path/to/my/test"
  4. For completeness, here are my protractor capabilities:

 

Note: If you get ‘cannot find webview, retrying.’ errors ad infinitum, do the following:

brew reinstall --HEAD libimobiledevice

brew reinstall -s ios-webkit-debug-proxy

Conclusion

That’s it! Your Protractor tests should now be running on a real device. I ran into a lot of trouble getting Appium set-up for real devices, and every source I found on the web only had pieces of the final solution. This article was written with the fabulous help of many people and I hope it can provide some measure of assistance if you are experiencing the same issues I was when trying to get Appium running with Protractor and a real iOS 10.3+ device (iPad Mini 2).

Alpha Demo Changelog (0.90.3-alpha)

Alpha Demo Changelog (0.90.3-alpha)

I have updated the Alpha Demo to v.0.90.3-alpha. You can download the update via your download page. If you have not received an e-mail with your download link, or have lost your download link, send us an e-mail or message us on Kickstarter: info@somethingclassic.net.

v.0.90.3-alpha Change Log:
Crash Fix: Fixed game crash when you open the menu by pressing X and S simultaneously and then immediately pressing Z, X and S simultaneously while on the world map.
Crash fix: Fixed crash where game would freeze if you entered a battle with 0 HP and then used a Revive.
Crash Fix: bug where the final boat sailing scene does not load. (0.90.0 works but 0.90.2 does not)
Crash Fix: Fixed crash involving broken inns caused by 0.90.2 update (0.90.0 has working inns)
– Fixed bug where talking to Captain Blackrot does not show the choice window.
– Potential fix for performance degradation on Wind Tower base screen and Wind Tower boss fight.
– Performance: Reduction in RAM usage on game start.
– Mac OS X: Fixed crash where loading bar freezes on game start.

If you have not yet filled out the survey, and you bought a gravestone, NPC or quest tier, please fill out your survey as soon as possible so we can get your content created. If you lost your survey, send us an e-mail or a Kickstarter message.

Alpha Demo Release!

Alpha Demo Release!

Hi all,

To those who pledged at the Dradoran Soldier tier ($12) or higher, you should be receiving an email today from Humble Bundle with links to the Shadows of Adam alpha build! There are multiple versions to choose from. Currently, we support Windows 7, 8, 10, Mac OS X 10.8+, Ubuntu 12.04+, Fedora 21, Debian 8.

We worked tirelessly the last few months to make this alpha as great as possible for you all, but it’s possible we may have overlooked something. If that is the case, we’d love to hear from you on our forums!

SoA Forums:
https://forums.shadowsofadam.com/

SoA Bug Report Forum:
https://forums.shadowsofadam.com/forums/bugs-and-feedback.3/

Bug Report READ ME:
https://forums.shadowsofadam.com/threads/read-me-bug-report-template.31/#post-91

The alpha demo offers approximately 2-3 hours of game play, from The Tangle through the town of Borges. The alpha build is nearly feature complete, but we still have some missing sound effects and minor music looping issues. These will be addressed in our final build. 🙂

Thanks for your wonderful support and getting us this far. The Kickstarter has allowed us to go above and beyond. The fund have ensured that we have the best quality graphics, sounds, and assets needed to make Shadows of Adam an incredible experience. Thank you a million times!

Something Classic Team,

Tyler, Ty, Josh, Luke and Tim

P.S. Sometimes Humble Bundle emails get sent to spam or promotion folders, so if you don’t see it in your inbox, please check there!

Weekly Content Blog #50: Alpha Demo Information

Weekly Content Blog #50: Alpha Demo Information

Hello again everyone! Our deepest apologies for missing last weeks scheduled development blog post. We have been in crunch mode eliminating all of our outstanding alpha demo tasks and we only realized we missed a post when it came time to write the next one. D’oh! I’ll try to make up for last weeks missing post by announcing some awesome news in this one :).

First, the game is playable from start to finish. We have all of our planned content for the main story complete and implemented. Our art assets are all finished with the exception of backer-specific assets. We are working on those now, so if you have not yet finished the survey please do so as soon as possible! Currently, we are working on implementing the last of our skill animations, AI logic and our credit sequence. Once those are all wrapped up the core game will be content complete! Exciting stuff 😀
13528391_1404031966571025_8318139374286257859_o

Second, if you are a Kickstarter backer, expect to have the alpha demo on July 22, at the latest. The Alpha Demo will have two to three hours of extra content and will let you play through Dradora, Sea Side House, Wind Tower, and Borges. Please note, we have spent a lot of time fixing as many bugs as possible, but it is possible we will have missed some. If you experience any difficulties or have any suggestions on improving the game, feel free to post in our Bugs and Feedback forum so we can start public discussion on your bug/suggestion :D.
13653134_1405135843127304_1857588153982354187_o

Lastly, we are going to use the Humble Bundle Widget to help us automate our backer specific content. The Humble Widget gives us a lot of flexibility regarding distribution and saves us precious time so we do not have to build our own solution. More time we can spend on the game sounds great by us :D. So what does this mean for you? On July 22, all backers will receive an e-mail from the The Humble Widget with a download page link. Clicking this link will take you to your download page where you can associate your Humble Account with your purchased content from the Shadows of Adam Kickstarter. Once we launch the game, you will be able to redeem your special backer content (digital wallpaper, art book, strategy guide, ost) or Steam keys from your download page. You will also be able to download DRM-free versions of the game from the same download page, should you choose to do so.
13537644_1404708326503389_6479906420403763905_n

We want to thank everyone once again for all of the support! The finish line is in sight 😀

If you have questions, or want to say hi, contact us at one of our official channels:
E-mail: info@somethingclassic.net
Twitter: https://twitter.com/SomethingClassc
Facebook: https://www.facebook.com/SomethingClassicGames/
Forums: https://forums.shadowsofadam.com/
Twitch: https://www.twitch.tv/somethingclassic

Weekly Content Blog #46: E-I-AI-O

Weekly Content Blog #46: E-I-AI-O

“Artificial Intelligence” is all the rage these days. The ‘AI’ in Shadows of Adam won’t drive your car or cook you a meal, but hopefully it’ll be more engaging than relying on pure random chance to simulate enemy behavior. In fact, Shadows of Adam doesn’t have any ‘AI’ in the traditional sense. Every behavior is written as a series of patterns and rules which then simulate the intended behavior, with a single exception. We wanted our AI system to have a subtle touch of intelligence so it doesn’t ‘feel’ like pure random chance. Thus, we made the enemies communicate with each other so the actions of their companions will influence the actions another enemy will perform. Here is an example of how this plays out: Enemy A is going to lower the defenses of Kellan, Enemy A will then tell his companions what he intends to do. Enemy B will receive the message “Hey, Kellan will be weak. Attack him!” and will prioritize attacks on Kellan. Subtle touches like these is how we are planning on standing out in an increasingly competitive and crowded market.

Let’s take a look at some screenshots showing the AI rules in action.

wg-call-ally
If that’s the Dragon calling for help, then that’s how you know we have a kickass party.

pirate_party
Partying with bumbling pirates in a magical world filled with wraiths, airships and magic that sets things on fire. What could go wrong?

soul_bond
The rat is using Soul Bond, right? Please don’t tell me it’s that evil shadowy thing in the middle…I want to go back to partying with the pirates.

Spoiler! Here is an actual rule set in the game. Can you figure out what it does?

Again thanks from all of us at SC for helping make our kickstarter and Steam Greenlight a huge success! We cannot wait to get you guys this game! Hold tight and keep following us for weekly updates. Also please visit any of our other social media outlets:

E-mail: info@somethingclassic.net
Twitter: https://twitter.com/SomethingClassc
Facebook: https://www.facebook.com/SomethingClassicGames/
Forums: https://forums.shadowsofadam.com/
Twitch: https://www.twitch.tv/somethingclassic