siesta-lite
Version:
Stress-free JavaScript unit testing and functional testing tool, works in NodeJS and browsers
225 lines (203 loc) • 8.16 kB
JavaScript
var project = new Siesta.Project.Browser.ExtJS()
project.configure({
title : 'Siesta Sencha ExtJS examples',
viewDOM : true,
// Define any global JS and CSS dependencies, these files will be injected into each test.
preload : [],
// If your tests use dynamic loading, you can setup your paths using the 'loaderPath' config.
loaderPath : { 'Ext.ux' : '//cdn.sencha.com/ext/gpl/5.1.0/examples/ux' },
recorderConfig : {
// enable/disable certain features of the recorder, see the Siesta.Recorder.Recorder documentation
recordMouseMoveOnIdle : true,
recordPointsOfInterest : true,
recordMouseMovePath : false,
recordScroll : false,
recordInitialWindowSize : false
}
});
project.plan(
{
group : 'UI tests',
preload : [
"//cdn.sencha.com/ext/gpl/5.1.0/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css",
"//cdn.sencha.com/ext/gpl/5.1.0/build/ext-all.js"
],
items : [
{
group : 'General',
items : [
'2.ui-tests/general/resize.t.js',
'2.ui-tests/general/window.t.js',
'2.ui-tests/general/targeting_buttons.t.js',
'2.ui-tests/general/ext-bug.t.js',
{
runCore : 'sequential',
url : '2.ui-tests/general/combo.t.js'
},
{
runCore : 'sequential',
url : '2.ui-tests/general/custom-combo.t.js'
}
]
},
{
group : 'Drag and drop',
items : [
{
// Specify your own HTML page if you want
pageUrl : '2.ui-tests/drag-drop/cats.html',
url : '2.ui-tests/drag-drop/drag-drop.t.js'
},
'2.ui-tests/drag-drop/dd-tree.t.js'
]
},
{
group : 'Forms',
items : [
'2.ui-tests/form/basic_form.t.js',
'2.ui-tests/form/checkboxes.t.js'
]
},
{
group : 'Grid',
testClass : Your.Test.Class,
items : [
'2.ui-tests/grid/basic.t.js',
'2.ui-tests/grid/waitfor_grid.t.js',
'2.ui-tests/grid/mouseover.t.js',
'2.ui-tests/grid/sel_model.t.js',
'2.ui-tests/grid/resizing.t.js',
// Tests that rely on browser focus should be run sequentially to prevent different
// tests stealing focus from each other
{
url : '2.ui-tests/grid/editing.t.js',
runCore : 'sequential'
},
{
url : '2.ui-tests/grid/editing_with_row_editor.t.js',
runCore : 'sequential'
}
]
}
]
},
{
group : 'Application tests',
// run tests one by one instead of several in parallel
runCore : 'sequential',
enableCodeCoverage : false,
// uncomment to run the tests in popup
//runInPopup : true,
items : [
{
title : 'Basic Ext JS MVC app',
pageUrl : '3.application-tests/extjs-mvc/app.html',
url : '3.application-tests/extjs-mvc/tests/app.t.js'
},
{
title : 'Ext JS Ticket app',
pageUrl : '3.application-tests/ticket-app/',
url : '3.application-tests/ticket-app/tests/smoke_test.t.js'
},
{
title : 'Responsive app test - landscape',
viewportWidth : 1024,
viewportHeight : 768,
pageUrl : '3.application-tests/executive-dashboard/',
url : '3.application-tests/executive-dashboard/tests/large-size.t.js'
},
{
title : 'Responsive app test - portrait',
viewportWidth : 500,
viewportHeight : 700,
pageUrl : '3.application-tests/executive-dashboard/',
url : '3.application-tests/executive-dashboard/tests/small-size.t.js'
},
{
title : 'Monkey testing',
viewportWidth : 1024,
viewportHeight : 768,
pageUrl : '3.application-tests/executive-dashboard/',
url : '3.application-tests/executive-dashboard/tests/monkey_test.t.js'
},
// do not show this example in Lite version
!project.isStandardPackage() ? null :
{
// make sure we'll reach the correct exit point
title : 'Page redirect',
needDone : true,
enablePageRedirect : true,
pageUrl : '3.application-tests/page-redirect/source_page.html',
url : '3.application-tests/page-redirect/page_redirect.t.js'
}
]
},
!project.isStandardPackage() ? null : {
group : 'Code coverage',
referenceUrl : 'https://www.bryntum.com/docs/siesta/#!/guide/code_coverage',
preload : [
"//cdn.sencha.com/ext/gpl/4.2.1/resources/css/ext-all.css",
"//cdn.sencha.com/ext/gpl/4.2.1/ext-all-debug.js",
{
url : "5.code_coverage/several_classes_in_one_file.js"
},
{
url : "5.code_coverage/some_folder/preload_file.js"
},
{
url : "5.code_coverage/some_folder/folder2/preload_file.js"
}
],
items : [
{
group : 'Static loading',
items : [
'5.code_coverage/010_range.t.js',
'5.code_coverage/020_event.t.js'
]
},
{
group : 'Dynamic loading',
loaderPath : {
My : '5.code_coverage/lib/My'
},
preload : [
"//cdn.sencha.com/ext/gpl/4.2.1/resources/css/ext-all.css",
"//cdn.sencha.com/ext/gpl/4.2.1/ext-all-debug.js",
{
url : "5.code_coverage/several_classes_in_one_file.js"
}
],
items : [
'5.code_coverage/030_loader.t.js'
]
},
{
// example of getting code coverage for application
group : 'Code coverage for application code',
pageUrl : '5.code_coverage/pageUrl.html',
items : [
'5.code_coverage/040_pageUrl.t.js'
]
}
]
},
{
group : 'Misc',
// loader instrumentation hook switches ExtJS loader to synchronous loading mode (using XHR)
// and fetching SimManager will fail
installLoaderInstrumentationHook : false,
preload : [
"//cdn.sencha.com/ext/gpl/5.1.0/packages/ext-theme-crisp/build/resources/ext-theme-crisp-all.css",
"//cdn.sencha.com/ext/gpl/5.1.0/build/ext-all.js"
],
items : [
'6.misc/ajax.t.js',
{
requires : [ 'Ext.ux.ajax.SimManager' ],
url : '6.misc/ajax-mock.t.js'
}
]
}
)
project.start()