Skip to content

Commit 952a92e

Browse files
author
Attila Hajdrik
authored
fix: cli.json update on pull, E2E enhancements (#5516)
* chore(amplify-e2e-core): cleanup, new nexpect methods - remove extra 'src' from imports - add new methods to nexpect - add delay to flaky test for kinesis * fix: handle cli.json copy upon pull to empty dir * chore: fix lgtm warning * fix: nexpect params check for push
1 parent c3ea3a4 commit 952a92e

File tree

20 files changed

+143
-37
lines changed

20 files changed

+143
-37
lines changed

packages/amplify-e2e-core/src/categories/analytics.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { nspawn as spawn, KEY_DOWN_ARROW, getCLIPath } from '../../src';
1+
import { nspawn as spawn, KEY_DOWN_ARROW, getCLIPath } from '..';
22

33
export function addPinpoint(cwd: string, settings: any) {
44
return new Promise((resolve, reject) => {
@@ -9,8 +9,8 @@ export function addPinpoint(cwd: string, settings: any) {
99
.sendLine(settings.wrongName)
1010
.wait('Resource name should be alphanumeric')
1111
.send('\b')
12+
.delay(500) // Some delay required for autocomplete and terminal to catch up
1213
.sendLine(settings.rightName)
13-
.wait('Apps need authorization to send analytics events. Do you want to allow guests')
1414
.sendLine('n')
1515
.wait(`Successfully added resource ${settings.rightName} locally`)
1616
.sendEof()

packages/amplify-e2e-core/src/categories/api.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import { nspawn as spawn, KEY_DOWN_ARROW } from '../../src';
1+
import { getCLIPath, updateSchema, nspawn as spawn, KEY_DOWN_ARROW } from '..';
22
import * as fs from 'fs-extra';
3-
import { getCLIPath, updateSchema } from '../../src';
43
import { selectRuntime, selectTemplate } from './lambda-function';
54
import { singleSelect, multiSelect } from '../utils/selectors';
65
import _ from 'lodash';

packages/amplify-e2e-core/src/categories/auth.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { KEY_UP_ARROW } from '../utils';
2-
import { nspawn as spawn, KEY_DOWN_ARROW, getCLIPath, getSocialProviders } from '../../src';
1+
import { nspawn as spawn, KEY_UP_ARROW, KEY_DOWN_ARROW, getCLIPath, getSocialProviders } from '..';
32

43
export function addAuthWithDefault(cwd: string, settings: any = {}) {
54
return new Promise((resolve, reject) => {

packages/amplify-e2e-core/src/categories/codegen.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getCLIPath, nspawn as spawn } from '../../src';
1+
import { getCLIPath, nspawn as spawn } from '..';
22

33
export function generateModels(cwd: string) {
44
return new Promise((resolve, reject) => {

packages/amplify-e2e-core/src/categories/hosting.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import fs from 'fs-extra';
2-
import path from 'path';
3-
import { nspawn as spawn, getCLIPath, createNewProjectDir, KEY_DOWN_ARROW, readJsonFile } from '../../src';
1+
import * as fs from 'fs-extra';
2+
import * as path from 'path';
3+
import { nspawn as spawn, getCLIPath, createNewProjectDir, KEY_DOWN_ARROW, readJsonFile } from '..';
44
import { spawnSync } from 'child_process';
55

66
export function addDEVHosting(cwd: string) {

packages/amplify-e2e-core/src/categories/interactions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { nspawn as spawn, getCLIPath } from '../../src';
1+
import { nspawn as spawn, getCLIPath } from '..';
22

33
export function addSampleInteraction(cwd: string, settings: any) {
44
return new Promise((resolve, reject) => {

packages/amplify-e2e-core/src/categories/lambda-function.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { nspawn as spawn, ExecutionContext, KEY_DOWN_ARROW, getCLIPath, getProjectMeta, invokeFunction } from '../../src';
1+
import { nspawn as spawn, ExecutionContext, KEY_DOWN_ARROW, getCLIPath, getProjectMeta, invokeFunction } from '..';
22
import { Lambda } from 'aws-sdk';
33
import { singleSelect, multiSelect, moveUp, moveDown } from '../utils/selectors';
44

packages/amplify-e2e-core/src/categories/lambda-layer.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { JSONUtilities } from 'amplify-cli-core';
2-
import fs from 'fs-extra';
1+
import * as fs from 'fs-extra';
2+
import * as path from 'path';
33
import _ from 'lodash';
4-
import path from 'path';
5-
import { nspawn as spawn, ExecutionContext, getCLIPath, KEY_DOWN_ARROW } from '../../src';
4+
import { JSONUtilities } from 'amplify-cli-core';
5+
import { nspawn as spawn, ExecutionContext, getCLIPath, KEY_DOWN_ARROW } from '..';
66
import { getLayerVersion, listVersions } from '../utils/sdk-calls';
77
import { multiSelect } from '../utils/selectors';
88

packages/amplify-e2e-core/src/categories/predictions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { nspawn as spawn, KEY_DOWN_ARROW, getCLIPath } from '../../src';
1+
import { nspawn as spawn, KEY_DOWN_ARROW, getCLIPath } from '..';
22

33
// add convert resource
44
export function addConvert(cwd: string, settings: any) {

packages/amplify-e2e-core/src/categories/storage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { nspawn as spawn, KEY_DOWN_ARROW, getCLIPath } from '../../src';
1+
import { nspawn as spawn, KEY_DOWN_ARROW, getCLIPath } from '..';
22
import { singleSelect, multiSelect } from '../utils/selectors';
33

44
export function addSimpleDDB(cwd: string, settings: any) {

0 commit comments

Comments
 (0)