/**
 * Created by JiaHao on 18/8/15.
 */


var async = require('async');
var chai = require('chai');
var assert = chai.assert;

var phantomBase = require('./../lib/phantomBase');


const testUrls = ['http://apple.com', 'https://www.facebook.com/'];
const INVALID_URL = 'http://insdasjdlkas.com/';

describe('Testing base PhantomJS functions', function () {
    this.timeout(50000);
    it('Can open pages', function (done) {

        async.each(testUrls, function (testUrl, callback) {
            phantomBase.openPage(testUrl, function (error, page, ph) {
                ph.exit();
                callback(error);
            });
        }, function (error) {
            assert.notOk(error, 'string');
            done(error);
        });
    });

    it('Can fail to open pages gracefully', function (done) {

        phantomBase.openPage(INVALID_URL, function (error, page, ph) {
            ph.exit();
            assert.ok(error, 'string');
            done();
        });
    })
});
@@ -172,16 +172,67 @@
 Base');%0A
+var PhantomHigh = require('./../lib/PhantomHigh');%0A
 %0A%0Aconst 
@@ -342,16 +342,17 @@
 com/';%0A%0A
+%0A
 describe
@@ -733,38 +733,78 @@
 t.notOk(error, '
-string
+No error should be received when opening pages
 ');%0A            
@@ -1028,14 +1028,497 @@
 r, '
-string
+An error should be received when opening pages');%0A            done();%0A        %7D);%0A    %7D)%0A%7D);%0A%0Adescribe('Testing PhantomHigh Object', function () %7B%0A    this.timeout(50000);%0A%0A    it('Can open pages', function (done) %7B%0A        async.each(testUrls, function (testUrl, callback) %7B%0A%0A            var browser = new PhantomHigh();%0A            browser.openPage(testUrl, callback);%0A%0A        %7D, function (error) %7B%0A            assert.notOk(error, 'No error should be received when opening a valid page.
 ');%0A
@@ -1526,32 +1526,37 @@
            done(
+error
 );%0A        %7D);%0A 
@@ -1544,28 +1544,406 @@
 ror);%0A        %7D)
-;
 %0A    %7D)
+;%0A    %0A    it('Can do tasks sequentially and get a snapshot', function (done) %7B%0A        var browser = new PhantomHigh();%0A        var url = testUrls%5B0%5D;%0A        browser.openPage(url);%0A        browser.takeSnapshot(function (error, result) %7B%0A%0A            assert.include(result, '%3C/html%3E', 'Snapshot results contain closing %3C/html%3E tag');%0A            done(error);%0A%0A        %7D)%0A    %7D)%0A
 %0A%7D);

Add test case for PhantomHigh