iamchrismiller / grunt-casper

Run CasperJS Scripts/Functional Tests
Other
69 stars 38 forks source link

Running multiple directories in one casper spawn #13

Closed hhaidar closed 11 years ago

hhaidar commented 11 years ago

Hey there,

I have an array of 3 paths and was wondering if there's a way to run them all in one casper test command.

Here's what my config looks like:

        casper: {
            options : {
                test : true,
                includes: 'bootstrap.js',
                pre: 'login.js',
                post: 'logout.js',
                'fail-fast' : true
            },
            main: {
                src: [
                    'tests/create',
                    'tests/modify',
                    'tests/delete'
                ]
            }
        }
iamchrismiller commented 11 years ago

Yes, the code above will work with a slight tweak.

    Fully qualify the file with extension

    main: {
            src: [
                'tests/createTest.js',
                'tests/modifyTest.js',
                'tests/deleteTest.js'
            ]
        }

   OR

   Use a glob which will allow you to define multiple "create" / "modify" / "delete" testfiles and run all that match    
   the glob

    main: {
            src: [
                'tests/create*',
                'tests/modify*',
                'tests/delete*'
            ]
        }