web-component-tester fails for yeoman generator-polymer - javascript

With the default Polymer app setup provided from Yeoman generator-polymer 0.7.2 with Gulp selected, Web Component Tester (gulp test:local) is failing with the following error when testing Chrome versions 42 and 43:
Cannot read property 'querySelector' of null
at Context. at /app/test/yo-greeting-basic.html:22:0
Line 22 of yo-greeting-basic.html looks like this:
var header = el.shadowRoot.querySelector('h1');
so it seems the problem is a lack of shadow DOM support.
I also get the error
Cannot read property 'push' of undefined
at Context. at /app/test/yo-list-basic.html:23:0
where lines 22-23 of yo-list-basic.html are
var el = document.querySelector('yo-list');
el.items.push('Foo');
and yo-list is the name of the Polymer element defined in yo-list.html. I'm guessing it's the same issue -- the items aren't found because they're in the shadow DOM.
I'm on OS X Yosemite 10.10.3 and I have Chrome 42 and 43 installed.
I understand that Chrome Driver 2.14 has shadow DOM support but I haven't been able to find documentation for setting it up with web-component-tester.
Can someone tell me what I need to do to get these tests to work?

The error you're seeing is probably because WCT is running its own server and 404ing on the resources coming from bower_components. A recent change moved the bower_components dir out of app and it looks like that broke wct. I'll fix this in the next release which should be going out very soon. I'll update this answer when the new release lands.

Related

What does this warning mean? It happens every time I restart the node process

