undefined local variable or method `start_test_server_in_background' for #<Object:0x007ffc49a5e130> - testing

This has been asked before for .12.0 but I am now getting a similar error in .14.2 .
Up until a few weeks ago I was running calabash.framework 11.4 because it worked, was stable, and it was under lock and key on our development server. We went through a recent state of updating all of our gems and services and while our build server still functions calabash is no longer recognizing the "start_server_in_background" method. I am at a loss on how to remedy this. I tried a complete wipe and reinstall on my local mirror to no avail, and am considering rolling everything back to the previous working versions. However I would like to solve this to keep everything up to date.
I have tried the following solutions with no success.
undefined local variable or method `start_test_server_in_background' for main:Object
https://github.com/calabash/calabash-ios/issues/669
https://github.com/calabash/calabash-android/issues/371
This is my error after the scenario runs
undefined local variable or method `start_test_server_in_background' for #<Object:0x007f9a7c07ba48> (NameError)
/Users/mycomp/.rvm/gems/ruby-2.2.1#global/gems/rspec-expectations-3.2.1/lib/rspec/matchers.rb:926:in `method_missing'
/Users/mycomp/KonyiOSWorkspace/user/Kony/iOS-6.0.3.GA_v201503250510/VMAppWithKonylib/features/mobile/helpers/ios/support/app_life_cycle_hooks.rb:44:in `Before'

The recommend way of launching the application is to use:
options = { }
launcher.relaunch(options)
launcher.calabash_notify(self)
In your support/env.rb file you need to:
require 'calabash-cucumber/cucumber'
not calabash-cucumber.

Related

Detox not taking passed in environment variables

I am setting up testing environments on a react native app. Recently, my build commands have stopped including the environment variables that I pass into them.
EMAIL=testemail#test.com PASSWORD=testpassword xcodebuild....
When the app runs, process.env.EMAIL returns undefined and if I log the process.env object the EMAIL, PASSWORD, or any other variable provided in the command line is not listed.
UPDATE: This really seems to be an issue with detox/metro. This is where the passed-in environment variables should be received as is outlined in Detox's docs regarding mocking, which is also broken now.
Any ideas on what I changed that broke this functionality?
You can't store variables in .env file and access them using process.env directly in react native.
To achieve this you need to integrate react-native-config library.
I figured it out. I recently modified my bash script to read the variable values, and have them then passed in on the build call. Turns out, those need to be passed in when I call the script itself. So I solved the issue by nesting the script inside of another that reads the variables and then passes them in appropriately.
Any explanation as to why this script nesting works and not a single script would definitely be appreciated.

Prestashop : Declaration of AdminLoginControllerCore::viewAccess() must be compatible with AdminControllerCore:

I was using prestashop on hosting with no problem.
Now I started my home web server and I'm trying to get it working.
I tried many different prestashop versions and reinstalled them x times..
All the time problem is that, I can Access front panel, but not the backend panel..
All the time it shows Http 500 ERROR : Server can't Handle this request.
Now I enabled debugging and it shows me error:
Fatal error: Declaration of AdminLoginControllerCore::viewAccess() must be compatible with AdminControllerCore::viewAccess($disable = false) in C:\xampp\htdocs\Shop\controllers\admin\AdminLoginController.php on line 27
And Line
class AdminLoginControllerCore extends AdminController{
I can't understand why this is happening, becouse I haven't edited and changed any file or folder.
It happens because you have to implement a method in a child class with all parameters of a parent class method. So in your parent class viewAccess has a parameter $disable=false and you need to have it in your child viewAccess() declaration. Just put that parameter in the declaration public function viewAccess($disable=false) and you even need not use it inside. And why it was not showing on the hosting but show in a local machine it is sooner in due to different PHP versions on the servers. Because in different versions it has different error levels.
The way to fix this is simple:
go to ROOT/controllers\admin\AdminLoginController.php
al line 153 you’ll have to change
public function viewAccess() to public function viewAccess($disable = false).
I had that issue with a fresh installation of PS 1.7 yesterday but did'nt come out of it. Today, apparently the same one with PS 1.6.18, thought I was expecting it would'nt, but it seems that PS can't stand PHP 7.2.4, no matter which PS version it is (of course I should have guessed that a previous version would'nt make it better than a recent one ...). Some PHP warnings might have turned into fatal errors now. The fact is, when I went into controllers/admin/adminLoginController on line 153 and typed public function viewAccess($disable = false) instead of public function viewAccess() the blank screen went away and my back-office was there (with some remaining warnings ...). Those files would'nt have to be overwritten to allow upgrade, but anyway 1.6.18 is the last upgrade of 1.6 series... Hope it can help.

Reflect.getOwnMetadata - Updating Aurelia

Reflect.getOwnMetadata is not a function in karma with latest Aurelia
I believe my issue to be the same as this, but I am unsure. I needed to update 'binding' from aurelia-binding#^1.0.0-beta.1.0.5 to aurelia-binding#^1.0.0-beta.1.3.0, due to a bug fix within that release, since updating I recieve the following error:
Uncaught (in promise) Error: TypeError: Reflect.getOwnMetadata is not
a function(…)
After a bit of research, mostly being linked back to the question above in one way or another, I had hoped their solution would solve mine however, gulp watch returns: import 'aurelia...' unexpected reserved work. Unsure what I am missing
I think the actual issue is with loading the following, seems to break here first
(function(System, SystemJS, require) {define(["npm:aurelia-templating-resources#1.0.0-beta.1.0.2/aurelia-templating-resources"], function(main) {
return main;
});
})(System, System);

Ember-data 1.0.0-beta.19: store.find() returns DS.INTERNALMODEL instances

I have update Ember-data to 1.0.0-beta.19 and now store.find('events') resolved promise returns DS.INTERNALMODEL instances, instead of DS.MODEL. With Ember-data 1.0.0-beta.18 it was working fine. Any ideas?
UPDATE
At the end i found out that somewhere in my app code i was using Ember-data internal code like store.find('events.content'), causing an exception. The debugger was not so helpful tracing it, but removing this fixed my issue.
This is a bug, if the promise resolves with DS.InternalModel, those are only for internal use of Ember-Data and shouldn't be exposed to user code. Please file a bug if this is still a problem
This is on purpose. It's noted in the chanelog:
#3094 Lazily materialize DS.Models for app code, use InternalModel inside ED otherwise
It should work largely with no issues. Are you having issues with it?
You can access the DS.Model using InternalModel.record

Raising route not found error

I'm writing a book on Rails 3 at the moment and past-me has written in Chapter 3 or so that when a specific feature is run that a routing error is generated. Now, it's unlike me to go writing things that aren't true, so I'm pretty sure this happened once in the past.
I haven't yet been able to duplicate the scenario myself, but I'm pretty confident it's one of the forgotten settings in the environment file.
To duplicate this issue:
Generate a new rails project
important: Remove the public/index.html file
Add cucumber-rails and capybara to the "test" group in your Gemfile
run bundle install
run rails g cucumber:skeleton
Generate a new feature, call it features/creating_projects.feature
Inside this feature put:
This:
Feature: Creating projects
In order to value
As a role
I want feature
Scenario: title
Given I am on the homepage
When you run this feature using bundle exec cucumber features/creating_projects.feature it should fail with a "No route matches /" error, because you didn't define the root route. However, what I and others are seeing is that it doesn't.
Now I've set a setting in test.rb that will get this exception page to show, but I would rather Rails did a hard-raise of the exception so that it showed up in Cucumber as a failing step, like I'm pretty sure it used to, rather than a passing step.
Does anybody know what could have changed since May-ish of last year for Rails to not do this? I'm pretty confident it's some setting in config/environments/test.rb, but for the life of me I cannot figure it out.
After I investigate the Rails source code, it seems like the ActionDispatch::ShowExceptions middleware that responsible of raising exception ActionController::RoutingError is missing in the test environment. Confirmed by running rake middleware and rake middleware RAILS_ENV=test.
You can see that in https://github.com/josh/rack-mount/blob/master/lib/rack/mount/route_set.rb#L152 it's returning X-Cascade => 'pass' header, and it's ActionDispatch::ShowExceptions's responsibility to pick it up (in https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/middleware/show_exceptions.rb#L52)
So the reason you're seeing that your test case is passing because rack-mount is returning "Not Found" text, with status 404.
I'll git blame people and get it fix for you. It's this conditional here: https://github.com/rails/rails/blob/master/railties/lib/rails/application.rb#L159. If the setting is true, the error got translated right but we got error page output. If it's false, then this middleware doesn't get loaded at all. Hold on ...
Update: To clearify the previous block, you're hitting the dead end here. If you're setting action_dispatch.show_exceptions to false, you'll not get that middleware loaded, resulted in the 404 error from rack-mount got rendered. Whereas if you're setting action_dispatch.show_exceptions to true, that middleware will got loaded but it will rescue the error and render a nice "exception" page for you.