diff --git a/packages/amplify-e2e-core/src/init/initProjectHelper.ts b/packages/amplify-e2e-core/src/init/initProjectHelper.ts index 16052f9252..c60a5b77ac 100644 --- a/packages/amplify-e2e-core/src/init/initProjectHelper.ts +++ b/packages/amplify-e2e-core/src/init/initProjectHelper.ts @@ -80,13 +80,17 @@ export function initJSProjectWithProfile(cwd: string, settings?: Partial { - if (err) { - reject(err); - } else { - resolve(); - } - }); + chain + .wait('Help improve Amplify CLI by sharing non sensitive configurations on failures') + .sendYes() + .wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/) + .run((err: Error) => { + if (err) { + reject(err); + } else { + resolve(); + } + }); }); } @@ -120,6 +124,8 @@ export function initAndroidProjectWithProfile(cwd: string, settings: Object): Pr .sendCarriageReturn() .wait('Please choose the profile you want to use') .sendLine(s.profileName) + .wait('Help improve Amplify CLI by sharing non sensitive configurations on failures') + .sendYes() .wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/) .run((err: Error) => { if (!err) { @@ -167,6 +173,8 @@ export function initIosProjectWithProfile(cwd: string, settings: Object): Promis .sendCarriageReturn() .wait('Please choose the profile you want to use') .sendLine(s.profileName) + .wait('Help improve Amplify CLI by sharing non sensitive configurations on failures') + .sendYes() .wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/) .run((err: Error) => { if (!err) { @@ -186,7 +194,7 @@ export function initFlutterProjectWithProfile(cwd: string, settings: Object): Pr addCircleCITags(cwd); return new Promise((resolve, reject) => { - let chain = spawn(getCLIPath(), ['init'], { cwd, stripColors: true }) + const chain = spawn(getCLIPath(), ['init'], { cwd, stripColors: true }) .wait('Enter a name for the project') .sendLine(s.name) .wait('Initialize the project with the above configuration?') @@ -207,14 +215,16 @@ export function initFlutterProjectWithProfile(cwd: string, settings: Object): Pr .sendLine(s.profileName); singleSelect(chain, s.region, amplifyRegions); - - chain.wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/).run((err: Error) => { - if (!err) { - resolve(); - } else { - reject(err); - } - }); + chain + .wait('Help improve Amplify CLI by sharing non sensitive configurations on failures') + .sendYes() + .wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/).run((err: Error) => { + if (!err) { + resolve(); + } else { + reject(err); + } + }); }); } @@ -227,7 +237,7 @@ export function initProjectWithAccessKey( addCircleCITags(cwd); return new Promise((resolve, reject) => { - let chain = spawn(getCLIPath(), ['init'], { + const chain = spawn(getCLIPath(), ['init'], { cwd, stripColors: true, env: { @@ -268,13 +278,16 @@ export function initProjectWithAccessKey( singleSelect(chain, s.region, amplifyRegions); - chain.wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/).run((err: Error) => { - if (!err) { - resolve(); - } else { - reject(err); - } - }); + chain + .wait('Help improve Amplify CLI by sharing non sensitive configurations on failures') + .sendYes() + .wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/).run((err: Error) => { + if (!err) { + resolve(); + } else { + reject(err); + } + }); }); } @@ -282,7 +295,7 @@ export function initNewEnvWithAccessKey(cwd: string, s: { envName: string; acces addCircleCITags(cwd); return new Promise((resolve, reject) => { - let chain = spawn(getCLIPath(), ['init'], { + const chain = spawn(getCLIPath(), ['init'], { cwd, stripColors: true, env: { diff --git a/packages/amplify-e2e-core/src/utils/pinpoint.ts b/packages/amplify-e2e-core/src/utils/pinpoint.ts index b8aed98395..206d570a15 100644 --- a/packages/amplify-e2e-core/src/utils/pinpoint.ts +++ b/packages/amplify-e2e-core/src/utils/pinpoint.ts @@ -119,13 +119,16 @@ export function initProjectForPinpoint(cwd: string): Promise { singleSelect(chain, settings.region, amplifyRegions); - chain.wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/).run((err: Error) => { - if (!err) { - resolve(); - } else { - reject(err); - } - }); + chain + .wait('Help improve Amplify CLI by sharing non sensitive configurations on failures') + .sendYes() + .wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/).run((err: Error) => { + if (!err) { + resolve(); + } else { + reject(err); + } + }); }); } diff --git a/packages/amplify-e2e-tests/src/init-special-cases/index.ts b/packages/amplify-e2e-tests/src/init-special-cases/index.ts index 2ff8f5889f..0c794e11d4 100644 --- a/packages/amplify-e2e-tests/src/init-special-cases/index.ts +++ b/packages/amplify-e2e-tests/src/init-special-cases/index.ts @@ -87,12 +87,15 @@ async function initWorkflow(cwd: string, settings: { accessKeyId: string; secret singleSelect(chain, settings.region, amplifyRegions); - chain.wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/).run((err: Error) => { - if (!err) { - resolve(); - } else { - reject(err); - } - }); + chain + .wait('Help improve Amplify CLI by sharing non sensitive configurations on failures') + .sendYes() + .wait(/Try "amplify add api" to create a backend API and then "amplify (push|publish)" to deploy everything/).run((err: Error) => { + if (!err) { + resolve(); + } else { + reject(err); + } + }); }); }