Search This Blog

Tuesday, December 8, 2015

Automated acceptance tests in Calabash

The Mobilengers team at StxNext has recently moved to Calabash as our automated acceptance testing framework. All tests are written in Gherkin - simple, descriptive language that Cucumber can understand. Gherkin gives the ability to describe the desired behaviour in plain text preserving the possibility to run such a test on real devices. It serves two purposes - as a documentation tool and as automated tests framework. It has been translated to over 60 spoken languages (with leading English) so that your team can use the keywords in their own language.

Automated tests follow two simple conventions - that source file should be saved as .feature and that one source file should only contain description of a single feature.

Calabash is the mobile implementation of Cucumber. It enables native apps testing and is cross-platform - Android/iOS. It’s also open-source with all the code available freely on GitHub.

With Calabash we’re able to implement simple gestures (like - swipe down, button-clicks, go back etc.), make assertions concerning displayed content as well as take screenshots whenever something goes wrong in the app.

Running tests in the cloud on the real devices gives us the possibility to cover more devices without buying every phone available on the market. We use Amazon AWS Device Farm which has the possibility to run Calabash tests and covers most popular device models. It also gives detailed tests results, takes screenshots as well as pinpoints references to lines of source code where specific errors have originated from. AWS has the option to test apps in different device locales, GPS locations and specific “other apps” dependencies.

Simple tutorial on how to install Calabash (OsX/Ubuntu) and run basic tests can be downloaded here.




Reference:
https://github.com/kosiara/calabash-android-example-projects
https://github.com/calabash/calabash-android
https://github.com/calabash/calabash-ios
https://cucumber.io/
https://github.com/cucumber/cucumber/wiki/Gherkin
http://www.slideshare.net/Codemotion/calabash-codemotion-2012 (ios)
http://docs.aws.amazon.com/devicefarm/latest/developerguide/welcome.html

Books:
https://pragprog.com/book/hwcuc/the-cucumber-book












Sunday, May 10, 2015

PEKA - wirtualny monitor

Niedawno rozpoczęły się prace nad aplikacją umożliwiającą sprawdzanie dokładnego czasu przyjazdu tramwajów i autobusów.
Nareszcie możliwe jest wygodne korzystanie z wirtualnego monitora systemu PEKA na urządzeniach mobilnych.

Jeżeli mieszkasz w Poznaniu - wybierz ulicę, a następnie swój przystanek - aby zobaczyć dane, które pozwolą Ci DOKŁADNIE określić w którym momencie przyjedzie Twój tramwaj/autobus.

Funkcje:

- szukaj połączeń autobusowych/tramwajowych według ulicy/nazwy przystanku/nr linii

- dodawaj poszczególne przystanki do ulubionych, aby mieć do nich szybki dostęp

- połączenia z rzeczywistym czasem przyjazdu są oznaczone niebieskim "GPS"
- widget umożliwiający obserwowanie swojego ulubionego przystanku


Kliknij tutaj, aby przejść do Google Play.








Saturday, April 4, 2015

OsX - handful of shortcut key combinations

1. q: Where is the insert key  a: Apple's keyboard does not have an insert key
   emulate 'ins' key by pressing Ctrl + "t"

2. q: Where is the ~ key?  a: to the right of the left "shift" key

3. q: How to take a screenshot of the screen? a: press "ctrl" + 3 - to take the screenshot of the entire screen and "ctrl" + 4 - to take the screenshot of the selected screen area. Screenshots are saved on the desktop



Resources:
mac-os-x-and-midnight-commander-the-missing


Sunday, March 29, 2015

OsX - default partition table

What is the default partition type on OsX 10.10 Yosemite?

Partition table: GUID partition table (gpt)
partition type: hfs+


Wednesday, March 18, 2015

OsX - choose the right Java version for Intellij 14 CE


/Applications/IntelliJ IDEA 14 CE.app/Contents/bin/inspect.sh

