mardi 19 juillet 2016

Ember application using ember-cli not displaying in ember-testing-window for acceptance test.

My current application runs on .aspx, but is switched to html within ember-cli-build.js

module.exports = function (defaults) {
var isProduction = EmberApp.env() === 'production',
    isTest = EmberApp.env() === 'test',
    app = new EmberApp(defaults, {

        outputPaths: {
            app: {
                html: 'Default.aspx'
            }
        },

        sourcemaps: {
            enabled: !isProduction
        },

        storeConfigInMeta: false,

        autoprefixer: {
            browsers: ['last 2 versions', 'IE 10'],
            cascade: false
        },

        svg: {
            paths: [
                'public/assets/images/icons/optimized'
            ],
            optimize: false
        }
    });

// If the environment is production, the output app html file has to end with .html so that it gets fingerprinted
// It will get renamed in one of the build hooks
if (isProduction) {
    console.log('Production environment, changing app.options.outputPaths.app.html from Default.aspx to Default.html to fix fingerprinting issue');
    app.options.outputPaths.app.html = 'Default.html';
}

if (isTest) {
    console.log('Test environment, changing app.options.outputPaths.app.html from Default.aspx to index.html');
    app.options.outputPaths.app.html = 'index.html';
}

Right now the application is hosted on localhost/ but the ember tests automatically run on localhost:7357/ so all URLS accessed by the visit() function are appended with localhost:7357/

When the acceptance test:

import { test } from 'qunit';
import moduleForAcceptance from 'customer-ember/tests/helpers/module-for-
acceptance';

moduleForAcceptance('Acceptance | login');

test('login', function(assert) {;
visit('/ember');

    andThen(() => {
        assert.equal(currentURL(), '/ember', 'URL is /');
    });
});

is run, these errors appear: Chrome developer tool, callback method seems to fail and the url is not found




Aucun commentaire:

Enregistrer un commentaire