"use strict";

var commonBaseDir = "../../../";

var tst = require(commonBaseDir + "common/test/webdriverTestHelper");
var webpackDevServer = require(commonBaseDir + "common/test/webpackDevServerHelper");
var webpackConfig = require("../../webpack.config.js");

var expect = require("chai").expect;

webpackDevServer.start(webpackConfig);

tst.bootstrap({withConnectServer: false});

tst.describe("webpack basic example", function() {

    tst.describe("index page", function() {
        tst.before(function() {
            this.driver.get("http://localhost:5000");
        });

        tst.it("should have the right title", function() {
            this.driver.getTitle().then(function(title) {
                expect(title).to.equal("Webpack Examples | Basic With Require");
            });
        });

        tst.it("should have the right main heading", function() {
            expect("h1").dom.to.have.text("Hello webpack dev server!");
        });
    });

});

@@ -958,12 +958,589 @@
    %7D);%0A%0A
+    tst.describe(%22/webpack-dev-server/%22, function() %7B%0A        tst.before(function() %7B%0A            this.driver.get(%22http://localhost:5000/webpack-dev-server/%22);%0A        %7D);%0A%0A        tst.it(%22should have the webpack ok status%22, function() %7B%0A            expect(%22#status%22).dom.to.have.text(%22App ready.%22);%0A        %7D);%0A%0A        tst.it(%22should have the right main heading%22, function() %7B%0A            this.driver.switchTo().frame(%22iframe%22);%0A            expect(%22h1%22).dom.to.have.text(%22Hello webpack dev server!%22);%0A            this.driver.switchTo().defaultContent();%0A        %7D);%0A    %7D);%0A%0A
 %7D);%0A

Add tests to ensure the /webpack-dev-server/ endpoint is available