casperjs 1.0.0.RC1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.md +289 -1
- data/CONTRIBUTING.md +93 -0
- data/CONTRIBUTORS.md +53 -0
- data/README.md +29 -1
- data/batchbin/casperjs.bat +5 -0
- data/bin/bootstrap.js +164 -114
- data/bin/casperjs +84 -0
- data/bin/usage.txt +2 -1
- data/casperjs.gemspec +7 -4
- data/modules/casper.js +661 -239
- data/modules/clientutils.js +240 -54
- data/modules/colorizer.js +2 -1
- data/modules/events.js +13 -1
- data/modules/http.js +70 -0
- data/modules/mouse.js +1 -2
- data/modules/pagestack.js +166 -0
- data/modules/tester.js +1013 -659
- data/modules/utils.js +519 -367
- data/modules/vendors/coffee-script.js +2 -2
- data/modules/xunit.js +56 -24
- data/package.json +2 -2
- data/rpm/casperjs.spec +203 -0
- data/rpm/mkrpm.sh +25 -0
- data/rubybin/casperjs +9 -4
- data/samples/bbcshots.coffee +11 -10
- data/samples/bbcshots.js +16 -15
- data/samples/cliplay.js +3 -0
- data/samples/customevents.js +3 -0
- data/samples/customlogging.coffee +17 -19
- data/samples/customlogging.js +26 -27
- data/samples/download.js +4 -1
- data/samples/dynamic.js +3 -0
- data/samples/each.js +3 -0
- data/samples/events.js +4 -2
- data/samples/extends.js +4 -1
- data/samples/googlelinks.coffee +4 -1
- data/samples/googlelinks.js +10 -3
- data/samples/googlematch.coffee +1 -1
- data/samples/googlematch.js +5 -2
- data/samples/googlepagination.js +4 -1
- data/samples/googletesting.js +3 -0
- data/samples/logcolor.js +3 -0
- data/samples/metaextract.js +3 -0
- data/samples/multirun.js +3 -0
- data/samples/screenshot.js +4 -1
- data/samples/statushandlers.js +4 -1
- data/samples/steptimeout.js +3 -0
- data/samples/timeout.js +4 -1
- data/samples/translate.coffee +23 -0
- data/samples/translate.js +30 -0
- data/tests/commands/mytest.js +14 -0
- data/tests/commands/script.js +3 -0
- data/tests/run.js +82 -37
- data/tests/sample_modules/config.json +1 -0
- data/tests/sample_modules/csmodule.coffee +1 -0
- data/tests/sample_modules/jsmodule.js +1 -0
- data/tests/selftest.js +57 -0
- data/tests/site/dummy.js +1 -0
- data/tests/site/field-array.html +14 -0
- data/tests/site/frame1.html +10 -0
- data/tests/site/frame2.html +11 -0
- data/tests/site/frame3.html +11 -0
- data/tests/site/frames.html +12 -0
- data/tests/site/global.html +6 -1
- data/tests/site/includes/include1.js +6 -0
- data/tests/site/includes/include2.js +6 -0
- data/tests/site/index.html +3 -0
- data/tests/site/popup.html +19 -0
- data/tests/site/resources.html +7 -8
- data/tests/site/urls.html +14 -0
- data/tests/suites/casper/agent.js +3 -1
- data/tests/suites/casper/alert.js +14 -0
- data/tests/suites/casper/auth.js +24 -0
- data/tests/suites/casper/capture.js +12 -12
- data/tests/suites/casper/click.js +11 -1
- data/tests/suites/casper/confirm.js +24 -16
- data/tests/suites/casper/debug.js +10 -0
- data/tests/suites/casper/elementattribute.js +3 -1
- data/tests/suites/casper/encode.js +6 -2
- data/tests/suites/casper/evaluate.js +78 -18
- data/tests/suites/casper/events.js +3 -1
- data/tests/suites/casper/exists.js +3 -1
- data/tests/suites/casper/fetchtext.js +3 -1
- data/tests/suites/casper/flow.coffee +1 -1
- data/tests/suites/casper/formfill.js +39 -4
- data/tests/suites/casper/frames.js +43 -0
- data/tests/suites/casper/global.js +9 -3
- data/tests/suites/casper/headers.js +41 -0
- data/tests/suites/casper/history.js +3 -1
- data/tests/suites/casper/hooks.js +3 -1
- data/tests/suites/casper/keys.js +15 -0
- data/tests/suites/casper/location.js +21 -0
- data/tests/suites/casper/logging.js +3 -1
- data/tests/suites/casper/mouseevents.js +3 -1
- data/tests/suites/casper/onerror.js +3 -1
- data/tests/suites/casper/open.js +63 -1
- data/tests/suites/casper/popup.js +86 -0
- data/tests/suites/casper/prompt.js +11 -15
- data/tests/suites/casper/request.js +36 -0
- data/tests/suites/casper/resources.coffee +5 -5
- data/tests/suites/casper/scripts.js +32 -0
- data/tests/suites/casper/start.js +3 -1
- data/tests/suites/casper/steps.js +4 -2
- data/tests/suites/casper/urls.js +21 -0
- data/tests/suites/casper/viewport.js +3 -1
- data/tests/suites/casper/visible.js +3 -1
- data/tests/suites/casper/wait.js +22 -12
- data/tests/suites/casper/xpath.js +3 -1
- data/tests/suites/cli.js +3 -1
- data/tests/suites/clientutils.js +57 -3
- data/tests/suites/coffee.coffee +1 -1
- data/tests/suites/fs.js +3 -1
- data/tests/suites/http_status.js +19 -3
- data/tests/suites/popup.js +33 -0
- data/tests/suites/require.js +31 -0
- data/tests/suites/tester.js +134 -29
- data/tests/suites/utils.js +108 -8
- data/tests/suites/xunit.js +37 -6
- metadata +49 -15
- data/modules/injector.js +0 -93
- data/tests/suites/injector.js +0 -64
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,298 @@
|
|
1
1
|
CasperJS Changelog
|
2
2
|
==================
|
3
3
|
|
4
|
-
XXXX-XX-XX, v1.0.
|
4
|
+
XXXX-XX-XX, v1.0.1
|
5
5
|
------------------
|
6
6
|
|
7
|
+
- fixed [#336](https://github.com/n1k0/casperjs/issues/336) - Test result duration may have an exotic value
|
8
|
+
|
9
|
+
2012-12-24, v1.0.0
|
10
|
+
------------------
|
11
|
+
|
12
|
+
### Important Changes & Caveats
|
13
|
+
|
14
|
+
- PhantomJS 1.6.x support has been dropped. Both PhantomJS [1.7](http://phantomjs.org/release-1.7.html) & [1.8](http://phantomjs.org/release-1.8.html) will be supported.
|
15
|
+
- the deprecated `injector` module has been removed from the codebase (RIP dude)
|
16
|
+
- a [`1.0` maintenance branch](https://github.com/n1k0/casperjs/tree/1.0) has been created
|
17
|
+
- CasperJS 1.1 development is now taking place on the `master` branch
|
18
|
+
|
19
|
+
### Bugfixes & enhancements
|
20
|
+
|
21
|
+
- fixed `page.initialized` event didn't get the initialized `WebPage` instance
|
22
|
+
- fixed a bug preventing `Casper.options.onPageInitialized()` from being called
|
23
|
+
- fixed [#215](https://github.com/n1k0/casperjs/issues/215) - fixed broken `--fail-fast` option creating an endless loop on error
|
24
|
+
- fixed `Tester.renderFailureDetails()` which couldn't print failure details correctly in certain circumstances
|
25
|
+
- fixed `Casper.getHTML()` wasn't retrieving active frame contents when using `Casper.withFrame()`
|
26
|
+
- fixed [#327](https://github.com/n1k0/casperjs/issues/327) - event handler for `page.confirm` always returns true
|
27
|
+
- merged PR [#322](https://github.com/n1k0/casperjs/pull/322) - Support number in `Casper.withFrame()`
|
28
|
+
- fixed [#323](https://github.com/n1k0/casperjs/issues/323) - `thenEvaluate()` should be updated to take the same parameters as `evaluate()`, while maintaining backwards compatibility.
|
29
|
+
- merged PR [#319](https://github.com/n1k0/casperjs/pull/319), fixed [#209](https://github.com/n1k0/casperjs/issues/209) - test duration has been added to XUnit XML result file.
|
30
|
+
- `Casper.userAgent()` does not require the instance to be started anymore
|
31
|
+
- dubious tests now have dedicated color & styling
|
32
|
+
- added hint printing when a possible `casperjs` command call is detected
|
33
|
+
|
34
|
+
2012-12-14, v1.0.0-RC6
|
35
|
+
----------------------
|
36
|
+
|
37
|
+
I'm still expecting a 1.0 stable for Christmas. Feedback: bring it on.
|
38
|
+
|
39
|
+
### Important Changes & Caveats
|
40
|
+
|
41
|
+
#### Added experimental support for frames
|
42
|
+
|
43
|
+
A minimal convenient API has been added to Casper in order to ease the switch of current page context:
|
44
|
+
|
45
|
+
```js
|
46
|
+
casper.start('tests/site/frames.html', function() {
|
47
|
+
this.test.assertTitle('CasperJS frameset');
|
48
|
+
});
|
49
|
+
|
50
|
+
casper.withFrame('frame1', function() {
|
51
|
+
this.test.assertTitle('CasperJS frame 1');
|
52
|
+
});
|
53
|
+
|
54
|
+
casper.then(function() {
|
55
|
+
this.test.assertTitle('CasperJS frameset');
|
56
|
+
});
|
57
|
+
```
|
58
|
+
|
59
|
+
#### Reverted to emulated mouse events
|
60
|
+
|
61
|
+
Native mouse events didn't play well with (i)frames, because the computed element coordinates of the clicked element were erroneous.
|
62
|
+
|
63
|
+
So programmatic mouse events are reintroduced back into this corrective RC until a better solution is found.
|
64
|
+
|
65
|
+
### Bugfixes & enhancements
|
66
|
+
|
67
|
+
- merged [#269](https://github.com/n1k0/casperjs/issues/269) - Windows Batch script: fixed unsupported spaces in path and argument splitting
|
68
|
+
|
69
|
+
2012-12-10, v1.0.0-RC5
|
70
|
+
----------------------
|
71
|
+
|
72
|
+
I told you there won't be an 1.0.0-RC5? I lied. Expect 1.0 stable for Christmas, probably.
|
73
|
+
|
74
|
+
### Important Changes & Caveats
|
75
|
+
|
76
|
+
#### Casper.evaluate() signature compatibility with PhantomJS
|
77
|
+
|
78
|
+
`Casper.evaluate()` method signature is now compatible with PhantomJS' one, so you can now write:
|
79
|
+
|
80
|
+
```js
|
81
|
+
casper.evaluate(function(a, b) {
|
82
|
+
return a === "foo" && b === "bar";
|
83
|
+
}, "foo", "bar"); // true
|
84
|
+
```
|
85
|
+
|
86
|
+
The old way to pass arguments has been kept backward compatible in order not to break your existing scripts though:
|
87
|
+
|
88
|
+
```js
|
89
|
+
casper.evaluate(function(a, b) {
|
90
|
+
return a === "foo" && b === "bar";
|
91
|
+
}, {a: "foo", b: "bar"}); // true
|
92
|
+
```
|
93
|
+
|
94
|
+
#### Specification of planned tests
|
95
|
+
|
96
|
+
In order to check that every planned test has actuall been executed, a new optional `planned` parameter has been added to `Tester.done()`:
|
97
|
+
|
98
|
+
```js
|
99
|
+
casper.test.assert(true);
|
100
|
+
casper.test.assert(true);
|
101
|
+
casper.test.assert(true);
|
102
|
+
casper.test.done(4);
|
103
|
+
```
|
104
|
+
|
105
|
+
Will trigger a failure:
|
106
|
+
|
107
|
+
```
|
108
|
+
fail: 4 tests planned, 3 tests executed.
|
109
|
+
```
|
110
|
+
|
111
|
+
That's especially useful in case a given test script is abruptly interrupted leaving you with no obvious way to know it and an erroneous success status.
|
112
|
+
|
113
|
+
The whole [CapserJS test suite](https://github.com/n1k0/casperjs/tree/master/tests/) has been migrated to use this new feature.
|
114
|
+
|
115
|
+
#### Experimental support for popups
|
116
|
+
|
117
|
+
PhantomJS 1.7 ships with support for new opened pages — aka popups. CasperJS can now wait for a popup to be opened and loaded to react accordingly using the new [`Casper.waitForPopup()`](http://casperjs.org/api.html#casper.waitForPopup) and [`Casper.withPopup()`](http://casperjs.org/api.html#casper.withPopup) methods:
|
118
|
+
|
119
|
+
```js
|
120
|
+
casper.start('http://foo.bar/').then(function() {
|
121
|
+
this.test.assertTitle('Main page title');
|
122
|
+
this.clickLabel('Open me a popup');
|
123
|
+
});
|
124
|
+
|
125
|
+
// this will wait for the popup to be opened and loaded
|
126
|
+
casper.waitForPopup(/popup\.html$/, function() {
|
127
|
+
this.test.assertEquals(this.popups.length, 1);
|
128
|
+
});
|
129
|
+
|
130
|
+
// this will set the popup DOM as the main active one only for time the
|
131
|
+
// step closure being executed
|
132
|
+
casper.withPopup(/popup\.html$/, function() {
|
133
|
+
this.test.assertTitle('Popup title');
|
134
|
+
});
|
135
|
+
|
136
|
+
// next step will automatically revert the current page to the initial one
|
137
|
+
casper.then(function() {
|
138
|
+
this.test.assertTitle('Main page title');
|
139
|
+
});
|
140
|
+
```
|
141
|
+
|
142
|
+
#### `Casper.mouseEvent()` now uses native events for most operations
|
143
|
+
|
144
|
+
Native mouse events from PhantomJS bring a far more accurate behavior.
|
145
|
+
|
146
|
+
Also, `Casper.mouseEvent()` will now directly trigger an error on failure instead of just logging an `error` event.
|
147
|
+
|
148
|
+
### Bugfixes & enhancements
|
149
|
+
|
150
|
+
- fixed [#308](https://github.com/n1k0/casperjs/issues/308) & [#309](https://github.com/n1k0/casperjs/issues/309) - proper module error backtraces
|
151
|
+
- fixed [#306](https://github.com/n1k0/casperjs/issues/306) - Raise an explicit error on invalid test path
|
152
|
+
- fixed [#300](https://github.com/n1k0/casperjs/issues/300) - Ensure that `findOne()` and `findAll()` observe the scope for XPath expressions, not just when passed CSS selectors
|
153
|
+
- fixed [#294](https://github.com/n1k0/casperjs/issues/294) - Automatically fail test on any runtime error or timeout
|
154
|
+
- fixed [#281](https://github.com/n1k0/casperjs/issues/281) - `Casper.evaluate()` should take an array as context not object
|
155
|
+
- fixed [#266](https://github.com/n1k0/casperjs/issues/266) - Fix `tester` module and its self tests
|
156
|
+
- fixed [#268](https://github.com/n1k0/casperjs/issues/266) - Wrong message on step timeout
|
157
|
+
- fixed [#215](https://github.com/n1k0/casperjs/issues/215) - added a `--fail-fast` option to the `casper test` command, in order to terminate a test suite execution as soon as any failure is encountered
|
158
|
+
- fixed [#274](https://github.com/n1k0/casperjs/issues/274) - some headers couldn't be set
|
159
|
+
- fixed [#277](https://github.com/n1k0/casperjs/issues/277) - multiline support in `ClientUtils.echo()`
|
160
|
+
- fixed [#282](https://github.com/n1k0/casperjs/issues/282) - added support for remote client scripts loading with a new `remoteScripts` casper option
|
161
|
+
- fixed [#290](https://github.com/n1k0/casperjs/issues/#290) - add a simplistic RPM spec file to make it easier to (un)install casperjs
|
162
|
+
- fixed [`utils.betterTypeOf()`](http://casperjs.org/api.html#casper.betterTypeOf) to properly handle `undefined` and `null` values
|
163
|
+
- fixed `Casper.die()` and `Casper.evaluateOrDie()` were not printing the error onto the console
|
164
|
+
- added JSON support to `require()`
|
165
|
+
- added [`Tester.assertTruthy()`](http://casperjs.org/api.html#tester.assertTruthy) and [`Tester.assertFalsy()`](http://casperjs.org/api.html#tester.assertFalsy)
|
166
|
+
- added [`Casper.sendKeys()`](http://casperjs.org/api.html#casper.sendKeys) to send native keyboard events to the element matching a given selector
|
167
|
+
- added [`Casper.getFormValues()`](http://casperjs.org/api.html#casper.getFormValues) to check for the field values of a given form
|
168
|
+
- added [`Tester.assertTextDoesntExist()`](http://casperjs.org/api.html#tester.assertTextDoesntExist)
|
169
|
+
- added `Tester.assertFalse()` as an alias of `Tester.assertNot()`
|
170
|
+
- added `page.resource.requested` and `page.resource.received` events
|
171
|
+
- added [`translate.js`](https://github.com/n1k0/casperjs/tree/master/samples/translate.js) and [`translate.coffee`](https://github.com/n1k0/casperjs/tree/master/samples/translate.coffee) samples
|
172
|
+
|
173
|
+
2012-10-31, v1.0.0-RC4
|
174
|
+
----------------------
|
175
|
+
|
176
|
+
Next version should be 1.0.0 stable.
|
177
|
+
|
178
|
+
- fixed [#261](https://github.com/n1k0/casperjs/issues/261) - Impossible to require CoffeeScript modules
|
179
|
+
- fixed [#262](https://github.com/n1k0/casperjs/issues/262) - Injecting clientScripts is not working
|
180
|
+
- fixed [#259](https://github.com/n1k0/casperjs/issues/259) - enhanced `Tester.assertField()` method, which can now tests for other field types than `input`s.
|
181
|
+
- fixed `Casper.getCurrentUrl()` could misbehave with encoded urls
|
182
|
+
- added [`Casper.echo()`](http://casperjs.org/api.html#clientutils.echo) to print a message to the casper console from the remote DOM environment
|
183
|
+
- added [`Casper.waitForText()`](http://casperjs.org/api.html#casper.waitForText) to wait for a given text to be present in page HTML contents
|
184
|
+
- added [`ClientUtils.getFieldValue()`](http://casperjs.org/api.html#clientutils.getFieldValue)
|
185
|
+
- Local CoffeeScript version has been upgraded to 1.4.0
|
186
|
+
|
187
|
+
2012-10-23, v1.0.0-RC3
|
188
|
+
----------------------
|
189
|
+
|
190
|
+
### Important Changes & Caveats
|
191
|
+
|
192
|
+
- the `injector` module is now deprecated, but kept for backward compatibility purpose.
|
193
|
+
- **BC BREAK**: fixes [#220](https://github.com/n1k0/casperjs/issues/220), [#237](https://github.com/n1k0/casperjs/issues/237) - added a `waitTimeout` options, removed `defaultWaitTimeout` option.
|
194
|
+
- **BC BREAK** (for the better): fixes [#249](https://github.com/n1k0/casperjs/issues/249) - default timeout functions don't `die()` anymore in tests
|
195
|
+
- **BC BREAK** (for the better): merged [#188](https://github.com/n1k0/casperjs/issues/188) - Easy access to current response object;
|
196
|
+
You can now access the current response object as the first parameter of step callbacks:
|
197
|
+
|
198
|
+
```javascript
|
199
|
+
require('casper').create().start('http://www.google.fr/', function(response) {
|
200
|
+
require('utils').dump(response);
|
201
|
+
}).run();
|
202
|
+
```
|
203
|
+
|
204
|
+
That gives:
|
205
|
+
|
206
|
+
```
|
207
|
+
$ casperjs dump-headers.js
|
208
|
+
{
|
209
|
+
"contentType": "text/html; charset=UTF-8",
|
210
|
+
"headers": [
|
211
|
+
{
|
212
|
+
"name": "Date",
|
213
|
+
"value": "Thu, 18 Oct 2012 08:17:29 GMT"
|
214
|
+
},
|
215
|
+
{
|
216
|
+
"name": "Expires",
|
217
|
+
"value": "-1"
|
218
|
+
},
|
219
|
+
// ... lots of other headers
|
220
|
+
],
|
221
|
+
"id": 1,
|
222
|
+
"redirectURL": null,
|
223
|
+
"stage": "end",
|
224
|
+
"status": 200,
|
225
|
+
"statusText": "OK",
|
226
|
+
"time": "2012-10-18T08:17:37.068Z",
|
227
|
+
"url": "http://www.google.fr/"
|
228
|
+
}
|
229
|
+
```
|
230
|
+
|
231
|
+
To fetch a particular header by its name:
|
232
|
+
|
233
|
+
```javascript
|
234
|
+
require('casper').create().start('http://www.google.fr/', function(response) {
|
235
|
+
this.echo(response.headers.get('Date'));
|
236
|
+
}).run();
|
237
|
+
```
|
238
|
+
|
239
|
+
That gives:
|
240
|
+
|
241
|
+
```javascript
|
242
|
+
$ casperjs dump-single-header.js
|
243
|
+
Thu, 18 Oct 2012 08:26:34 GMT
|
244
|
+
```
|
245
|
+
|
246
|
+
The documentation has been [updated accordingly](http://casperjs.org/api.html#casper.then.callbacks).
|
247
|
+
|
248
|
+
### Bugfixes & enhancements
|
249
|
+
|
250
|
+
- merged [#234](https://github.com/n1k0/casperjs/issues/234) - New Windows Loader written in Batch. Python is no more a requirement for using CasperJS on Windows. New installation instructions are [available](http://casperjs.org/installation.html#windows).
|
251
|
+
- a new `onWaitTimeout` option has been added, to allow defining a default behavior when a `waitFor*` function times out.
|
252
|
+
- [Casper.resourceExists()](http://casperjs.org/api.html#casper.resourceExists) and related functions now checks for non HTTP-404 received responses.
|
253
|
+
- fixed [#167](https://github.com/n1k0/casperjs/issues/167) - fixed opening truncated/uncomplete root urls may give erroneous HTTP statuses
|
254
|
+
- closes [#205](https://github.com/n1k0/casperjs/issues/205) - [`debugHTML()`](http://casperjs.org/api.html#casper.debugHTML) can have a selector passed; added [`getHTML()`](http://casperjs.org/api.html#casper.getHTML)
|
255
|
+
- closes [#230](https://github.com/n1k0/casperjs/issues/230) - added [`ClientUtils.getElementsBound()`](http://casperjs.org/api.html#clientutils.getElementsBounds) and [`Casper.getElementsBound()`](http://casperjs.org/api.html#casper.getElementsBounds)
|
256
|
+
- fixed [#235](https://github.com/n1k0/casperjs/issues/235) - updated `Casper.evaluate()` to use phantomjs >= 1.6 native one. As a consequence, **the `injector` module is marked as deprecated**.
|
257
|
+
- fixed [#250](https://github.com/n1k0/casperjs/issues/250) - prevent self tests to be run using the standard `casper test` command
|
258
|
+
- fixed [#254](https://github.com/n1k0/casperjs/issues/254) - fix up one use of qsa, hit when filling forms with missing elements
|
259
|
+
- [fixed](https://github.com/n1k0/casperjs/commit/ef6c1828c7b64e1cf99b98e27600d0b63308cad3) edge case when current document url couldn't be properly decoded
|
260
|
+
|
261
|
+
2012-10-01, v1.0.0-RC2
|
262
|
+
----------------------
|
263
|
+
|
264
|
+
### Important Changes & Caveats
|
265
|
+
|
266
|
+
- **PhantomJS 1.6 is now the minimal requirement**, PhantomJS 1.7 is supported.
|
267
|
+
- CasperJS continues to ship with its own implementation of CommonJS' module pattern, due to the way it has to work to offer its own executable. While the implementations are nearly the same, **100% compatibility is not guaranteed**.
|
268
|
+
|
269
|
+
### Bugfixes & enhancements
|
270
|
+
|
271
|
+
- fixed [#119](https://github.com/n1k0/casperjs/issues/119) - `Casper.currentHTTPStatus` now defaults to `null` when resource are loaded using the `file://` protocol
|
272
|
+
- fixed [#130](https://github.com/n1k0/casperjs/issues/130) - added a `--no-colors` option to the `casper test` command to skip output coloration
|
273
|
+
- fixed [#153](https://github.com/n1k0/casperjs/issues/153) - erroneous mouse event results when `event.preventDefault()` was used.
|
7
274
|
- fixed [#164](https://github.com/n1k0/casperjs/issues/164) - ability to force CLI parameters as strings (see [related documentation](http://casperjs.org/cli.html#raw)).
|
275
|
+
- fixed [#178](https://github.com/n1k0/casperjs/issues/178) - added `Casper.getPageContent()` to access raw page body contents on non-html received content-types.
|
276
|
+
- fixed [#180](https://github.com/n1k0/casperjs/issues/180) - CasperJS tests are now run against a local HTTP test server. A new `casper selftest` command has been added as well.
|
277
|
+
- fixed [#189](https://github.com/n1k0/casperjs/issue/189) - fixed invalid XML due to message colorization
|
278
|
+
- fixed [#197](https://github.com/n1k0/casperjs/pull/197) & [#240](https://github.com/n1k0/casperjs/pull/240/) - Added new tester methods:
|
279
|
+
* [`assertField`](http://casperjs.org/api.html#tester.assertField)
|
280
|
+
* [`assertSelectorHasText`](http://casperjs.org/api.html#tester.assertSelectorHasText)
|
281
|
+
* [`assertSelectorDoesntHaveText`](http://casperjs.org/api.html#tester.assertSelectorDoesntHaveText)
|
282
|
+
* [`assertVisible`](http://casperjs.org/api.html#tester.assertVisible)
|
283
|
+
* [`assertNotVisible`](http://casperjs.org/api.html#tester.assertNotVisible)
|
284
|
+
- fixed [#202](https://github.com/n1k0/casperjs/pull/202) - Fix test status timeouts when running multiple suites
|
285
|
+
- fixed [#204](https://github.com/n1k0/casperjs/pull/204) - Fix for when the url is changed via javascript
|
286
|
+
- fixed [#210](https://github.com/n1k0/casperjs/pull/210) - Changed `escape` to `encodeURIComponent` for downloading binaries via POST
|
287
|
+
- fixed [#216](https://github.com/n1k0/casperjs/pull/216) - Change clientutils to be able to set a global scope
|
288
|
+
- fixed [#219](https://github.com/n1k0/casperjs/issues/219) - ease chaining of `run()` calls ([more explanations](https://groups.google.com/forum/#!topic/casperjs/jdQ-CrgnUd8))
|
289
|
+
- fixed [#222](https://github.com/n1k0/casperjs/pull/222) & [#211](https://github.com/n1k0/casperjs/issues/211) - Change mouse event to include an X + Y value for click position
|
290
|
+
- fixed [#231](https://github.com/n1k0/casperjs/pull/231) - added `--pre` and `--post` options to the `casperjs test` command to load test files before and after the execution of testsuite
|
291
|
+
- fixed [#232](https://github.com/n1k0/casperjs/issues/232) - symlink resolution in the ruby version of the `casperjs` executable
|
292
|
+
- fixed [#236](https://github.com/n1k0/casperjs/issues/236) - fixed `Casper.exit` returned `this` after calling `phantom.exit()` which may caused PhantomJS to hang
|
293
|
+
- fixed [#252](https://github.com/n1k0/casperjs/issues/252) - better form.fill() error handling
|
294
|
+
- added [`ClientUtils.getDocumentHeight()`](http://casperjs.org/api.html#clientutils.getDocumentHeight)
|
295
|
+
- added [`toString()`](http://casperjs.org/api.html#casper.toString) and [`status()`](http://casperjs.org/api.html#casper.status) methods to `Casper` prototype.
|
8
296
|
|
9
297
|
2012-06-26, v1.0.0-RC1
|
10
298
|
----------------------
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,93 @@
|
|
1
|
+
# Contribution Guide
|
2
|
+
|
3
|
+
*Note: this guide has been heavily inspired by [PhantomJS' one](https://github.com/ariya/phantomjs/blob/master/CONTRIBUTING.md).*
|
4
|
+
|
5
|
+
**This page describes how to contribute changes to the [CasperJS](http://casperjs.org/) project.**
|
6
|
+
|
7
|
+
Please do **not** create a pull request without reading this guide first. Failure to do so may result in the **rejection** of the pull request.
|
8
|
+
|
9
|
+
## For The Impatients
|
10
|
+
|
11
|
+
**Work on a feature branch**.
|
12
|
+
If your changes need to be modified due to some reviews, it is less clutter to tweak an isolated feature branch and push it again.
|
13
|
+
|
14
|
+
**Create a ticket in the [issue tracker](https://github.com/n1k0/casperjs/issues/)**.
|
15
|
+
This serves as a placeholder for important feedback, review, or any future updates. **Please ensure searching the bugtracker for an already opened issue matching your case before filing a new issue.**
|
16
|
+
|
17
|
+
In the commit message(s):
|
18
|
+
|
19
|
+
* **Keep the first line short**. Write additional paragraphs if necessary.
|
20
|
+
* **Reference an opened issue**, by referencing the issue ID prefixed by a `#` and the keyword `refs`, eg. `refs #123`
|
21
|
+
|
22
|
+
Sample commit message:
|
23
|
+
|
24
|
+
> refs #123 - fixed error message formatting
|
25
|
+
>
|
26
|
+
> (optional: a short explanation of what the patch actually does)
|
27
|
+
|
28
|
+
**Run tests**
|
29
|
+
|
30
|
+
Run CasperJS' test suite to see you didn't break something:
|
31
|
+
|
32
|
+
$ casperjs selftest
|
33
|
+
|
34
|
+
The result status bar **must be green** before sending your PR.
|
35
|
+
|
36
|
+
## Communicate
|
37
|
+
|
38
|
+
**Improvement and feature request**. If you have an improvement idea, please send an email to the [mailing list](http://groups.google.com/group/casperjs) (preferable than contacting the developers directly) so that other people can give their insights and opinions. This is also important to avoid duplicate work.
|
39
|
+
|
40
|
+
**Help request**. If you're stuck using CasperJS and don't understand how to achieve something, please [ask on the mailing-list](https://groups.google.com/forum/#!forum/casperjs) first. Please don't ask for all the kind people to write your scripts for you.
|
41
|
+
|
42
|
+
**Ensure the issue is related to CasperJS**. Please try to reproduce the issue using plain PhantomJS. If it works with the native PhantomJS API but doesn't with CasperJS, then the issue is probably valid. In the opposite case, please file an issue on [PhantomJS issue tracker](http://code.google.com/p/phantomjs/issues/list).
|
43
|
+
|
44
|
+
**Extending with new API**. Whenever you want to introduce a new API, please send an email to the mailing list along with the link to the issue if any. It may require few iterations to agree on the final API and hence it is important to engage all interested parties as early as possible.
|
45
|
+
|
46
|
+
## Get Ready
|
47
|
+
|
48
|
+
### Use Feature Branch
|
49
|
+
|
50
|
+
To isolate your change, please avoid working on the master branch. Instead, work on a *feature branch* (often also known as *topic branch*). You can create a new branch (example here crash-fix) off the master branch by using:
|
51
|
+
|
52
|
+
git checkout -b crash-fix master
|
53
|
+
|
54
|
+
Refer to your favorite Git tutorial/book for further detailed help.
|
55
|
+
|
56
|
+
Some good practices for the feature branch:
|
57
|
+
|
58
|
+
* Give it a meaningful name instead of, e.g. `prevent-zero-divide` instead of just `fix`
|
59
|
+
* Make *granular* and *atomic* commits, e.g. do not mix a typo fix with some major refactoring
|
60
|
+
* Keep one branch for one specific issue. If you need to work on other unrelated issues, create another branch.
|
61
|
+
|
62
|
+
### Write tests
|
63
|
+
|
64
|
+
CasperJS being partly a testing framework, how irrelevant would be to send a pull request with no test? So, please take the time to write and attach tests to your PR. Furthermore, testing with CasperJS is quite [exhaustively documented](http://casperjs.org/testing.html).
|
65
|
+
|
66
|
+
### Run tests!
|
67
|
+
|
68
|
+
This may sound obvious but **don't send pull requests which break the casperjs test suite**.
|
69
|
+
|
70
|
+
To see if your modifications broke the suite, just run:
|
71
|
+
|
72
|
+
$ casperjs selftest
|
73
|
+
|
74
|
+
### Write documentation
|
75
|
+
|
76
|
+
Do you appreciate the [CasperJS documentation](http://casperjs.org/)? I do too. As the documentation contents are managed and generated using Github, Markdown and CasperJS itself, take the time to read the [Documentation Contribution Guide](https://github.com/n1k0/casperjs/blob/gh-pages/README.md#casperjs-documentation) and write the documentation related to your PR whenever applicable.
|
77
|
+
|
78
|
+
**Note:** As the documentation is handled in a [dedicated separated `gh-pages` branch](https://github.com/n1k0/casperjs/tree/gh-pages), you'll have to send a dedicated PR for doc patches. I'm working on a more comfortable solution, but it's no easy task though.
|
79
|
+
|
80
|
+
## Review and Merge
|
81
|
+
|
82
|
+
When your branch is ready, send the pull request.
|
83
|
+
|
84
|
+
While it is not always the case, often it is necessary to improve parts of your code in the branch. This is the actual review process.
|
85
|
+
|
86
|
+
Here is a check list for the review:
|
87
|
+
|
88
|
+
* It does not break the test suite
|
89
|
+
* There is no typo
|
90
|
+
* The coding style follows the existing one
|
91
|
+
* There is a reasonable amount of comment
|
92
|
+
* The license header is intact
|
93
|
+
* All examples are still working
|
data/CONTRIBUTORS.md
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
# CasperJS contributors
|
2
|
+
|
3
|
+
You can check out the [contribution graphs on github](https://github.com/n1k0/casperjs/graphs/contributors).
|
4
|
+
|
5
|
+
```
|
6
|
+
$ git shortlog -s -n | cut -c8-
|
7
|
+
Nicolas Perriault
|
8
|
+
Brikou CARRE
|
9
|
+
oncletom
|
10
|
+
hannyu
|
11
|
+
Chris Lorenzo
|
12
|
+
Victor Yap
|
13
|
+
nrabinowitz
|
14
|
+
pborreli
|
15
|
+
Rob Barreca
|
16
|
+
Andrew Childs
|
17
|
+
Solomon White
|
18
|
+
reina.sweet
|
19
|
+
Dave Lee
|
20
|
+
Reina Sweet
|
21
|
+
Elmar Langholz
|
22
|
+
Jason Funk
|
23
|
+
Donovan Hutchinson
|
24
|
+
Julien Moulin
|
25
|
+
Michael Geers
|
26
|
+
Jan Schaumann
|
27
|
+
Clochix
|
28
|
+
Raphaël Benitte
|
29
|
+
Tim Bunce
|
30
|
+
alfetopito
|
31
|
+
jean-philippe serafin
|
32
|
+
snkashis
|
33
|
+
Andrew de Andrade
|
34
|
+
Ben Lowery
|
35
|
+
Chris Winters
|
36
|
+
Christophe Benz
|
37
|
+
Harrison Reiser
|
38
|
+
Jan Pochyla
|
39
|
+
Jan-Martin Fruehwacht
|
40
|
+
Julian Gruber
|
41
|
+
Justin Slattery
|
42
|
+
Justine Tunney
|
43
|
+
KaroDidi
|
44
|
+
Leandro Boscariol
|
45
|
+
Maisons du monde
|
46
|
+
Marcel Duran
|
47
|
+
Mathieu Agopian
|
48
|
+
Mehdi Kabab
|
49
|
+
Mikko Peltonen
|
50
|
+
Pascal Borreli
|
51
|
+
Rafael
|
52
|
+
Rafael Garcia
|
53
|
+
```
|
data/README.md
CHANGED
@@ -23,7 +23,35 @@ Subscribe to the [project mailing-list](https://groups.google.com/forum/#!forum/
|
|
23
23
|
|
24
24
|
Follow the CasperJS project [on twitter](https://twitter.com/casperjs_org) and [Google+](https://plus.google.com/b/106641872690063476159/).
|
25
25
|
|
26
|
-
##
|
26
|
+
## Show me some code!
|
27
|
+
|
28
|
+
Sample test to see if some dropdown can be opened:
|
29
|
+
|
30
|
+
```javascript
|
31
|
+
casper.start('http://twitter.github.com/bootstrap/javascript.html#dropdowns', function() {
|
32
|
+
this.test.assertExists('#navbar-example');
|
33
|
+
this.click('#dropdowns .nav-pills .dropdown:last-of-type a.dropdown-toggle');
|
34
|
+
this.waitUntilVisible('#dropdowns .nav-pills .open', function() {
|
35
|
+
this.test.pass('Dropdown is open');
|
36
|
+
});
|
37
|
+
});
|
38
|
+
|
39
|
+
casper.run(function() {
|
40
|
+
this.test.done();
|
41
|
+
});
|
42
|
+
```
|
43
|
+
|
44
|
+
Run the script:
|
45
|
+
|
46
|
+
![](http://cl.ly/image/112m0F2n162i/Capture%20d%E2%80%99%C3%A9cran%202012-10-19%20%C3%A0%2016.37.15.png)
|
47
|
+
|
48
|
+
## Contributing
|
49
|
+
|
50
|
+
### Contributing code
|
51
|
+
|
52
|
+
Please read the [CONTRIBUTING.md](https://github.com/n1k0/casperjs/blob/master/CONTRIBUTING.md) file contents.
|
53
|
+
|
54
|
+
### Contributing documentation
|
27
55
|
|
28
56
|
CasperJS's documentation is written using the [Markdown format](http://daringfireball.net/projects/markdown/), and hosted on Github thanks to the [Github Pages Feature](http://pages.github.com/).
|
29
57
|
|