Cappuccino [warn]: Could not connect the action - cappuccino

This has to be something stupid, because this is so basic and even then it is not working.
Anyways,
➜ ~ capp --version
cappuccino 0.9.6 (2012-11-17 788ee6)
I built a basic NibApplication from the template using the following command.
capp gen -t NibApplication ButtonTest
I did not symlink the framework.
I added the following method to AppController.j
- (IBAction)hello:(id)sender {
alert("hello");
}
I ran XcodeCapp, opened the project in Xcode 4.5.2, and added a NSButton to the Window and linked it to the action "hello:" in AppController
When I ran the index-debug.html in Safari this is what I get in the console.
2012-11-18 22:58:01.566 Cappuccino [warn]: Could not connect the action hello: to target of class AppController
I don't understand what I am doing wrong.

So, I forgot to run it via a simple webserver. I tested it out by running it over Apache and it works. It's weird that the Safari console was not giving me any errors regarding this.

Related

Protractor 7 does not go beyond 'Using FirefoxDriver directly...'

I am unable to run e2e tests with protractor 7 with the following configuration
...
directConnect: true,
capabilities: {
browserName: 'firefox'
}
...
on my MacOS Catalina. I noticed the
webdriver-manager update
command from the project's package.json downloads the geckodriver-v0.29.1.
As mentioned in the title the logs do not go beyond Using FirefoxDriver directly... when I run the tests. How can I check logs in more details (is there a verbose option in protractor?), and how can I fix the issue ?
With Splaktars answer I was able to get Firefox to launch using the typical directConnect: true setting.
I had to download the geckodriver-v0.29.1-macos.tar.gz package from the Github Releases and extract the binary. Then I replaced the geckodriver-v0.29.1 binary previously downloaded through webdriver-manager with that copy from the package.
After that I launched my tests to make sure everything was still partially working and finally saw the MacOS security popup. I ran the command to remove the quarantine flag:
xattr -r -d com.apple.quarantine /path/to/geckodriver-v0.29.1
Relaunched the tests and finally Firefox popped up...
Thanks again to Splaktar, just made an account so I can't comment or upvote for help
It looks like there is a known issue in the v0.29.1 release notes:
https://github.com/mozilla/geckodriver/releases/tag/v0.29.1
Those point to some GeckoDriver macOS Notarization docs:
https://firefox-source-docs.mozilla.org/testing/geckodriver/Notarization.html
However that page say
Arbitrary software downloaded through other means, such as curl(1) is not affected by this change.
I don't get any security pop ups or warnings, just the hang that you see.
Running
xattr -r -d com.apple.quarantine /Users/splaktar/Git/app/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.29.1
Doesn't help.
In https://github.com/angular/protractor/issues/4253, there are a lot of old issues mentioned with Firefox and directConnect support. I tried using directConnect: false with a suggestion from that issue:
config.capabilities = {
'browserName': 'firefox',
'marionette': true,
'elementScrollBehavior': 1
};
config.directConnect = false;
config.seleniumAddress = 'http://localhost:4444';
config.localSeleniumStandaloneOpts = {
jvmArgs: ['-Dwebdriver.gecko.driver=node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.29.1']
};
I ran webdriver-manager start and then ran my tests, but that failed quickly with an error page's HTML in the console and From: Task: WebDriver.createSession() Process exited with error code 199.
I also tried setting
config.firefoxPath = '/usr/local/bin/firefox-bin';
after creating a symbolic link there to /Applications/Firefox.app/Contents/MacOS/firefox-bin. But that didn't help at all. Firefox never gets started. I tried with Firefox Developer Edition as well.
Still investigating...

Yocto SYSTEMD_SERVICE to install a parameterized service ("#.service")

