@@ -9,14 +9,14 @@ var fs = require('fs'),
99
1010// ADD ALL TESTS & RUN CONDITIONS HERE
1111var tests = {
12- 'template-generic' : true ,
13- 'template-local' : true ,
14- 'template-crafty' : true ,
15- 'template-multi' : true ,
12+ // Problems with input capture in firefox driver
13+ 'template-multi' : function ( browserName ) { return browserName !== "firefox" ; } ,
1614 'color/color-dom' : true ,
1715 'color/color-canvas' : true ,
18- 'color/color-webgl' : function ( browserName ) { return browserName !== 'phantomjs' ; }
16+ // neither phantomjs nor open sauce support webgl right now
17+ 'color/color-webgl' : function ( browserName ) { return false ; }
1918} ;
19+
2020exports . specs = function ( ) {
2121 return Object . keys ( tests ) . map ( function ( t ) {
2222 return 'tests/webdriver/' + t + '.js' ;
@@ -27,7 +27,7 @@ exports.exclude = function(browserName, version, platform) {
2727 runCondition ;
2828 for ( var test in tests ) {
2929 runCondition = tests [ test ] ;
30- if ( runCondition !== true && ! runCondition ( browserName , version , platform ) )
30+ if ( runCondition !== true && ( runCondition === false || ! runCondition ( browserName , version , platform ) ) )
3131 excluded . push ( 'tests/webdriver/' + test + '.js' ) ;
3232 }
3333 return excluded ;
@@ -43,13 +43,13 @@ function getRunId(capabilities) {
4343// =====
4444exports . onPrepare = function ( ) { } ;
4545exports . before = function ( ) { // BEFORE RUNNING ANY TESTS, WITH GLOBALS AVAILABLE
46- var capabilities = GLOBAL . browser . desiredCapabilities ;
46+ var capabilities = global . browser . desiredCapabilities ;
4747
4848 //TODO retry commands with webbriverio/lib/helpers.js/staleElementRetry if need arises (StaleElementReference)
49- addGenericCommands ( GLOBAL . browser ) ;
50- addBrowserSpecificCommands ( GLOBAL . browser , capabilities ) ;
51- addTestSpecificCommands ( GLOBAL . browser , GLOBAL . QUnit , getRunId ( capabilities ) ) ;
52- return setBrowserSpecificConfig ( GLOBAL . browser , capabilities ) ;
49+ addGenericCommands ( global . browser ) ;
50+ addBrowserSpecificCommands ( global . browser , capabilities ) ;
51+ addTestSpecificCommands ( global . browser , global . QUnit , getRunId ( capabilities ) ) ;
52+ return setBrowserSpecificConfig ( global . browser , capabilities ) ;
5353} ;
5454exports . after = function ( failures , pid ) { } ;
5555exports . onComplete = function ( ) { } ;
@@ -147,6 +147,9 @@ function addGenericCommands(client) {
147147
148148// NON-STANDARD SCREENSHOT REGIONS PER PLATFORM
149149var rotatedCrops = { } ;
150+
151+ // These platforms are no longer used, and the updated versions require different regions
152+ // TODO: update them and add the new platforms back to supported-platforms-webdriver
150153rotatedCrops [ getRunId ( { "browserName" : "android" , "version" : "4.1" , "platform" : "Linux" } ) ] = { x : 0 , y : 98 , w : 261 , h : 196 , stretchW : 320 , stretchH : 240 } ;
151154rotatedCrops [ getRunId ( { "browserName" : "android" , "version" : "5.1" , "platform" : "Linux" } ) ] = { x : 0 , y : 110 , w : 261 , h : 196 , stretchW : 320 , stretchH : 240 } ;
152155// TODO: iphone 8.4 emulator currently changing screenshot region constantly, readd to supported-browsers and observe region in future
@@ -308,11 +311,14 @@ function addTestSpecificCommands(client, QUnit, runId) {
308311
309312 // WEBDRIVER COMMAND: TEST PAGE URL SHORTCUT
310313 client . addCommand ( "testUrl" , function ( testName , testScript ) {
314+
311315 if ( typeof testName === 'string' && typeof testScript === 'undefined' ) {
312316 testScript = testName ;
313317 testName = undefined ;
314318 }
315319
320+ console . log ( "\n# Starting " + ( testName || currentTestName ) + " test for " + runId ) ;
321+
316322 if ( typeof testScript === 'string' ) {
317323 var testFilePath = resultPath + ( testName || currentTestName ) + '.html' ,
318324 testFile = "<!DOCTYPE html>" + EOL +
@@ -330,10 +336,9 @@ function addTestSpecificCommands(client, QUnit, runId) {
330336 "</script>" + EOL +
331337 "</body>" + EOL +
332338 "</html>" + EOL ;
333-
334- return qfs . write ( testFilePath , testFile , 'w+' )
335- . then ( this . url . bind ( this , testFilePath ) ) ;
336- } else {
339+ return qfs . write ( "./" + testFilePath , testFile , 'w+' )
340+ . then ( this . url . bind ( this , "/" + testFilePath ) ) ;
341+ } else {
337342 return this . url ( testPath + currentTestPath + '.html' ) ;
338343 }
339344 } ) ;
0 commit comments