Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
377 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
"use strict"; | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const inquirer = require("inquirer"); | ||
/** | ||
* Guided Concordia configuration. | ||
*/ | ||
class GuidedConfig { | ||
prompt(options) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const q = new ConcordiaQuestions(); | ||
const questions = [ | ||
q.directory(), | ||
q.language(), | ||
q.dirScript(), | ||
q.dirResult(), | ||
q.plugin() | ||
]; | ||
let r = yield inquirer.prompt(questions); | ||
options.directory = r.directory; | ||
options.language = r.language; | ||
options.dirScript = r.dirScript; | ||
options.dirResult = r.dirResult; | ||
options.plugin = r.plugin; | ||
return options; | ||
}); | ||
} | ||
} | ||
exports.GuidedConfig = GuidedConfig; | ||
class ConcordiaQuestions { | ||
// TO-DO: load options dynamically | ||
language() { | ||
return { | ||
type: 'list', | ||
name: 'language', | ||
message: 'Which spoken language do you want to use in specification files?', | ||
choices: [ | ||
{ value: 'en', short: 'en', name: 'English (en)' }, | ||
{ value: 'pt', short: 'pt', name: 'Portuguese (pt)' } | ||
] | ||
}; | ||
} | ||
directory() { | ||
return { | ||
type: 'input', | ||
name: 'directory', | ||
message: 'Where do you store specification files?', | ||
default: './features' | ||
}; | ||
} | ||
dirScript() { | ||
return { | ||
type: 'input', | ||
name: 'dirScript', | ||
message: 'Where do you want to save generated test scripts?', | ||
default: './test' | ||
}; | ||
} | ||
dirResult() { | ||
return { | ||
type: 'input', | ||
name: 'dirResult', | ||
message: 'Where do you want to save logs, screenshots, and report files?', | ||
default: './output' | ||
}; | ||
} | ||
// TO-DO: load options dynamically | ||
plugin() { | ||
return { | ||
type: 'list', | ||
name: 'plugin', | ||
message: 'Which plug-in do you want to use?', | ||
choices: [ | ||
{ value: 'codeceptjs', short: 'codeceptjs', name: 'CodeceptJS with WebDriverIO (web applications)' }, | ||
{ value: 'codeceptjs-appium', short: 'codeceptjs-appium', name: 'CodeceptJS with Appium (mobile or desktop applications)' } | ||
] | ||
}; | ||
} | ||
} | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import * as inquirer from 'inquirer'; | ||
import { Options } from './Options'; | ||
|
||
/** | ||
* Guided Concordia configuration. | ||
*/ | ||
export class GuidedConfig { | ||
|
||
async prompt( options: Options ): Promise< Options > { | ||
|
||
const q = new ConcordiaQuestions(); | ||
|
||
const questions = [ | ||
q.directory(), | ||
q.language(), | ||
q.dirScript(), | ||
q.dirResult(), | ||
q.plugin() | ||
]; | ||
|
||
let r = await inquirer.prompt( questions ); | ||
|
||
options.directory = r.directory; | ||
options.language = r.language; | ||
options.dirScript = r.dirScript; | ||
options.dirResult = r.dirResult; | ||
options.plugin = r.plugin; | ||
|
||
return options; | ||
} | ||
} | ||
|
||
class ConcordiaQuestions { | ||
|
||
// TO-DO: load options dynamically | ||
language(): object { | ||
return { | ||
type: 'list', | ||
name: 'language', | ||
message: 'Which spoken language do you want to use in specification files?', | ||
choices: [ | ||
{ value: 'en', short: 'en', name: 'English (en)' }, | ||
{ value: 'pt', short: 'pt', name: 'Portuguese (pt)' } | ||
] | ||
}; | ||
} | ||
|
||
directory(): object { | ||
return { | ||
type: 'input', | ||
name: 'directory', | ||
message: 'Where do you store specification files?', | ||
default: './features' | ||
}; | ||
} | ||
|
||
dirScript(): object { | ||
return { | ||
type: 'input', | ||
name: 'dirScript', | ||
message: 'Where do you want to save generated test scripts?', | ||
default: './test' | ||
}; | ||
} | ||
|
||
dirResult(): object { | ||
return { | ||
type: 'input', | ||
name: 'dirResult', | ||
message: 'Where do you want to save logs, screenshots, and report files?', | ||
default: './output' | ||
}; | ||
} | ||
|
||
// TO-DO: load options dynamically | ||
plugin(): object { | ||
return { | ||
type: 'list', | ||
name: 'plugin', | ||
message: 'Which plug-in do you want to use?', | ||
choices: [ | ||
{ value: 'codeceptjs', short: 'codeceptjs', name: 'CodeceptJS with WebDriverIO (web applications)' }, | ||
{ value: 'codeceptjs-appium', short: 'codeceptjs-appium', name: 'CodeceptJS with Appium (mobile or desktop applications)' } | ||
] | ||
}; | ||
} | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.