Skip to content

Commit 25a3f73

Browse files
authored
Merge pull request #5 from qahive/update-package-as-generic
Update package as generic
2 parents 32f932e + 0a3ea82 commit 25a3f73

File tree

4 files changed

+77
-39
lines changed

4 files changed

+77
-39
lines changed

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/qahive/generator-robotframework)
22

3-
# Yeoman Generator for Robot Framework
3+
# The Robot Fraemwork Test Project Generator
44

5-
## Local setup
5+
## Usage
6+
7+
Install `yo` and `generator-robotframework`:
8+
9+
```text
10+
npm install -g yo generator-robotframework
11+
```
12+
13+
Generate test project:
14+
15+
yo robotframework
16+
17+
18+
## Supported Configurations
19+
20+
**General**
21+
* Test library: `Puppeteer` (Default `Puppeteer`)
22+
* Page object pattern: `Yes`, `No` (Default `Yes`)
23+
* ATDD/BDD style: `Yes`, `No` (Default `No`)
24+
25+
FYI: Test library: `Selenium` and `Appium` will support soon.
26+
27+
## Manual Setup
628
Run following command
729

830
npm install -g .
931
cd tmp
10-
yo robotframework-puppeteer
32+
yo robotframework

generators/app/index.js

Lines changed: 45 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,51 @@ module.exports = class extends Generator {
1414
"I'll walk you through the installation."
1515
));
1616

17-
return this.prompt([{
18-
type: "input",
19-
name: "isPageObject",
20-
message: "Would you like to use Page object pattern?",
21-
default: true
22-
}, {
23-
type: "input",
24-
name: "isAtdd",
25-
message: "Would you like to use ATDD/BDD style?",
26-
default: false
27-
}/*, {
28-
type: "input",
29-
name: "isPdf",
30-
message: "Would you like to include PDF reader?",
31-
default: true
32-
}, {
33-
type: "input",
34-
name: "zxing",
35-
message: "Would you like to include QRCode reader?",
36-
default: true
37-
}, {
38-
type: "input",
39-
name: "percy",
40-
message: "Would you like to include Visual Testing?",
41-
default: true
42-
} */ ]).then(answers => {
43-
this.args = answers;
44-
this.config.set(this.args);
45-
});
17+
return this.prompt([
18+
{
19+
type: "input",
20+
name: "testLibrary",
21+
message: "Please select test library. (Puppeteer)",
22+
default: 'Puppeteer',
23+
validate: function (input) {
24+
return ['puppeteer'].includes(input.toLowerCase());
25+
}
26+
},
27+
{
28+
type: "input",
29+
name: "isPageObject",
30+
message: "Would you like to use Page object pattern? (Yes/No)",
31+
default: 'Yes',
32+
validate: function (input) {
33+
return ['yes', 'no'].includes(input.toLowerCase());
34+
}
35+
}, {
36+
type: "input",
37+
name: "isAtdd",
38+
message: "Would you like to use ATDD/BDD style? (Yes/No)",
39+
default: 'No',
40+
validate: function (input) {
41+
return ['yes', 'no'].includes(input.toLowerCase());
42+
}
43+
}/*, {
44+
type: "input",
45+
name: "isPdf",
46+
message: "Would you like to include PDF reader?",
47+
default: true
48+
}, {
49+
type: "input",
50+
name: "zxing",
51+
message: "Would you like to include QRCode reader?",
52+
default: true
53+
}, {
54+
type: "input",
55+
name: "percy",
56+
message: "Would you like to include Visual Testing?",
57+
default: true
58+
} */ ]).then(answers => {
59+
this.args = answers;
60+
this.config.set(this.args);
61+
});
4662
}
4763

4864
writing() {

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"name": "generator-robotframework-puppeteer",
2+
"name": "generator-robotframework",
33
"version": "0.1.2",
4-
"description": "Yeoman generator to create a robotframework puppeteer project",
4+
"description": "Yeoman generator to create a robotframework test project",
55
"files": [
66
"generators"
77
],
@@ -11,15 +11,15 @@
1111
"puppeteer",
1212
"robotframework-puppeteer"
1313
],
14-
"homepage": "https://github.com/qahive/generator-robotframework-puppeteer",
14+
"homepage": "https://github.com/qahive/generator-robotframework",
1515
"author": "Atthaboon Sanurt <[email protected]>",
16-
"contributors":[
16+
"contributors": [
1717
"Atthaboon Sanurt <[email protected]>",
1818
"Penploy Sribumrungwong <[email protected]>"
1919
],
2020
"repository": {
2121
"type": "git",
22-
"url": "git://github.com/qahive/generator-robotframework-puppeteer.git"
22+
"url": "git://github.com/qahive/generator-robotframework.git"
2323
},
2424
"dependencies": {
2525
"chalk": "^4.1.0",

0 commit comments

Comments
 (0)