Files
Ariya Hidayat 784a06c3a7 The test runner also launches an HTTP server.
The server runs on port 9180 and serves the content from test/www
directory. Any tests can use this base URL to load test content and
to exercise certain PhantomJS API.

https://github.com/ariya/phantomjs/issues/12439
2014-09-05 21:31:38 -07:00

14 lines
417 B
JavaScript

var assert = require('../../assert');
var webpage = require('webpage');
var page = webpage.create();
assert.typeOf(page, 'object');
page.open('http://localhost:9180/hello.html', function (status) {
assert.equal(status, 'success');
assert.typeOf(page.title, 'string');
assert.equal(page.title, 'Hello');
assert.typeOf(page.plainText, 'string');
assert.equal(page.plainText, 'Hello, world!');
});