Blame view

CHANGELOG.md 18.1 KB
1 2 3
CasperJS Changelog
==================

4 5 6 7 8 9
XXXX-XX-XX, v1.0.0
------------------

This version is yet to be released.

- fixed [#259](https://github.com/n1k0/casperjs/issues/259) - enhanced `Tester.assertField()` method, which can now tests for other field types than `input`s.
10
- added [`Casper.waitForText()`](http://casperjs.org/api.html#casper.waitForText) to wait for a given text to be present in page HTML contents
11 12
- added [`ClientUtils.getFieldValue()`](http://casperjs.org/api.html#clientutils.getFieldValue)

Nicolas Perriault authored
13 14
2012-10-23, v1.0.0-RC3
----------------------
15

16 17
### Important Changes & Caveats

18
- the `injector` module is now deprecated, but kept for backward compatibility purpose.
19 20 21
- **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.
- **BC BREAK** (for the better): fixes [#249](https://github.com/n1k0/casperjs/issues/249) - default timeout functions don't `die()` anymore in tests
- **BC BREAK** (for the better): merged [#188](https://github.com/n1k0/casperjs/issues/188) - Easy access to current response object;
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
  You can now access the current response object as the first parameter of step callbacks:

```javascript
require('casper').create().start('http://www.google.fr/', function(response) {
    require('utils').dump(response);
}).run();
```

That gives:

```
$ casperjs dump-headers.js
{
    "contentType": "text/html; charset=UTF-8",
    "headers": [
        {
            "name": "Date",
            "value": "Thu, 18 Oct 2012 08:17:29 GMT"
        },
        {
            "name": "Expires",
            "value": "-1"
        },
        // ... lots of other headers
    ],
    "id": 1,
    "redirectURL": null,
    "stage": "end",
    "status": 200,
    "statusText": "OK",
    "time": "2012-10-18T08:17:37.068Z",
    "url": "http://www.google.fr/"
}
```

Nicolas Perriault authored
57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
To fetch a particular header by its name:

```javascript
require('casper').create().start('http://www.google.fr/', function(response) {
    this.echo(response.headers.get('Date'));
}).run();
```

That gives:

```javascript
$ casperjs dump-single-header.js
Thu, 18 Oct 2012 08:26:34 GMT
```

The documentation has been [updated accordingly](http://casperjs.org/api.html#casper.then.callbacks).

74 75
### Bugfixes & enhancements

Nicolas Perriault authored
76
- 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).
77
- a new `onWaitTimeout` option has been added, to allow defining a default behavior when a `waitFor*` function times out.
78
- [Casper.resourceExists()](http://casperjs.org/api.html#casper.resourceExists) and related functions now checks for non HTTP-404 received responses.
79
- fixed [#167](https://github.com/n1k0/casperjs/issues/167) - fixed opening truncated/uncomplete root urls may give erroneous HTTP statuses
80
- 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)
81
- 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)
82
- 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**.
83
- fixed [#250](https://github.com/n1k0/casperjs/issues/250) - prevent self tests to be run using the standard `casper test` command
84
- fixed [#254](https://github.com/n1k0/casperjs/issues/254) - fix up one use of qsa, hit when filling forms with missing elements
Nicolas Perriault authored
85
- [fixed](https://github.com/n1k0/casperjs/commit/ef6c1828c7b64e1cf99b98e27600d0b63308cad3) edge case when current document url couldn't be properly decoded
86

Nicolas Perriault authored
87 88
2012-10-01, v1.0.0-RC2
----------------------
89

90
### Important Changes & Caveats
Nicolas Perriault authored
91

Nicolas Perriault authored
92
- **PhantomJS 1.6 is now the minimal requirement**, PhantomJS 1.7 is supported.
93
- 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**.
Nicolas Perriault authored
94 95 96

### Bugfixes & enhancements

97
- fixed [#119](https://github.com/n1k0/casperjs/issues/119) - `Casper.currentHTTPStatus` now defaults to `null` when resource are loaded using the `file://` protocol
98
- fixed [#130](https://github.com/n1k0/casperjs/issues/130) - added a `--no-colors` option to the `casper test` command to skip output coloration
Nicolas Perriault authored
99 100 101 102 103
- fixed [#153](https://github.com/n1k0/casperjs/issues/153) - erroneous mouse event results when `event.preventDefault()` was used.
- 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)).
- fixed [#178](https://github.com/n1k0/casperjs/issues/178) - added `Casper.getPageContent()` to access raw page body contents on non-html received content-types.
- 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.
- fixed [#189](https://github.com/n1k0/casperjs/issue/189) - fixed invalid XML due to message colorization
104 105 106 107 108 109
- fixed [#197](https://github.com/n1k0/casperjs/pull/197) & [#240](https://github.com/n1k0/casperjs/pull/240/) - Added new tester methods:
  * [`assertField`](http://casperjs.org/api.html#tester.assertField)
  * [`assertSelectorHasText`](http://casperjs.org/api.html#tester.assertSelectorHasText)
  * [`assertSelectorDoesntHaveText`](http://casperjs.org/api.html#tester.assertSelectorDoesntHaveText)
  * [`assertVisible`](http://casperjs.org/api.html#tester.assertVisible)
  * [`assertNotVisible`](http://casperjs.org/api.html#tester.assertNotVisible)
110
- fixed [#202](https://github.com/n1k0/casperjs/pull/202) - Fix test status timeouts when running multiple suites
111
- fixed [#204](https://github.com/n1k0/casperjs/pull/204) - Fix for when the url is changed via javascript
112
- fixed [#210](https://github.com/n1k0/casperjs/pull/210) - Changed `escape` to `encodeURIComponent` for downloading binaries via POST
113
- fixed [#216](https://github.com/n1k0/casperjs/pull/216) - Change clientutils to be able to set a global scope
114
- 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))
115
- 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
Nicolas Perriault authored
116
- 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
117
- fixed [#232](https://github.com/n1k0/casperjs/issues/232) - symlink resolution in the ruby version of the `casperjs` executable
Nicolas Perriault authored
118
- fixed [#236](https://github.com/n1k0/casperjs/issues/236) - fixed `Casper.exit` returned `this` after calling `phantom.exit()` which may caused PhantomJS to hang
119
- fixed [#252](https://github.com/n1k0/casperjs/issues/252) - better form.fill() error handling
Nicolas Perriault authored
120
- added [`ClientUtils.getDocumentHeight()`](http://casperjs.org/api.html#clientutils.getDocumentHeight)
121
- added [`toString()`](http://casperjs.org/api.html#casper.toString) and [`status()`](http://casperjs.org/api.html#casper.status) methods to `Casper` prototype.
122

123
2012-06-26, v1.0.0-RC1
124
----------------------
125

126 127
### PhantomJS 1.5 & 1.6

128
- fixed [#119](https://github.com/n1k0/casperjs/issues/119) - HTTP status wasn't properly caught
129
- fixed [#132](https://github.com/n1k0/casperjs/issues/132) - added ability to include js/coffee files using a dedicated option when using the [`casper test` command](http://casperjs.org/testing.html)
130
- fixed [#140](https://github.com/n1k0/casperjs/issues/140) - `casper test` now resolves local paths urls
131 132
- fixed [#148](https://github.com/n1k0/casperjs/issues/148) - [`utils.isWebPage()`](http://casperjs.org/api.html#utils.isWebPage) was broken
- fixed [#149](https://github.com/n1k0/casperjs/issues/149) - [`ClientUtils.fill()`](http://casperjs.org/api.html#casper.fill) was searching elements globally
Nicolas Perriault authored
133
- fixed [#154](https://github.com/n1k0/casperjs/issues/154) - firing the `change` event after a field value has been set
134
- fixed [#144](https://github.com/n1k0/casperjs/issues/144) - added a [`safeLogs` option](http://casperjs.org/api.html#casper.options) to blur password values in debug logs. **This option is set to `true` by default.**
135
- added [`Casper.userAgent()`](http://casperjs.org/api.html#casper.userAgent) to ease a more dynamic setting of user-agent string
136
- added [`Tester.assertTitleMatch()`](http://casperjs.org/api.html#tester.assertTitleMatch) method
Nicolas Perriault authored
137
- added [`utils.getPropertyPath()`](http://casperjs.org/api.html#utils.getPropertyPath)
138
- added [`Casper.captureBase64()`](http://casperjs.org/api.html#casper.captureBase64) for rendering screen captures as base64 strings - closes [#150](https://github.com/n1k0/casperjs/issues/150)
139
- added [`Casper.reload()`](http://casperjs.org/api.html#casper.reload)
140
- fixed failed test messages didn't expose the subject correctly
Nicolas Perriault authored
141
- switched to more standard `.textContent` property to get a node text; this allows a better compatibility of the clientutils bookmarklet with non-webkit browsers
142
- casper modules now all use [javascript strict mode](http://www.nczonline.net/blog/2012/03/13/its-time-to-start-using-javascript-strict-mode/)
143

144 145 146 147 148 149 150
### PhantomJS >= 1.6 supported features

- added support of custom headers sending in outgoing request - refs [#137](https://github.com/n1k0/casperjs/issues/137))
- added support for `prompt()` and `confirm()` - closes [#125](https://github.com/n1k0/casperjs/issues/125)
- fixed [#157](https://github.com/n1k0/casperjs/issues/157) - added support for PhantomJS 1.6 `WebPage#zoomFactor`
- added `url.changed` & `navigation.requested` events - refs [#151](https://github.com/n1k0/casperjs/issues/151)

Nicolas Perriault authored
151
2012-06-04, v0.6.10
152 153 154 155 156 157 158 159 160 161
-------------------

- fixed [#73](https://github.com/n1k0/casperjs/issues/73) - `Casper.download()` not working correctly with binaries
- fixed [#129](https://github.com/n1k0/casperjs/issues/129) - Can't put `//` comments in evaluate() function
- closed [#130](https://github.com/n1k0/casperjs/issues/130) - Added a `Dummy` [colorizer](http://casperjs.org/api.html#colorizer) class, in order to disable colors in console output
- fixed [#133](https://github.com/n1k0/casperjs/issues/133) - updated and fixed documentation about [extensibility](http://casperjs.org/extending.html)
- added `Casper.clickLabel()` for clicking on an element found by its `innerText` content

As a side note, the official website monolithic page has been split across several ones: http://casperjs.org/

Nicolas Perriault authored
162
2012-05-29, v0.6.9
Nicolas Perriault authored
163 164
------------------

Nicolas Perriault authored
165
- **BC BREAK:** PhantomJS 1.5 is now the minimal PhantomJS version supported.
Nicolas Perriault authored
166
- fixed [#114](https://github.com/n1k0/casperjs/issues/114) - ensured client-side utils are injected before any `evaluate()` call
167
- merged [#89](https://github.com/n1k0/casperjs/pull/89) - Support for more mouse events (@nrabinowitz)
Nicolas Perriault authored
168
- [added a new `error` event, better error reporting](https://github.com/n1k0/casperjs/commit/2e6988ae821b3251e063d11ba28af59b0683852a)
Nicolas Perriault authored
169
- fixed [#117](https://github.com/n1k0/casperjs/issues/117) - `fill()` coulnd't `submit()` a form with a submit input named *submit*
Nicolas Perriault authored
170
- merged [#122](https://github.com/n1k0/casperjs/pull/122) - allow downloads to be triggered by more than just `GET` requests
Nicolas Perriault authored
171
- closed [#57](https://github.com/n1k0/casperjs/issues/57) - added context to emitted test events + complete assertion framework refactor
172
- fixed loaded resources array is now reset adequately [reference discussion](https://groups.google.com/forum/?hl=fr?fromgroups#!topic/casperjs/TCkNzrj1IoA)
173
- fixed incomplete error message logged when passed an erroneous selector (xpath and css)
Nicolas Perriault authored
174

Nicolas Perriault authored
175 176 177 178 179 180 181
2012-05-20, v0.6.8
------------------

- added support for [XPath selectors](http://casperjs.org/#selectors)
- added `Tester.assertNotEquals()` ([@juliangruber](https://github.com/juliangruber))
- fixed [#109](https://github.com/n1k0/casperjs/issues/109) - CLI args containing `=` (equals sign) were not being parsed properly

Nicolas Perriault authored
182
2012-05-12, v0.6.7
Nicolas Perriault authored
183 184
------------------

Nicolas Perriault authored
185
- fixes [#107](https://github.com/n1k0/casperjs/issues/107): client utils were possibly not yet being injected and available when calling `Capser.base64encode()` from some events
Nicolas Perriault authored
186 187 188 189 190 191
- merged [PR #96](https://github.com/n1k0/casperjs/pull/96): make python launcher use `os.execvp()` instead of `subprocess.Popen()` ([@jart](https://github.com/jart)):
  > This patch fixes a bug where casperjs' python launcher process won't pass along kill
  > signals to the phantomjs subprocess. This patch works by using an exec system call
  > which causes the phantomjs subprocess to completely replace the casperjs parent
  > process (while maintaining the same pid). This patch also has the added benefit of
  > saving 10 megs or so of memory because the python process is discarded.
192 193
- fixes [#109](https://github.com/n1k0/casperjs/issues/109) - CLI args containing `=` (equals sign) were not parsed properly
- fixes [#100](https://github.com/n1k0/casperjs/issues/100) & [#110](https://github.com/n1k0/casperjs/issues/110) - *googlepagination* sample was broken
194
- merged #103 - added `Tester.assertNotEquals` method (@juliangruber)
Nicolas Perriault authored
195

Nicolas Perriault authored
196
2012-04-27, v0.6.6
197 198
------------------

199
- **BC BREAK:**: moved the `page.initialized` event to where it should have always been, and is now using native phantomjs `onInitialized` event
200 201
- fixed [#95](https://github.com/n1k0/casperjs/issues/95) - `Tester.assertSelectorExists` was broken

Nicolas Perriault authored
202
2012-03-28, v0.6.5
203 204
------------------

205 206
- **BC BREAK:** reverted 8347278 (refs [#34](https://github.com/n1k0/casperjs/issues/34) and added a new `clear()` method to *close* a page
    You now have to call `casper.clear()` if you want to stop javascript execution within the remote DOM environment.
207
- **BC BREAK:** removed `fallbackToHref` option handling in `ClientUtils.click()` (refs [#63](https://github.com/n1k0/casperjs/issues/63))
Nicolas Perriault authored
208
- `tester.findTestFiles()` now returns results in predictable order
Nicolas Perriault authored
209
- added `--log-level` and `--direct` options to `casper test` command
210 211
- fixed 0.6.4 version number in `bootstrap.js`
- centralized version number to package.json
212
- ensured compatibility with PhantomJS 1.5
213

Nicolas Perriault authored
214 215 216 217 218 219 220 221
2012-02-09, v0.6.4
------------------

- fixed `casperjs` command wasn't passing phantomjs native option in the correct order, resulting them not being taken into account by phantomjs engine:
  - fixed [#49](https://github.com/n1k0/casperjs/issues/49) - `casperjs` is not sending `--ssl-ignore-errors`
  - fixed [#50](https://github.com/n1k0/casperjs/issues/50) - Cookies not being set when passing `--cookies-file` option
- fixed Python3 compatibility of the `casperjs` executable

Nicolas Perriault authored
222 223 224 225 226 227 228
2012-02-05, v0.6.3
------------------

- fixed [#48](https://github.com/n1k0/casperjs/issues/48) - XML Output file doesn't have classpath populated with file name
- refs [#46](https://github.com/n1k0/casperjs/issues/46) - added value details to Tester `fail` event
- new site design, new [domain](http://casperjs.org/), enhanced & updated docs

Nicolas Perriault authored
229
2012-01-19, v0.6.2
Nicolas Perriault authored
230 231
------------------

Nicolas Perriault authored
232 233 234 235 236
- fixed [#41](https://github.com/n1k0/casperjs/issues/41) - injecting casperjs lib crashes `cmd.exe` on Windows 7
- fixed [#42](https://github.com/n1k0/casperjs/issues/42) - Use file name of test script as 'classname' in JUnit XML report (@mpeltonen)
- fixed [#43](https://github.com/n1k0/casperjs/issues/43) - Exit status not reported back to caller
- suppressed colorized output syntax for windows; was making output hard to read
- added patchy `fs.isWindows()` method
Nicolas Perriault authored
237
- added `--xunit=<filename>` cli option to `$ casperjs test` command for saving xunit results, eg.:
Nicolas Perriault authored
238

Nicolas Perriault authored
239 240 241
      $ casperjs test tests/suites --xunit=build-result.xml


Nicolas Perriault authored
242 243 244 245 246 247 248
2012-01-16, v0.6.1
------------------

- restablished js-emulated click simulation first, then native QtWebKit
  events as a fallback; some real world testing have surprinsingly proven the former being often
  more efficient than the latter
- fixed casperjs executable could not handle a `PHANTOMJS_EXECUTABLE` containing spaces
249
- fixed casper could not be used without the executable [as documented](http://casperjs.org/#faq-executable)
Nicolas Perriault authored
250 251
- fixed wrong `debug` log level on `ClientUtils.click()` error; set to `error`

252
Please check the [updated documentation](http://casperjs.org).
Nicolas Perriault authored
253

Nicolas Perriault authored
254
2012-01-12, v0.6.0
255
------------------
256

257
- **BC BREAK:** `Casper.click()` now uses native Webkit mouse events instead of previous crazy utopic javascript emulation
258
- **BC BREAK:** All errors thrown by CasperJS core are of the new `CasperError` type
259
- **BC BREAK:** removed obsolete `replaceFunctionPlaceholders()`
260
- *Deprecated*: `Casper.extend()` method has been deprecated; use natural javascript extension mechanisms instead (see samples)
Nicolas Perriault authored
261
- added `$ casperjs test` command for running split test suites
262 263
- `Casper.open()` can now perform HTTP `GET`, `POST`, `PUT`, `DELETE` and `HEAD` operations
- commonjs/nodejs-like module exports implementation
264 265 266
- ported nodejs' `events` module to casperjs; lots of events added, plus some value filtering capabilities
- introduced the `mouse` module to handle native Webkit mouse events
- added support for `RegExp` input in `Casper.resourceExists()`
267
- added printing of source file path for any uncaught exception printed onto the console
268
- added an emulation of stack trace printing (but PhantomJS will have to upgrade its javascript engine for it to be fully working though)
269

270
Please check the [updated documentation](http://casperjs.org).
Nicolas Perriault authored
271

272 273
---

274
2011-12-25, v0.4.2
Nicolas Perriault authored
275 276
------------------

277 278 279
- merged PR #30 - Add request method and request data to the `base64encode()` method (@jasonlfunk)
- `casperjs` executable now gracefully exists on KeyboardInterrupt
- added `Casper.download()` method, for downloading any resource and save it onto the filesystem
Nicolas Perriault authored
280

281 282
---

283 284 285 286 287 288 289 290 291 292 293
2011-12-21, v0.4.1
------------------

- fixed #31 - replaced bash executable script by a Python one

---

2011-12-20, v0.4.0
------------------

- first numbered version