The warning:
(process:3380): GLib-GIO-WARNING **: 12:47:10.778: Unexpectedly, UWP app `HaukeGtze.NotepadEditor_1.795.1.0_x64__6bk20wvc8rfx2' (AUMId `HaukeGtze.NotepadEditor_6bk20wvc8rfx2!notepad') supports 182 extensions but has no verbs
I think the part before the word 'Unexpectedly' is the time, but what does the rest mean?
The last thing I was doing before this started was installing canvas with npm install canvas --save.
So is there a way for me to stop this?
I also noticed it says NotepadEditor there but what does that have to do with anything? It doesn't crash the process, and doesn't seem to affect anything, but it's annoying.
EDIT : it was caused by require('canvas') rather than installing it. So how can I require it without getting the warning?
I encountered similar problem but with "Microsoft.Print3D" and "Microsoft.DesktopAppInstaller" instead.
The cause:
IDK xD. It does say in the https://github.com/frida/glib/blob/master/gio/gwin32appinfo.c#L3477 niry posted before, that:
...for 100% correct handling we (GLib and GIO) need to remember which extensions
(handlers) support which verbs, and each handler gets its own copy of
the verb object, since our design is handler-centric, not
verb-centric. The app also gets a list of verbs, but without handlers
it would have no idea which verbs can be used with which extensions.
As of why it has no verbs, I suspect it has something to do with registers and installation due to the solution I provided below.
My Solution: Reinstalling the problematic app
Before you begin, this only fixed my problem with Print3D and made the problem with DesktopAppInstaller worse; it now says "Failed to open manifest..." and I had to reinstall it, which also removes the problem with canvas.
Run Powershell with Administrator privilege
Get-AppXPackage "HaukeGtze.NotepadEditor" -allusers
If it exists, jump to number 4.
or
Get-AppXPackage -allusers
Find the problematic one (HaukeGtze.NotepadEditor) and note the NAME (not the package full name).
Get-AppXPackage [name here] -allusers | Foreach {Add-AppxPackage -DisableDevelopmentMode -Register "$($_.InstallLocation)\AppXManifest.xml"}
I had the same problem when using Python weasyprint package. It was complaining about Windows PDF X app. GLib-GIO-WARNING **: 11:31:57.620: Unexpectedly, UWP app `6760NGPDFLab.PDFX_1.3.13.0_x64__sbe4t8mqwq93a'. I simply uninstalled the app and the problem went away.

ghost line does nothing even when viewing through the Node debugger?

I have the weirdest bug I have ever seen. I recently upgraded my config package and my Google strategy started failing.
I used the debugger to troubleshoot this error:
In the debugger I got to the line were the internal authorizationURL is supposed to be set:
I even set a watch on it ( it is a property on the options object )
Here is a closeup of the line that does nothing, I call it the ghost line:
I stepped through the code line by line and that particular line does nothing for some reason.
For a reality check I put it in a fiddle / replit:
https://repl.it/#johnmorsey/OpenQueasyHashmap
I have no idea how updating my config package has caused this internal error in Passport - Google Strategy.
In my mind the authorizationURL is clearly an internal property that is being set though "ghosting" in the debugger. But in reality my app is crashing b.c. of the error.

TypeError: 'undefined' is not an object (evaluating 'requireDirs.forEach')

So, I was transitioning code from windows to linux today to make sure everything works. I managed to break casper/phantom and I'm not even sure how.
Here's my command that runs a casper script on linux (ubuntu 12.14):
/usr/bin/casperjs /var/www/tekalyze/phantom/get_site_info.js --jquery-path="/var/www/tekalyze/js/jquery-1.10.2.min.js" --uri-path=" /var/www/tekalyze/phantom/URI.js" --log-path="/var/www/tekalyze/phantom/casper.log" --data-url=http://tekalyze.com/ajax.php --id='19' --url='http://www.bk.com/?utm_source=LOCATIONiq&utm_medium=locallstgs&utm_campaign=2013' --log-level=debug
It's giving me this:
TypeError: 'undefined' is not an object (evaluating 'requireDirs.forEach')
in module (./get_all_urls:102)
/var/www/tekalyze/phantom/get_all_urls.js:102 in _require
/var/www/tekalyze/phantom:13 in anonymous
/home/casper/casperjs/bin/bootstrap.js:146 in _require
/var/www/tekalyze/phantom/get_site_info.js:8
/var/www/tekalyze/phantom/get_site_info.js:228
line 102 of get_all_urls is:
crawl.call(this, links[currentLink]);
I've tried commenting it out, and the stack trace remains the same, which leads me to believe it's not related.
The relevant file can be found here.
I'm honestly just scratching my head. I looked at bootstrap.js:146 and saw something about phantom.casperPath, but I hadn't had to set an environment variable in windows, so I'm not sure about this for linux. The relevant line is this: if (!phantom.casperPath) -- which leads me to believe I could get this to work if I re-write everything to start from phantom first, then set all of the casper variables, but I haven't verified whether or not that will work yet.
Also, I used this script to install them both, so the directories should be set up correctly.
It turns out this functionality isn't added until 1.1.0-DEV, so updating to that instead of using 1.0.0 on linux is the best solution.

Why is my jasmine with a specified browserVersion not failing?

I have set up jasmine tests for my app. In my app I have javascript that shouldn't work in IE8 :
var foo = Object.create(Array.prototype);
When I run mvn jasmine:bdd and I open the test page in Internet Explorer (with browserMode set to Internet Explorer 8), it fails as expected:
TypeError: Object doesn't support property or method 'create'
However, when I run:
mvn jasmine:test -DbrowserVersion=INTERNET_EXPLORER_8
All of my tests are successful. The logs specify that the browserVersion is set to INTERNET_EXPLORER_8.
I expected both to give me the same result. This is causing an issue with our ci testing since it has let out js errors that I wanted to catch.
Should this be working as I'm expecting and if not, what should I change?
Also, this is the best way I know how to test multiple browsers. Is there a better way that I'm missing?
EDIT
A coworker has tried to dash my hopes that the browserVersion wouldn't even catch such an error and suggested that it was only meant to change the header so that the tests could cover browser specific javascript as well (blocks of code that only run when the browser is a specific version). Is this accurate?
It seems very accurate that the jasmine tests browserVersion property does not change the internals of how the js is run, meaning that the quirks or each browser will not be tested. I have successfully transitioned to using js-test-driver for my tests which can run jasmine tests on actual browsers. This looks to be the right way to do this. Although if you're starting new down this path, I'd look at Karma instead (previously named testacular, and built as an improvement on js-test-driver).

sitefinity 6 - events module error javascript

I've upgraded a website from 4.4 to 6.0 and found some issues. Some I already solved but I keep getting one error (javascript I suppose) on events module. When I try to preview/create new/publish/save draft I get the following js error:
TypeError: startDate is null
Unable to get property 'getFullYear' of undefined or null reference
Telerik.Web.UI.WebResource.axd, line 329 character 1
var range=this.get_rangeView().getRange();
var time=this.get_timeView().getRange();
var startDateTime=new Date(time.get_start());
var endDateTime=new Date(time.get_start());
var startDate=range.get_start();
var endDate=range.get_recursUntil();
startDateTime.setFullYear(startDate.getFullYear(),startDate.getMonth(),startDate.getDate());
I reckon that this is dynamically created by Telerik sitefinity and I'm not sure how to fix it. I went to the administration area and checked the relevant configurations and it seems to be everything ok (similar configs as sitefinity 4.4).
Does anyone have an idea how to solve this? I've tried to post a sitefinity forum thread on their website but they took way to much time to answer.
Cheers
by any chance were you using external templates or a custom widget to show the events?
Sitefinity 6.0 apparently rebuilt the events module and it is no longer a simple, flat type. Instead it is a nested (hierarchical) type, with a parent calendar to which events are added (or multiple calendars if you need them).
So if you did any custom code or external template to display the content (in other words anything not out of the box that auto-upgraded itself when you updated to 6.0) you may need to rebuild this custom component to use the latest changes.
Consult the upgrade guide to 6.0 for latest breaking changes that one had the most differences, then compare your custom templates (if any) to the widget templates in the SDK: http://selarom.net/blog/2012/11/06/mapping-sitefinity-templates-from-the-sdk
I hope this is helpful!

Categories

Resources