I am stuck in a problem. I have a set of end-to-end tests written with protractor.js, and I made a small menu with inquire.js in which I choose which tests I would like to run. The problem is that I really cannot find any information on how to actually link the two projects together so that the menu can call up the test after it is selected. Here is a sample test and menu that I made:
This is my protractor test:
var session = require('../login.js'); describe('The customer view', function() { var physicalPersonRegistration = {}; physicalPersonRegistration.loginTest = function() { it('should Login', function() { browser.ignoreSynchronization = true; browser.get('http://localhost:8080/project'); session.username.sendKeys('admin'); session.password.sendKeys('admin'); session.submit.click(); browser.ignoreSynchronization = false; }); };
And this is my inquire.js menu:
var inquirer = require("inquirer"); var questions = [ { type: "list", name: "tests", message: "Which test do you wish to run?", choices: [ "Login Test", "Run all Tests" ] }, ]; inquirer.prompt(questions, function(answers) { console.log(answers); });
source share