Cucumber android error while running feature - android

I'm trying to test android program with cucumber test.
I have such error:
C:\Users\Artem\calabash_habr>cucumber features/my_first.feature
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansicon/) to get coloured output on Windows
Feature: Pre-orders feature
# Header
Scenario: open Pre-orders # features\my_first.feature:3
W/asset ( 2200): Asset path is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded 'package' not found in aapt output (RuntimeError)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/helpers.rb:10:in `package_name'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/operations.rb:89:in `uninstall_apps'
C:/Users/Artem/calabash_habr/features/support/app_installation_hooks.rb:22:in `Before'
W/asset ( 8772): Asset path is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded
'package' not found in aapt output (RuntimeError)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/helpers.rb:10:in `package_name'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/operations.rb:508:in `start_test_server_in_background'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/operations.rb:110:in `start_test_server_in_background'
C:/Users/Artem/calabash_habr/features/support/app_life_cycle_hooks.rb:5:in `Before'
When I press the menu key # calabash-android-0.5.1/lib/calabash-android/steps/navigation_steps.rb:5
Could not take screenshot (RuntimeError)
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/operations.rb:425:in `screenshot'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/calabash-android-0.5.1/lib/calabash-android/operations.rb:118:in `screenshot_embed'
C:/Users/Artem/calabash_habr/features/support/app_life_cycle_hooks.rb:10:in `After'
Failing Scenarios:
cucumber features\my_first.feature:3 # Scenario: open Pre-orders
1 scenario (1 failed)
1 step (1 skipped)
0m0.217s
My feature is easy:
Feature: Pre-orders feature
# Header
Scenario: open Pre-orders
# Menu press
When I press the menu key
I want to start feature without reinstalling app, because I want to save data.
P.S. I can run calabash console without error.

I change app_installation_hooks.rb so:
require 'calabash-android/management/app_installation'
AfterConfiguration do |config|
FeatureNameMemory.feature_name = nil
end
Before do |scenario|
#scenario_is_outline = (scenario.class == Cucumber::Ast::OutlineTable::ExampleRow)
if #scenario_is_outline
scenario = scenario.scenario_outline
end
feature_name = scenario.feature.title
if FeatureNameMemory.feature_name != feature_name \
or ENV["RESET_BETWEEN_SCENARIOS"] == "1"
if ENV["RESET_BETWEEN_SCENARIOS"] == "1"
log "New scenario - reinstalling apps"
else
log "First scenario in feature - reinstalling apps"
end
# uninstall_apps
# install_app(ENV["TEST_APP_PATH"])
# install_app(ENV["APP_PATH"])
FeatureNameMemory.feature_name = feature_name
FeatureNameMemory.invocation = 1
else
FeatureNameMemory.invocation += 1
end
end
FeatureNameMemory = Class.new
class << FeatureNameMemory
#feature_name = nil
attr_accessor :feature_name, :invocation
end
After now I run app:
calabash-android run <apk>

Related

Flutter app doesn't build on ios simulator , en_US doesnt run

I tried following answers regarding setting these property in zsrhc and profile parts the error still persists here is my error
Invalid `Podfile` file: undefined local variable or method `en_US' for #<Pod::Podfile:0x00007ff22b487310>.
# from /Users/Tiobu/Desktop/tiobu_arshClone/tiobu-flutter/ios/Podfile:4
# -------------------------------------------
#
> export LANG=en_US.UTF-8

Production build failing with plotly.js and ionic 3

