你可以试试这个
beforeLaunch()
量角器配置js。
/**
* A callback function called once configs are read but before any
* environment setup. This will only run once, and before onPrepare.
*
* You can specify a file containing code to run by setting beforeLaunch to
* the filename string.
*
* At this point, global variable 'protractor' object will NOT be set up,
* and globals from the test framework will NOT be available. The main
* purpose of this function should be to bring up test dependencies.
*/
beforeLaunch?: () => void;
exports.config = {
multiCapabilities: [],
specs:[],
beforeLaunch: function(){
// execute query at here
}
...
};