jeudi 21 novembre 2019

Handle Protractor Spec patterns did not match any files error when no files match with the exclude pattern

So I have multiple capabilities in my protractor config.

multiCapabilities: [
    {
        logName: 'Desktop',
        browserName: 'chrome',
        chromeOptions: {
            excludeSwitches: ['enable-automation']
        },
        networkConnectionEnabled: true,
        exclude: ['spec/mobile/*.ts']
    },
    {
        logName: 'Mobile',
        browserName: 'chrome',
        chromeOptions: {
            mobileEmulation: {
                deviceName: 'Pixel 2 XL'
            },
            excludeSwitches: ['enable-automation']
        },
        networkConnectionEnabled: true,
        exclude: ['spec/!(mobile)**/*.ts']
    }
],

I have tests that need to be run on desktop and others that need to be run on mobile simulation which is the reason why I have the exclude in both capabilities.

Also I have a powershell script that overrides the specs from the protractor config, so it happens that there are no tests found for one the capabilities.

Is there a way that protractor does not throw a Spec patterns did not match any files error when I do not give it specs and it is wanted?

Aucun commentaire:

Enregistrer un commentaire