New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
piwik.js unit tests and cross browser testing #2072
Comments
(In [3863]) refs #2072 - add some missing unit tests
|
It would be nice to re-enable getVisitorId() but this is not critical for 1.2 |
In IE, there seem to be an error in JSON.parse when trying to decode the cookie. The attached file should replicate the issue (ie 8). The error only shows on the second refresh. |
Attachment: IE8 BUG: outputs JSON.parse error on second refresh |
Opera also fails (tested on Windows), with this test use case. |
(In [3903]) Refs #2072
|
Opera has a built-in/native JSON implementation since Opera 10.50. I've already found a bug in its stringify() implementation (reproduceable with 10.62 and 11.01), so I'll be tweaking piwik.js to always use Crockford's JSON module (even if the browser has native support). This should give us more consistent results across platforms. |
(The native JSON implementation was introduced in IE8. Hence the JSON.parse differences.) |
I was echoing in the implementation in json.js and it was executed I think. I just put a document.write(err.message); in the piwik catch block and it was showing the exception thrown in JSON.parse Maybe they interact somehow? |
I'm not sure why (this is not a regression apparently), but sometimes downloads eg. http://piwik.org/latest.zip is counted as an outlink in Piwik. For example, yesterday Piwik missed 39 out of 310 downloads or 13% - there might be a bug somewhere in the JS ? |
That's the behaviour for subdomains (e.g., de.piwik.org) if you don't use tracker.setDomains('*.piwik.org'). |
Replying to matt:
shrug I'm not getting the exception with my dev version of piwik.js on IE8 or Opera. |
on trunk, I apply this patch:
then create a index.php for your root directory containing hte following code:
with your piwik trunk installed in localhost/trunk I see the JSON.parse message displayed in IE 8.0.6001. After upgrading Opera, opera doesn't show an error anymore, nice! But still IE :( |
Ran into another bug in Opera 10.62 and 11.01 where the browser may spontaneously duplicate an HTTP request (i.e., the server will receive two requests for the same URL, including query parameters). This one has no workaround. It's spurious, so I use a loop to increase the chances of reproducing the bug. Filed as DSK-328881:
|
in r3939, added more unit tests |
excellent work Anthon, I wouldnt have thought of the native JSON conflict. but why was the JSON function triggered? Is there any manual testing to be done, for example the following functions and check the cookies: Regarding getVisitorId() it looks like it now works when called before track*, excellent. Maybe we should advertise this feature as it could lead to interesting features and integrate (with the Live! API) cool features. Let me know. Otherwise, please close the ticket as I don't have the error anymore and code & tests looks good |
(In [3944]) refs #2072 - handle misconfigured "*." wildcard in setCookieDomain() |
(In [3945]) refs #2072 - refactor to simplify isSiteHostName() |
re: comment:17 yes these are tested manually. (For example, using Firefox's "View Cookie Information" to examine the cookie domain and path.) |
FYI piwik.js unit tests ran successfully on:
On Win98SE with IE6, the unit tests passed but ran twice (reported 544 tests). On other version of Windows with IE6, the unit tests ran correctly (reporting 272 tests). Other browsers included:
The unit tests failed on:
Untested on:
|
For the unit tests that failed, basic tracking code worked for:
These errored out:
|
|
wow very impressive test suite! I think as long as the basic tracking at least works, it is good. Of course it would be nice if at least there was no error thrown, but I think the browsers that fail the tests are definitely very old and not expected. |
Missing unit tests for:
Cannot test in WebTest or QUnit:
Will require Selenium:
These tests are incomplete:
The text was updated successfully, but these errors were encountered: