1
1
mirror of https://github.com/ariya/phantomjs.git synced 2024-08-15 15:50:34 +03:00
Commit Graph

248 Commits

Author SHA1 Message Date
Rawaa Al Kabbani
01d3397002 Fix the outdated post url 2020-06-12 07:47:11 -07:00
Zachary T Jones
9bbd1ab0a3 Update selector in useragent example to prevent TypeError
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
2018-06-02 01:09:14 -07:00
Annamalai
915b69224d Strict mode forbids implicit creation of global property (#14411) 2018-03-06 13:15:47 -08:00
tntim96
7079696db6 Upgrade example to run with Jasmine 2.4.1
https://github.com/ariya/phantomjs/issues/14280
2018-03-06 13:14:26 -08:00
Osman Yuksel
0ba7bc8ef6 #13976 - 'global variables are forbidden in strict mode' issue fixed 2016-05-07 00:46:19 +03:00
Ariya Hidayat
09b42551d7 Remove another service-dependent example script.
Refs #13931
2016-01-24 10:20:41 -08:00
Ariya Hidayat
e90884d224 Remove service-dependent examples
Reduce maintenance burden by not having fragile example scripts.
Fixes #13931
2016-01-23 20:35:34 -08:00
Zack Weinberg
bced581501 Fix whitespace errors introduced in recent commits 2016-01-19 10:38:21 -05:00
Steven Masala
9ac8cccf0a Add "use strict"; declaration to all example scripts.
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.)
2015-12-22 10:29:53 +03:00
Paul Morelle
e2a048a82c examples/run-jasmine2.js: Avoid exception when no tests were run.
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!
2015-12-21 11:19:26 -05:00
Christoph Bünte
b490475a01 Update weather example with latest api changes 2015-12-10 11:43:29 +03:00
salihsagdilek
f7ad5e1649 responsive screenshot example 2015-12-02 13:24:20 +03:00
Monika Schrenk
5264a21648 Added whitespace to output of module.js. 2015-12-02 13:09:49 +03:00
Alex Nicksay
f25c4f11e1 Fix example runner for Jasmine 2.3
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
2015-11-23 21:25:06 +03:00
jmiller76
afd679297b phantomwebintro.js demo fix for #13196
Tested on Windows 7 with 2.0 release.
2015-05-01 11:50:32 -05:00
Marcel Duran
3be7005a17 run-jasmine example: Ensure exit code is always returned.
https://github.com/ariya/phantomjs/pull/12486
2014-08-20 20:56:15 -07:00
Artem
5e018bd650 Update sleepsort.js
https://github.com/ariya/phantomjs/pull/12344
2014-08-19 20:35:06 -07:00
Craig Teegarden
f245d3ed22 update modernizr to 2.8.2 - specifically shows phantomjs supports "legacyflexbox" instead of the current "flexbox"
https://github.com/ariya/phantomjs/issues/12273
2014-08-19 20:18:46 -07:00
Petteri Räty
a86ae1948c Fix rasterize example exit status on failure.
https://github.com/ariya/phantomjs/issues/11911
2014-08-17 23:23:05 -07:00
Ariya Hidayat
48fabe0646 Remove CoffeeScript support.
https://github.com/ariya/phantomjs/issues/12410
2014-07-30 01:29:21 -07:00
Artem Koshelev
3c5302d567 Example of runtime proxy setup
https://github.com/ariya/phantomjs/issues/10803
2014-04-17 23:02:43 -07:00
Ivan De Marino
e9c77252ee Merge branch 'master' of https://github.com/pauloalem/phantomjs into pauloalem-master 2014-03-29 11:28:50 +00:00
petercoles
d831dea8c8 Update example
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.
2014-03-29 11:09:51 +00:00
Adrian Chung
300f28cc5d Add example for how to post a json request to HTTP server
https://github.com/ariya/phantomjs/issues/11969
2014-02-19 21:40:02 -08:00
paulo alem
15d0636b70 Runner for jasmine 2
The old script needed some updates in order to support the new jasmine lib
2014-02-14 19:27:14 -02:00
James McParlane
dca15d7ff6 Added onRepaint callback to webpage API.
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
2014-01-06 23:05:30 +00:00
Bojan Markovic
54c1611801 Added bitmap size and clipping to rasterize.js
Added support for defining window/viewport size and eventual clipping to bitmap rasterization similar to how it is used with paper output.
2014-01-01 13:14:19 +01:00
Vitaliy Slobodin
fdec25ac4c Fix typo in loadurlwithoutcss example
Issue: https://github.com/ariya/phantomjs/issues/11321
2013-06-23 11:28:51 +04:00
Alex Alvarez
3bd7a3dfa6 Netsniff.js example should exit with an error when fails to load the adress
Issue #11333 https://github.com/ariya/phantomjs/issues/11333
2013-05-19 22:29:31 -07:00
Alex Alvarez
2f851086e4 Netsniff.coffee example should exit with an error when fails to load the adress
Issue #11333 https://github.com/ariya/phantomjs/issues/11333
2013-05-19 22:28:09 -07:00
DjinnS
b5345bc133 netsniff example: Exclude Data URI from HAR.
Fixes issue #10740.