I need to configure WireGuard to bring up a VPN on boot on an Embedded Linux device.
My recipe installs a /etc/wireguard/wg0.conf pretty much like the examples found through the Internet.
Then I try to enable the service on SystemD like this on my wireguard.bb:
SYSTEMD_SERVICE = "wg-quick#wg0.service"
SYSTEMD_AUTO_ENABLE = "enable"
But bitbake throws me an error:
ERROR: Function failed: SYSTEMD_SERVICE_my-conf value wg-quick#wg0.service does not exist
I checked the temporary directory and file wg0.conf appears in the correct places but it seems that bitbake's SYSTEMD_SERVICE doesn't know how to expand the "wg0" after # sign.
If I try without the interface name (wg0):
SYSTEMD_SERVICE = "wg-quick#.service"
Bitbake is happy and finalizes my recipe, but it is not what systemd is expecting. Starting a service without an interface makes no sense...
Then I tried another approach and split the "wireguard" package itself from the configuration ("wireguard-conf" package) and added DEPENDS and RDEPENDS on "wireguard".
This got even worse since my wireguard-conf.bb recipe does not contain a "wg-quick#.service" file (it comes from the dependency "wireguard").
Well,
I don't know how to properly fix it and any suggestions will be highly appreciated.
Additional Info
I am using Yocto 2.0.3 in this project (with no hope of updating it).
Thanks to #TomasNovotny comments I managed to compare my "systemd.bbclas" against Github and noticed a change in systemd_populate_packages() that seems to solve the problem.
It works in newer OpenEmbedded (looks like in krogoth, version 2.1 released Apr 2016) and it is introduced by this commit. It works for me in rocko (version 2.4 released Oct 2017). According to j4x's comment, it doesn't work in jethro (version 2.0, Nov 2015).
For older (and currently unsupported OpenEmbeddeds) you can try to backport the patch or handle the symlinks for enabling the service in do_install().
Also please note that SYSTEMD_SERVICE_${PN} variable is package specific, so the _${PN} suffix has to be added (see manual).
I've also tried to enable OpenVPN with my profile (in Yocto rocko) without success.
Finally, I've made it working by providing OpenVPN recipe extension instead of custom one. So, the openvpn_%.bbappend file looks like:
inherit systemd
SYSTEMD_SERVICE_${PN} = "openvpn#clientprofile.service"
SYSTEMD_AUTO_ENABLE = "enable"
do_install_append() {
install -d ${D}${sysconfdir}/openvpn/
ln -sf /data/etc/openvpn/clientprofile.conf ${D}${sysconfdir}/openvpn/clientprofile.conf
}
As you can see, I'm using a symlink to my profile instead of the normal file. You can install a normal OpenVPN profile file instead of making symlink and it also works fine.

Selenium WebDriverException: Reached error page

