The DOM structure of the page that is retrieved by useragent.js
has changed since the example was last updated, and the selector
for the user agent value no longer exists. This causes a TypeError
to be output to the user when running the example. This updates
the example to use a selector that exists on the page.
https://github.com/ariya/phantomjs/issues/15392
modernizr.js is not modified because it's not our code.
En passant fixes:
* Delete two scripts that depended on a Yahoo service that
appears no longer to exist.
* The PhantomJS website no longer has a leading www.
* One script needed correction to *work* in strict mode.
* One script would only exit if a page loaded successfully.
(There may be other instances of this problem, this is the
one I noticed.)
When all tests were skipped, or when no tests were found, run-jasmine2.js
would raise an exception because ".alert > .bar.passed" doesn't exist. As
".alert > .bar.skipped" exists instead, and has similar interesting
content, let's use it!
Some banner elements (particularly the test run duration) have moved; this
change extracts the text values from the new locations. Also, the test run
duration is now populated after all tests are run, so include it as a "complete"
condition in the `waitsFor` function.
Closes#13459
Since this example was written the phantomjs home page has been redesigned and the targeted ID no longer exists. This tweaks the example so that it can again find content to report.
Enables subscription to RepaintRequested events.
When the callback is invoked the time that the repaint was requested as well as the x,y and width,height of the repainted rectangle are provided as parameters.
Usage: page.onRepaint = function(time, x, y, width, height) { }
https://github.com/ariya/phantomjs/issues/11793
webkit (thus phantomjs) load() does not call loadFinished at the expected timing when running concurrently. The example is changed to run non-concurrently as a work around.
Issue: http://code.google.com/p/phantomjs/issues/detail?id=1021
The [IO/A spec][1] for `read` is as follows:
> Read up to n bytes from the stream, or until the end of the stream
> has been reached. [If] n is null, reads up to the block size of the
> underlying device, or up to 1024 bytes if the block size is not
> discernible. If n is not specified, this method always reads the
> full stream until its end is reached. ...
Since discovering the block size of the underlying device is
non-trivial, we will just default to 1024.
**NOTE**
The initial implementation of `File::read()` saves the current
(original) position, seeks to the beginning of the stream,
`readAll`s to the end, and then resets to the original position.
I think that this behavior is unexpected and should be changed--it
should read from the current position to the end of the stream and
stay there. The user should explicitly `seek` to the beginning of
the stream when necessary.
With the current implementation, the user should note that the
position *will not change* after calling `read()` with no arguments.
[1]: http://wiki.commonjs.org/wiki/IO/A#Instance_Methodshttp://code.google.com/p/phantomjs/issues/detail?id=938
Added CoffeeScript examples where missing, minor other fixes such as spacing standardization (2 spaces is the standard in CoffeeScript via Ruby). Also a small set of minor JS example fixes and additional comments.
Fixes http://code.google.com/p/phantomjs/issues/detail?id=907
Lots of discussions on the ML could be easily put
to rest if people could run something like this
and see the result.
It's not a real fix or improvement, just a "cute"
example and as such I didn't raise a "proper"
issue.
In the callback function passed to `waitFor`, the call to `page.evaluate`
returns a 1 or 0, and this is then passed to `phantom.exit` (with a 1
indicating at least one test failed, 0 indicating all tests passed).
http://code.google.com/p/phantomjs/issues/detail?id=792
Changed the CSS selectors used to identify failed tests.
The old selector was `div.jasmine_reporter > div.suite.failed`,
but this no longer seems to match any elements.
The new selector is `.results > #details > .specDetails.failed`. For each
failing test the `.description` and `.resultMessage.fail` elements are
used to output the failures to the console.
http://code.google.com/p/phantomjs/issues/detail?id=792