Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
module.exports = function(config) {
// In this example, `@bazel/protractor/protractor-utils` is used to run
// the server. protractorUtils.runServer() runs the server on a randomly
// selected port (given a port flag to pass to the server as an argument).
// The port used is returned in serverSpec and the protractor serverUrl
// is the configured.
const isProdserver = path.basename(config.server, path.extname(config.server)) === 'prodserver';
return protractorUtils
.runServer(config.workspace, config.server, isProdserver ? '-p' : '-port', [])
.then(serverSpec => {
protractor.browser.baseUrl = `http://localhost:${serverSpec.port}`;
});
};
module.exports = function(config) {
// In this example, `@bazel/protractor/protractor-utils` is used to run
// the server. protractorUtils.runServer() runs the server on a randomly
// selected port (given a port flag to pass to the server as an argument).
// The port used is returned in serverSpec and the protractor serverUrl
// is the configured.
const isProdserver = path.basename(config.server, path.extname(config.server)) === 'prodserver';
return protractorUtils
.runServer(config.workspace, config.server, isProdserver ? '-p' : '-port', [])
.then(serverSpec => {
// Example app is hosted under `/example` in the prodserver and under `/` in devserver
const serverUrl = `http://localhost:${serverSpec.port}` + (isProdserver ? '/example' : '');
protractor.browser.baseUrl = serverUrl;
});
};
module.exports = async function(config) {
const serverSpec = await protractorUtils.runServer(config.workspace, config.server, '-port', []);
const serverUrl = `http://localhost:${serverSpec.port}`;
// Since the browser restarts in this benchmark we need to set both the browser.baseUrl
// for the first test and the protractor config.baseUrl for the subsequent tests
protractor.browser.baseUrl = serverUrl;
const processedConfig = await protractor.browser.getProcessedConfig();
return processedConfig.baseUrl = serverUrl;
};
module.exports = async function(config) {
const {port} = await protractorUtils.runServer(config.workspace, config.server, '-port', []);
const processedConfig = await protractor.browser.getProcessedConfig();
const serverUrl = `http://localhost:${port}`;
return processedConfig.baseUrl = protractor.browser.baseUrl = serverUrl;
};
module.exports = async function(config) {
const {port} = await protractorUtils.runServer(config.workspace, config.server, '-port', []);
const serverUrl = `http://localhost:${port}`;
protractor.browser.baseUrl = serverUrl;
};