Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: make test updates per https://github.com/aws-amplify/amplify-cli/pull/10383/files #508

Merged
merged 1 commit into from
Jun 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 38 additions & 25 deletions packages/amplify-e2e-core/src/init/initProjectHelper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ export function initJSProjectWithProfile(cwd: string, settings?: Partial<typeof
.sendLine(s.profileName);
}

chain.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();
}
});
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();
}
});
});
}

Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand All @@ -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?')
Expand All @@ -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);
}
});
});
}

Expand All @@ -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: {
Expand Down Expand Up @@ -268,21 +278,24 @@ 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);
}
});
});
}

export function initNewEnvWithAccessKey(cwd: string, s: { envName: string; accessKeyId: string; secretAccessKey: string }): Promise<void> {
addCircleCITags(cwd);

return new Promise((resolve, reject) => {
let chain = spawn(getCLIPath(), ['init'], {
const chain = spawn(getCLIPath(), ['init'], {
cwd,
stripColors: true,
env: {
Expand Down
17 changes: 10 additions & 7 deletions packages/amplify-e2e-core/src/utils/pinpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,16 @@ export function initProjectForPinpoint(cwd: string): Promise<void> {

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);
}
});
});
}

Expand Down
17 changes: 10 additions & 7 deletions packages/amplify-e2e-tests/src/init-special-cases/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
});
}