2015-03-18 21:02:24.425 idea[962:382297] No matching VM found.
[JavaAppLauncher Error] CFBundleCopyResourceURL() failed loading MRJApp.properties file
[JavaAppLauncher Error] CFBundleCopyResourceURL() failed while getting Resource/Java directory
[LaunchRunner Error] No main class specified
[JavaAppLauncher Error] CallStaticVoidMethod() threw an exception
Exception in thread "main" java.lang.NullPointerException
at apple.launcher.LaunchRunner.run(LaunchRunner.java:113)
at apple.launcher.LaunchRunner.callMain(LaunchRunner.java:51)
at apple.launcher.JavaApplicationLauncher.main(JavaApplicationLauncher.java:61)


Download the newest "Apple Java" from here.
Download the regular Oracle Java.


Remember to set the JAVA_HOME variable in .bash_profile correctly:
export JAVA_HOME= /Library/Java/JavaVirtualMachines/jdk1.8.0_40.jdk/Contents/Home

You can also edit the file: /Applications/IntelliJ IDEA 14 CE.app/Contents/Info.plist

and change 1.6 to 1.8



Friday, March 6, 2015

Friday, February 27, 2015

Ubuntu 14.04 LTS Chrome - enable touch mode (Android-like support)

1. Check you Chrome flags configuration - go to chrome://flags

Enable touch events Mac, Windows, Linux, Chrome OS
Enable pinch scale. Windows, Linux, Chrome OS
Enable pinch virtual viewport. Windows, Linux, Chrome OS, Android
Enable touch based text editing Windows, Linux, Chrome OS

2. Check the no. of your touch-panel

xinput list

for me it gave:

Atmel Atmel maXTouch Digitizer           id=10 [slave  pointer  (2)]

3. Start your chrome browser with the following script


#!/bin/bash
sudo killall chrome
#xinput list  # list input devices 
google-chrome --touch-devices=10 &




Tuesday, February 17, 2015

Android SMS to HTML backup / exporter

The application SMS to HTML exporter that I recently published for  the Android platform enables the user to easily export all his/her messages into a convenient HTML format that can be sent to a desirable email address instantly.

The fresh, material-design inspired and simple user interface should get anyone going in moments.

The application can be downloaded from Google-Play: here

or just copy-paste this address:
https://play.google.com/store/apps/details?id=com.bkosarzycki.smstohtmlexporter

Screenshots:






Tuesday, February 3, 2015

Git - show number of project lines of code for a specific user


To see number of:

  • added lines
  • removed lines
  • total lines of code
for a specific user, use the following:


git log --author="Name Surname" --pretty=tformat: --numstat | gawk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s removed lines: %s total lines: %s\n", add, subs, loc }' -



Android project - count lines of code

In the project directory execute the following command. It searches for all *.java files and counts their lines of code - ignoring _*.java files which are generated by Android Annotations.



find . -name '*.java' -not -name '*_.java' | xargs wc -l



Saturday, January 17, 2015

Intellij file mask exclude; IntelliJ search files exclude file type; search files exclude file by extension

There is a simple way to exclude files by extension (in fact by using regular expressions on file names in IntelliJ 14 and Android Studio 1.0)

When searching in file content (ctrl+shift+F) limit the scope of search to Custom
and click '...'  to create a new scope.

Shared scopes are stored in: .idea/scopes/
and are shared between team members.


Custom search scope example for Android Annotations:

file:*java&&!file:*R.java*&&!file:*_.java

search in all java source files without R.java files and generated annotations.






http://stackoverflow.com/questions/22143881/how-to-exclude-a-file-extension-from-intellij-idea-search


If you want to include strings.xml etc. use this search pattern:


file:*java&&!file:*R.java*
&&!file:*_.java||file:*strings.xml||file:*dimes.xml||file:*styles.xml||file:*attrs.xml||file:*colors.xml||file:*layout/*xml&&!file:*build/*xml