https://github.com/ariya/phantomjs/issues/10740
2013-03-20 20:24:59 -07:00
Ariya Hidayat
d42c4002c4 examples/follow: Update Twitter handles.
https://code.google.com/p/phantomjs/issues/detail?id=1082
2013-03-02 21:33:36 -08:00
Alexander James Phillips
5d6b8240f7 page_events example should show requests and navigate to step2url
http://code.google.com/p/phantomjs/issues/detail?id=1028
2013-02-24 16:18:05 -08:00
Dody Suria Wijaya
58566bbe76 Fix concurrent issue on render_multi_url example
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
2013-02-24 10:26:42 -08:00
Capi Etheriel
ca27a8eab1 Use fs.write in the example for clarity.
https://code.google.com/p/phantomjs/issues/detail?id=1082
2013-02-24 08:56:38 -08:00
Ariya Hidayat
fef171e14f Renew the weather example with OpenWeatherMap service.
Google "secret" Weather API is shutdown. Let's use the crowd-sourced
OpenWeatherMap to supply the weather data (albeit there is no forecast
available).

http://code.google.com/p/phantomjs/issues/detail?id=794
2013-02-05 00:27:20 -08:00
Vitaliy Slobodin
09e929d599 Allow to abort network requests.
Issue: http://code.google.com/p/phantomjs/issues/detail?id=230
2013-01-04 23:39:23 -08:00
execjosh
f52044cd31 Emulate spawn and execFile from node.js's child_process module
This is a rudimentary implementation of the following methods
from [node.js's `child_process` module][1]:

 *  `spawn`
 *  `execFile`

The examples are relevant only for *nix operating systems...

The following methods are Not Yet Implemented™:

 *  `exec`
 *  `fork`

[1]: http://nodejs.org/docs/v0.8.16/api/child_process.html

http://code.google.com/p/phantomjs/issues/detail?id=219
2012-12-29 01:03:08 +09:00
execjosh
836719f72e Implement CommonJS IO/A read([n Number])
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_Methods

http://code.google.com/p/phantomjs/issues/detail?id=938
2012-12-25 20:46:14 -08:00
execjosh
f6c87221a7 Implement system.std{in,out,err}
See [issue 333][1] and pull request #192.

**Caveat**

`File::read` currently takes no parameters and is equivalent to a
"`readAll`".  This will be changed later to match [IO/A Spec's
`Stream#read`][2]; but, should still be noted.

[1]: http://code.google.com/p/phantomjs/issues/detail?id=333
[2]: http://wiki.commonjs.org/wiki/IO/A#Instance_Methods
2012-12-25 03:41:34 -08:00
Ariya Hidayat
9c0888d54d Fix potential hang in the example scripts due to missing exit() call.
Patch by Jônatas Pedraza <jonatas.nona@gmail.com> and Vivek Galatage
<vivekgalatage@gmail.com>.

http://code.google.com/p/phantomjs/issues/detail?id=922
2012-12-16 23:02:44 -08:00
fastclemmy
3b2a1c27a1 Update examples/pizza.coffee.
Guess the DOM has changed a little. No more class .address but an (incorrectly used) <address> tag instead. (same pull request as the vanilla JS example)

http://code.google.com/p/phantomjs/issues/detail?id=921
2012-12-16 14:20:57 -08:00
fastclemmy
8f14ef027e Fix examples/pizza.js.
Guess the DOM has changed a little. No more class .address but an (incorrectly used) <address> tag instead.

http://code.google.com/p/phantomjs/issues/detail?id=921
2012-12-16 14:19:57 -08:00
James M. Greene
e8380e42d7 Added CoffeeScript examples where missing, minor other fixes
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
2012-12-06 14:29:37 -06:00
James M. Greene
f61635f2d4 Adding 'WebPage#close' calls where appropriate in example scripts.
Fixes http://code.google.com/p/phantomjs/issues/detail?id=903
2012-12-06 08:27:06 -08:00
Ivan De Marino
e521dc16e7 Adding a simple example to help understand events.
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.
2012-10-16 21:50:53 -07:00
Ariya Hidayat
7921cb00e1 Remove non-working weather example.
The example stops working since the request is blocked. It needs a
rewrite to use a different service.

http://code.google.com/p/phantomjs/issues/detail?id=794
2012-09-22 13:39:19 -07:00
Ian Oxley
e85140e80f Non-zero exit code if any test fails.
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
2012-09-21 00:12:52 -07:00
Ian Oxley
1dbd371540 Added 'tests passed' message.
If all tests pass, a message indicating this is output to the console.

http://code.google.com/p/phantomjs/issues/detail?id=792
2012-09-21 00:12:30 -07:00
Ian Oxley
be767ee983 Test failure CSS selectors changed.
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
2012-09-21 00:11:43 -07:00