I'm using plotly.js (#1.35.2) with types/plotly.js in Ionic (3.6.1).
When using ionic serve everything (including the plots) works fine in the browser. When using ionic cordova run android --device, it is working fine, too. The app is installed on the device and usable. But there is a long waiting time when starting the app.
When I try building the app for production with ionic cordova run android --device , I get errors and the build is not working at all. I assume it has something to do with the minify process used in production builds. I am not sure if I understand the errors correctly, either.
This is the error I get:
Error: ./node_modules/d3/d3.js
Module build failed: RangeError: Maximum call stack size exceeded
at checkPropertyAccessExpressionOrQualifiedName (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:38454:62)
at checkPropertyAccessExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:38413:20)
at checkExpressionWorker (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:41300:28)
at checkExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:41257:42)
at checkBinaryLikeExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:40834:28)
at checkBinaryExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:40827:20)
at checkExpressionWorker (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:41335:28)
at checkExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:41257:42)
at checkBinaryLikeExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:40834:28)
at checkBinaryExpression (/home/aiko/IdeaProjects/etmos_the/node_modules/typescript/lib/typescript.js:40827:20)
# ./node_modules/plotly.js/src/plots/plots.js 9:9-22
# ./node_modules/plotly.js/src/transforms/groupby.js
# ./node_modules/plotly.js/lib/groupby.js
# ./node_modules/plotly.js/lib/index.js
# ./src/pages/statSites/statQuestionnaire/statQuestionnaire.ts
# ./src/app/app.module.ts
# ./src/app/app.module.ngfactory.ts
# ./src/app/main.ts,./node_modules/plotly.js/src/plots/cartesian/axes.js
Module parse failed: Error parsing regular expression: Invalid regular expression: / newDiff + 1e-6) % 1 < 2e-6 &&(((newFirst - ax._forceTick0) /: Unmatched ')' (185:53)
You may need an appropriate loader to handle this file type.
| // and forceTick0 can be shifted to newFirst
| if (function (ax, _minDtick) {
| if (_minDtick === void 0) { _minDtick = / newDiff + 1e-6) % 1 < 2e-6 &&(((newFirst - ax._forceTick0) / newDiff % 1) +
| 1.000001) % 1 < 2e-6; }
| ax._minDtick = newDiff;
# ./node_modules/plotly.js/src/transforms/filter.js 11:11-45
# ./node_modules/plotly.js/lib/filter.js
# ./node_modules/plotly.js/lib/index.js
# ./src/pages/statSites/statQuestionnaire/statQuestionnaire.ts
# ./src/app/app.module.ts
# ./src/app/app.module.ngfactory.ts
# ./src/app/main.ts
at BuildError.Error (native)
at new BuildError (/home/aiko/IdeaProjects/etmos_the/node_modules/#ionic/app-scripts/dist/util/errors.js:16:28)
at callback (/home/aiko/IdeaProjects/etmos_the/node_modules/#ionic/app-scripts/dist/webpack.js:119:28)
at emitRecords.err (/home/aiko/IdeaProjects/etmos_the/node_modules/webpack/lib/Compiler.js:265:13)
at Compiler.emitRecords (/home/aiko/IdeaProjects/etmos_the/node_modules/webpack/lib/Compiler.js:371:38)
at emitAssets.err (/home/aiko/IdeaProjects/etmos_the/node_modules/webpack/lib/Compiler.js:258:10)
at applyPluginsAsyncSeries1.err (/home/aiko/IdeaProjects/etmos_the/node_modules/webpack/lib/Compiler.js:364:12)
at next (/home/aiko/IdeaProjects/etmos_the/node_modules/tapable/lib/Tapable.js:218:11)
at Compiler.compiler.plugin (/home/aiko/IdeaProjects/etmos_the/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)
at Compiler.applyPluginsAsyncSeries1 (/home/aiko/IdeaProjects/etmos_the/node_modules/tapable/lib/Tapable.js:222:13)

Building with autotools: AC_CONFIG_MACRO_DIRS conflicts with ACLOCAL.AMFLAGS

Trying to build libwally-core C library for Android on Windows in Cygwin with supplied autotools scripts:
libwally-core
After running
bash tools/build_android_libraries.sh
or
bash tools/autogen.sh
I get the following error:
libtoolize: putting auxiliary files in AC_CONFIG_AUX_DIR, 'build-aux'.
libtoolize: copying file 'build-aux/ltmain.sh'
libtoolize: error: AC_CONFIG_MACRO_DIRS([build-aux/m4]) conflicts with
ACLOCAL.AMFLAGS=-I build-aux/m4
autoreconf-2.69: libtoolize failed with exit status: 1
I tried the following things to no avail:
Re-saved all scripts with Unix line-endings (LF only)
Commenting out "ACLOCAL_AMFLAGS = -I tools/build-aux/m4" in Makefile.am
The error happens at the following place in libtool's source in libtoolize.in:
macrodir="$ac_macrodir"
test -z "$macrodir" && macrodir="$am_macrodir"
if test -n "$am_macrodir" && test -n "$ac_macrodir"; then
test "$am_macrodir" = "$ac_macrodir" \
|| func_fatal_error "AC_CONFIG_MACRO_DIR([$ac_macrodir]) conflicts with ACLOCAL_AMFLAGS=-I $am_macrodir."
fi
I assume that the above makes sure that AC_CONFIG_MACRO_DIR and value after "-I" in ACLOCAL_AMFLAGS are identical (checked for identical line endings with hex editor too). The values are identical in both configure.ac and Makefile.am. However, even if I comment out setting ACLOCAL_AMFLAGS in Makefile.am, the error persits.
I would like to compile the library and generate libwallycore.so. Any insight would be much appreciated.

Calabash Android: Asset path error when trying to run a test on an APK

Calabash Android was working fine on my Mac OS X then quite suddenly and spontaneously, whenever I ran the following command...
calabash-android run
I received the following error:
2014-03-03 17:48:38 - JDK found on PATH.
2014-03-03 17:48:38 - Android SDK found at: /Applications/AndroidStudio.app/sdk/
2014-03-03 17:48:38 - /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -S cucumber -v
Code:
* features/support/env.rb
* features/support/app_installation_hooks.rb
* features/support/app_life_cycle_hooks.rb
* features/support/hooks.rb
* features/step_definitions/calabash_steps.rb
Features:
* features/my_first.feature
Parsing feature files took 0m0.003s
Feature: Login feature
Scenario: As a valid user I can log into my app # features/my_first.feature:3
2014-03-03 17:48:38 - First scenario in feature - reinstalling apps
2014-03-03 17:48:38 - connected_devices: ["6b5140a7"]
2014-03-03 17:48:38 - "/Applications/AndroidStudio.app/sdk//platform-tools/adb" -s 6b5140a7 forward tcp:34777 tcp:7102
2014-03-03 17:48:38 -
W/asset ( 4263): Asset path is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded
'package' not found in aapt output (RuntimeError)
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/helpers.rb:10:in `package_name'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:72:in `uninstall_apps'
/Users/Nauman/Desktop/APKs/features/support/app_installation_hooks.rb:22:in `Before'
W/asset ( 4265): Asset path is neither a directory nor file (type=1).
ERROR: dump failed because assets could not be loaded
'package' not found in aapt output (RuntimeError)
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/helpers.rb:10:in `package_name'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:448:in `wake_up'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:477:in `start_test_server_in_background'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:93:in `start_test_server_in_background'
/Users/Nauman/Desktop/APKs/features/support/app_life_cycle_hooks.rb:5:in `Before'
When I press "Login" # calabash-android-0.4.20/lib/calabash-android/steps/press_button_steps.rb:17
Then I see "Welcome to coolest app ever" # calabash-android-0.4.20/lib/calabash-android/steps/assert_steps.rb:5
2014-03-03 17:48:39 - java -jar /Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/lib/screenshotTaker.jar 6b5140a7 screenshot_0.png
2014-03-03 17:48:40 - It looks like your app is no longer running.
It could be because of a crash or because your test script shut it down.
HTTPClient::KeepAliveDisconnected (HTTPClient::KeepAliveDisconnected)
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:882:in `block in parse_header'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/timeout.rb:97:in `timeout'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:875:in `parse_header'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:858:in `read_header'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient/session.rb:667:in `get_header'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:1137:in `do_get_header'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:1086:in `do_get_block'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:887:in `block in do_request'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:986:in `rescue in protect_keep_alive_disconnected'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:980:in `protect_keep_alive_disconnected'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:886:in `do_request'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:774:in `request'
/Library/Ruby/Gems/2.0.0/gems/httpclient-2.3.4.1/lib/httpclient.rb:684:in `post'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:334:in `make_http_request'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:290:in `http'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:556:in `shutdown_test_server'
/Library/Ruby/Gems/2.0.0/gems/calabash-android-0.4.20/lib/calabash-android/operations.rb:97:in `shutdown_test_server'
/Users/Nauman/Desktop/APKs/features/support/app_life_cycle_hooks.rb:12:in `After'
Failing Scenarios:
cucumber features/my_first.feature:3 # Scenario: As a valid user I can log into my app
1 scenario (1 failed)
2 steps (2 skipped)
0m2.432s
I would appreciate any help; I am stumped and at my wits end over this.
1. As your first line of error states JDK found on PATH.
Kindly install JDK & give the proper path in CMD.
2. You have to give absolute path for APK like calabash-android run path/to/apk.apk
3. Also, ensure you execute setup, build & resign this command before run.
To create proper .keystore file
calabash-android setup file.apk
To instrument your app
calabash-android resign file.apk
To build test server
calabash-android build file.apk

SystemTap on Android

when I executed the command ' staprun ' on the android , I met following problem :
# /data/systemtap-1.0-omap/bin/staprun /data/local/msyscall_all.ko
/data/systemtap-1.0-omap/bin/staprun: 1: Syntax error: "(" unexpected
#
the module msyscall_all.ko is cross-compiled with the kernel that my android run on.
firstly, I am sure that msyscall_all.ko is exactlly right , because I use command ' insomd ' and ' lsmod ' to ensure it is right .I did it as following :
# lsmod
omaplfb 8986 0 - Live 0xbf032000
pvrsrvkm 137346 29 omaplfb, Live 0xbf000000
# insmod /data/local/msyscall_all.ko
# lsmod
msyscall_all 1121778 0 - Live 0xbf037000
omaplfb 8986 0 - Live 0xbf032000
pvrsrvkm 137346 29 omaplfb, Live 0xbf000000
#
secondly, I followed the instruction in :http://omappedia.org/wiki/Systemtap#Systemtap_1.0_code_update_for_OMAP_ARM_platforms
And my systemtap-1.0-omap was cross-compiled successfully!! Howerver, after I used 'adb push' to pushed the systemtap-1.0-omap to my android device and ran it ,I got the error below :
/data/systemtap-1.0-omap/bin/staprun: 1: Syntax error: "(" unexpected
when the 'staprun' was ran on the ubuntu ,it gave me advice how run ' staprun ' , and when it was run on the android device ,it went wrong :
# /data/systemtap-1.0-omap/bin/staprun
/data/systemtap-1.0-omap/bin/staprun: 1: Syntax error: "(" unexpected
# exit
ubuntu#ubuntu:~$ cd systemtap-1.0-omap/bin/
ubuntu#ubuntu:~/systemtap-1.0-omap/bin$ ./staprun
ERROR: Need a module name or path to load.
./staprun [-v] [-c cmd ] [-x pid] [-u user] [-A|-L|-d]
[-b bufsize] [-o FILE [-D] [-S size[,N]]] MODULE [module-options]
-v Increase verbosity.
-c cmd Command 'cmd' will be run and staprun will
exit when it does. The '_stp_target' variable
will contain the pid for the command.
-x pid Sets the '_stp_target' variable to pid.
-o FILE Send output to FILE. This supports strftime(3)
formats for FILE.
-b buffer size The systemtap module specifies a buffer size.
Setting one here will override that value. The
value should be an integer between 1 and 4095
which be assumed to be the buffer size in MB.
That value will be per-cpu in bulk mode.
-L Load module and start probes, then detach.
-A Attach to loaded systemtap module.
-d Delete a module. Only detached or unused modules
the user has permission to access will be deleted. Use "*"
(quoted) to delete all unused modules.
-D Run in background. This requires '-o' option.
-S size[,N] Switches output file to next file when the size
of file reaches the specified size. The value
should be an integer greater than 1 which is
assumed to be the maximum file size in MB.
When the number of output files reaches N, it
switches to the first output file. You can omit
the second argument.
MODULE can be either a module name or a module path. If a
module name is used, it is looked for in the following
directory: /lib/modules/`uname -r`/systemtap
ubuntu#ubuntu:~/systemtap-1.0-omap/bin$
I have tried my best , but I can not solve it !!

Categories

Resources