async function runCommonTestCases(t) {
    let {core, app} = t.context;

    // only use static middleware
    let selectedInternalMidds = ['static', 'favicon'];
    let addtionalContent = '<div>addtional content</div>';

    // set middlewares & start a server
    if (isKoaSupport) {
        app.use(core.koaMiddleware(selectedInternalMidds));

        // use custom SSR middleware
        app.use(async (ctx, next) => {
            let {err, html} = await core.render({
                url: ctx.path
            });
            ctx.body = html.replace('</html>', `${addtionalContent}</html>`);
        });
    }
    else {
        app.use(core.expressMiddleware(selectedInternalMidds));

        // use custom SSR middleware
        app.use((req, res, next) => {
            core.render({
                url: req.url
            }).then(result => {
                if (result.err) {
                    return next(result.err);
                }
                res.end(result.html.replace('</html>', `${addtionalContent}</html>`));
            });
        });
    }

    t.context.server = app.listen();

    // server side render index
    let ssrContent = '<div id="app" data-server-rendered="true">';
    let res = await request(app)
        .get('/');
    t.is(200, res.status);
    t.true(res.text.indexOf(ssrContent) > -1);
    t.true(res.text.indexOf(addtionalContent) > -1);
}
@file Test case for `express/koaMiddleware()` and `render()` functions.
@author panyuqi@baidu.com (panyuqi)