Note that there are some explanatory texts on larger screens.

plurals
  1. POIs it possible to use dojo/text! in an Intern functional test?
    primarykey
    data
    text
    <p>Is it possible to use "dojo/text!" in an Intern functional test?</p> <p>I am able to setup my test page as a JSON string, but ideally I'd like to externalise the string in a file for ease of editing. I'm just getting started with Intern at the moment so I'm just experimenting with what's possible, but here is the start of my test code).</p> <p>This works with the commented "testData" variable used, but is currently failing when I try to provide the same String by the dojo/text! statement.</p> <p>Code:</p> <pre><code>define([ 'intern!object', 'intern/chai!assert', 'dojo/text!./firstTestPageConfig.json', 'require' ], function (registerSuite, assert, PageConfig, require) { registerSuite({ name: 'firstTest', 'greeting form': function () { var testData = PageConfig; // var testData = '{"widgets":[{"name":"alfresco/menus/AlfMenuBar","config":{"widgets":[{"name":"alfresco/menus/AlfMenuBarPopup","config":{"id":"DD1","label":"Drop-Down","iconClass":"alf-configure-icon","widgets":[{"name":"alfresco/menus/AlfMenuGroup","config":{"label":"Group 1","widgets":[{"name":"alfresco/menus/AlfMenuItem","config":{"label":"Item 1","iconClass":"alf-user-icon"}},{"name":"alfresco/menus/AlfMenuItem","config":{"label":"Item 2","iconClass":"alf-password-icon"}}]}},{"name":"alfresco/menus/AlfMenuGroup","config":{"label":"Group 2","widgets":[{"name":"alfresco/menus/AlfMenuItem","config":{"label":"Item 3","iconClass":"alf-help-icon"}}]}}]}}]}}]}'; var testPage = 'http://localhost:8081/share/page/tp/ws/unittest?testdata='; return this.remote .get(testPage + testData) .waitForElementByCssSelector('.alfresco-core-Page.allWidgetsProcessed', 5000) .elementById('DD1') .clickElement() .end() } }); }); </code></pre> <p>The error I'm getting is this:</p> <pre><code>/home/dave/ScratchPad/ShareInternTests/node_modules/intern/node_modules/dojo/dojo.js:742 throw new Error('Failed to load module ' + module.mid + ' from ' + url + ^ Error: Failed to load module dojo/text from /home/dave/ScratchPad/ShareInternTests/dojo/text.js (parent: dojo/text!17!*) at /home/dave/ScratchPad/ShareInternTests/node_modules/intern/node_modules/dojo/dojo.js:742:12 at fs.js:207:20 at Object.oncomplete (fs.js:107:15) </code></pre> <p>I've tried playing around with the loader/package/map configuration but without any success. It's not clear (to me at least) from the error message whether or not it can't find the file I'm passing to dojo/text (but I've tried full as well as relative paths) or the Dojo module itself ?</p> <p>I'd just like to confirm that what I'm attempting is possible, before I spend any more time with this... but obviously any solution or example would be greatly appreciated!!</p> <p>Many thanks, Dave</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload