testdriverai 5.7.32 → 5.7.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/init.js +67 -53
- package/lib/notify.js +15 -7
- package/lib/speak.js +2 -0
- package/package.json +1 -1
package/lib/init.js
CHANGED
|
@@ -68,7 +68,9 @@ module.exports = async () => {
|
|
|
68
68
|
logger.info("├── Local Runner:" + chalk.green(" Free"));
|
|
69
69
|
logger.info("│ └── " + chalk.dim("Run tests on your computer"));
|
|
70
70
|
logger.info("│");
|
|
71
|
-
logger.info(
|
|
71
|
+
logger.info(
|
|
72
|
+
"└── Sandbox Runner:" + chalk.green(" 7 Day Trial then $20/month"),
|
|
73
|
+
);
|
|
72
74
|
logger.info(
|
|
73
75
|
" └── " + chalk.dim("Run tests on private hosted ephemeral VMs"),
|
|
74
76
|
);
|
|
@@ -78,61 +80,73 @@ module.exports = async () => {
|
|
|
78
80
|
logger.info(" └── ✅ " + "Better DX");
|
|
79
81
|
logger.info("");
|
|
80
82
|
|
|
81
|
-
const response = await prompts(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
83
|
+
const response = await prompts(
|
|
84
|
+
[
|
|
85
|
+
{
|
|
86
|
+
type: "confirm",
|
|
87
|
+
name: "TD_VM",
|
|
88
|
+
message: "Use Sandbox Runners? (Recommended)",
|
|
89
|
+
initial: true,
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
type: (prev) => (prev ? "password" : null),
|
|
93
|
+
name: "TD_API_KEY",
|
|
94
|
+
message: "API KEY (from https://app.testdriver.ai/team)",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
type: (prev) => (prev ? null : "confirm"),
|
|
98
|
+
name: "TD_MINIMIZE",
|
|
99
|
+
message: "Minimize terminal app?",
|
|
100
|
+
initial: false,
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
type: (prev) => (prev ? null : "confirm"),
|
|
104
|
+
name: "TD_NOTIFY",
|
|
105
|
+
message: "Enable desktop notifications?",
|
|
106
|
+
initial: true,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
type: (prev) => (prev ? null : "confirm"),
|
|
110
|
+
name: "TD_SPEAK",
|
|
111
|
+
message: "Enable text to speech narration?",
|
|
112
|
+
initial: true,
|
|
113
|
+
},
|
|
111
114
|
|
|
115
|
+
{
|
|
116
|
+
type: "select",
|
|
117
|
+
name: "TD_TYPE",
|
|
118
|
+
message: "What type of app are you testing?",
|
|
119
|
+
choices: [
|
|
120
|
+
{ title: "Website", value: "website" },
|
|
121
|
+
{ title: "Mobile", value: "mobile" },
|
|
122
|
+
{ title: "Desktop", value: "desktop" },
|
|
123
|
+
],
|
|
124
|
+
initial: 0,
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: (prev) => (prev === "website" ? "text" : null),
|
|
128
|
+
name: "TD_WEBSITE",
|
|
129
|
+
message: "What is the root URL of your website?",
|
|
130
|
+
initial: "https://testdriver-sandbox.vercel.app",
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
type: "confirm",
|
|
134
|
+
name: "TD_ANALYTICS",
|
|
135
|
+
message: "Send anonymous analytics?",
|
|
136
|
+
initial: true,
|
|
137
|
+
},
|
|
138
|
+
],
|
|
112
139
|
{
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
initial: 0,
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
type: (prev) => (prev === "website" ? "text" : null),
|
|
125
|
-
name: "TD_WEBSITE",
|
|
126
|
-
message: "What is the root URL of your website?",
|
|
127
|
-
initial: "https://testdriver-sandbox.vercel.app",
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
type: "confirm",
|
|
131
|
-
name: "TD_ANALYTICS",
|
|
132
|
-
message: "Send anonymous analytics?",
|
|
133
|
-
initial: true,
|
|
140
|
+
/**
|
|
141
|
+
* Exit if `ctrl+c`, `ctrl+d`, `esc`, or `abort`
|
|
142
|
+
*
|
|
143
|
+
* @see https://github.com/terkelg/prompts?tab=readme-ov-file#prompts
|
|
144
|
+
*/
|
|
145
|
+
onCancel: () => {
|
|
146
|
+
process.exit(1);
|
|
147
|
+
},
|
|
134
148
|
},
|
|
135
|
-
|
|
149
|
+
);
|
|
136
150
|
|
|
137
151
|
logger.info("");
|
|
138
152
|
logger.info(chalk.dim(`Writing .env...`));
|
package/lib/notify.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
const notifier = require("node-notifier");
|
|
2
2
|
const path = require("path");
|
|
3
3
|
const config = require("./config");
|
|
4
|
+
const { logger } = require("./logger");
|
|
4
5
|
|
|
5
6
|
module.exports = (message) => {
|
|
6
7
|
if (config["TD_NOTIFY"]) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
logger.debug(`${__filename}: %j`, message);
|
|
9
|
+
|
|
10
|
+
try {
|
|
11
|
+
notifier.notify({
|
|
12
|
+
title: "TestDriver.ai",
|
|
13
|
+
message,
|
|
14
|
+
timeout: 5,
|
|
15
|
+
icon: path.join(__dirname, "images", "icon.png"),
|
|
16
|
+
sound: false,
|
|
17
|
+
});
|
|
18
|
+
} catch (error) {
|
|
19
|
+
// Typically, `bad CPU type in executable`
|
|
20
|
+
logger.debug(__filename, error);
|
|
21
|
+
}
|
|
14
22
|
}
|
|
15
23
|
};
|
package/lib/speak.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
const say = require("say");
|
|
2
2
|
const config = require("./config");
|
|
3
|
+
const { logger } = require("./logger");
|
|
3
4
|
|
|
4
5
|
module.exports = (message) => {
|
|
5
6
|
if (config["TD_SPEAK"]) {
|
|
7
|
+
logger.debug(`${__filename}: %j`, message);
|
|
6
8
|
say.stop();
|
|
7
9
|
if (process.platform === "darwin") {
|
|
8
10
|
say.speak(message, "Fred", 1.2);
|