I am following a Django TDD tutorial at:
http://www.marinamele.com/taskbuster-django-tutorial/taskbuster-working-environment-and-start-django-project
I get the following error when running 'all_users.py' before and after I start the development server 'python manage.py runserver':
Traceback (most recent call last):
File "functional_tests/all_users.py", line 15, in test_it_worked
self.browser.get('http://localhost:8000')
File "/Users/samgao/.virtualenvs/tb_test/lib/python3.6/site->packages/selenium/webdriver/remote/webdriver.py", line 264, in get
self.execute(Command.GET, {'url': url})
File "/Users/samgao/.virtualenvs/tb_test/lib/python3.6/site->packages/selenium/webdriver/remote/webdriver.py", line 252, in execute
self.error_handler.check_response(response)
File "/Users/samgao/.virtualenvs/tb_test/lib/python3.6/site->packages/selenium/webdriver/remote/errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: Reached error page: >about:neterror?e=connectionFailure&u=http%3A//localhost%3A8000/&c=UTF->8&f=regular&d=Firefox%20can%E2%80%99t%20establish%20a%20connection%20to%20the%20s>erver%20at%20localhost%3A8000.
Basically the connection to localhost cannot be established.
The settings and configurations are identical to the tutorial in the previous link.
I have been struggling with the issue for two days, and would thank you most kindly if you could provide any help.
I got the same error and what solved for me was changing from localhost to 127.0.0.1:
old: self.browser.get('http://localhost:8000')
better: self.browser.get('http://127.0.0.1:8000')
I encountered the same problem, the final solution is: re-install again geckodriver
Unzip the geckodriver.zip
Move the file to /usr/bin directory sudo mv geckodriver /usr/bin
Goto /usr/bin directory cd /usr/bin,then you would need to run something like sudo chmod a+x geckodriver to mark it executable.
this might not be your situation, but I got the same error message when running a test (same book, hehe) without having anything actually listening on the targeted port (8000, in my case). Make sure there's something listening for a request by manually opening your browser and going to localhost:8000. In my case - silly me - I didn't have the server up at all =)
I also followed the same tutorial and came across the same error. I noticed that I am not running the django server. The following is what helped.
python manage.py runserver
python functional_test.py
Being that this is a snapshot (around Django 1.8's time) of "Obey The Testing Goat" - perhaps the instructions there are no longer relevant. I suggest going straight to the goat's mouth and starting over!
The issue could be related to virtualenvwrapper (which is no longer necessary) or it could be related to the port/address that you were trying to access. Depending on your version of Selenium and Firefox there may be issues related to that as well.
It depends on the situation.
Based on mine, after I changed the target URL, I can get the browser to load the URL normally, which means the original URL is not available.
Another way to check:
import requests
html = request.get(url)
Print the HTML, if you get the 503, which means the website is reachable.
Since this is probably a common search result for those working through Obey the Testing Goat, I wanted to share the solution that worked for me. I had written self.browser.get('http://localhost:8000') and needed to use http instead of https to resolve the error.
I got this problem in this situation: the application put the computer name to the proxy host,so the proxy like this:
theComputerName:proxyPort
but the theComputerName:proxyPort can not be visit,so I put this into the host:
127.0.0.1 theComputerName
then restart the application,the problem resolved perfect
I learning TDD tutorial too. My problem was that inputed uncorrect url
http://http://mysite insted of http://mysite

Running casperjs tests with slimerjs

I wrote a few tests with casperjs. They run just fine with phantomjs. However, when I tried to use slimerjs with the following command:
casperjs --verbose --engine=slimerjs test create-project-suite.js
A small window appers with the SlimerJs logo and version number but the console seems to hang with the following line:
Test file: create-project-suite.js
Is there anything else I need to do? Here are the version numbers:
Mozilla Firefox 28.0
CasperJS version 1.1.0-beta3
Innophi SlimerJS 0.9.1
3.8.0-37-generic #53~precise1-Ubuntu
Update:
I removed code until I got slimerjs to open the browser and execute tests. It seems that it hangs whenever I require a js file (I'm following the page objects pattern):
var Login = require('./objects/login');
I think require.paths could be helpful. Any ideas on how to get around this?
Using full paths makes slimerjs happy:
var path = fs.absolute(fs.workingDirectory + '/objects/login');
var Login = require(path);
It is plain simpler to move all modules to the same directory where the script is.
I tried your command and it works for me, maybe in your file you use an instruction specific to phantom :
http://docs.slimerjs.org/0.8/differences-with-phantomjs.html
But it should open the window(at least the start() ).
Anyway the command is fine.

Django app in Eclipse won't run after upgrade to django 1.4

After upgrading to Django 1.4, I now get the following error message:
raise ImportError("Could not import settings '%s' (Is it on sys.path?): %s" % (self.SETTINGS_MODULE, e))
ImportError: Could not import settings 'settings.py' (Is it on sys.path?): No module named py
I read that it might have something to do with pydev 2.4 eg: here, so I upgraded pydev to the latest version, 2.5. I am using eclipse indigo.
I started to have a look at the run cnofiguration, and noticed that the django 1.3 egg was still being referenced. So I went to windows/preferences/pydev/interpreter-python, and the 1.3 egg was being referenced in the system PYTHON path.
To try and correct this, I removed the existing python interpreter, and re-added a new one. My python is run from venv, so I added this. An error comes up:
I don't think this is related, but I can see that /venv/lib has appears in the System PYTHONPATH list, whereas in Windows the folder is called /venv/Lib, so I added this as well. Still the new django egg hasn't been include, so I manually added this under the 'Libraries' window.
However, I'm still receiving the error message.
The app runs fine from the command line.
Figured this out after a few hours of trying different things.
I created a new Django project using the pydev 2.5 just to see what would happen, and I noticed that the 'django settings module' entry (see below) was appname.settings. Previously I had put 'settings.py'. I removed the entry entirely, which cleared up the first problem.
After this I was getting a 'module appname not found' error, so I tried putting an empty __init__.py file in the root of my app, which seemed to work.
In a virtualenv, this is usually the case where you forgot to add the /Lib from the base python install during the install process (so, when searching in the PYTHONPATH it's not finding things such as 'threading.py' or 'traceback.py', etc.
I solved this by adding the following to manage.py:
import os
os.environ['DJANGO_SETTINGS_MODULE'] = '<django_app_folder>.settings'
os.environ['SERVER_NAME'] = '<name_of_server>'
<django_app_folder> is the name of the folder containing the settings.py file.
<name_of_server> needs to be there, but I didn't find that it matters what it's set to.
I had this problem. My project did not have a PyDev - Django property so the other solution here did not work. I think this is because I did not initially create it as a Django project. Instead, what worked was:
right click project > properties > PyDev PYTHONPATH > String substitution variables.
Add a variable named DJANGO_SETTINGS_MODULE Its value should be yourapp.settings (or edit it if it's already there)

Resources