diff --git a/.eslint-dictionary.json b/.eslint-dictionary.json index 6a73a10eeef..1fc5762c777 100644 --- a/.eslint-dictionary.json +++ b/.eslint-dictionary.json @@ -73,6 +73,7 @@ "matcher", "mfas", "minify", + "mkdirs", "mockable", "modelfieldmapimpl", "modelgen", @@ -95,6 +96,7 @@ "pathname", "pbkdf2Sync", "pipelined", + "pkill", "positionally", "posix", "postauthorcd", @@ -136,6 +138,7 @@ "uibuilder", "uint", "unauth", + "unlink", "updateamplify", "urls", "userpool", diff --git a/packages/amplify-e2e-tests/src/__tests__/uibuilder.test.ts b/packages/amplify-e2e-tests/src/__tests__/uibuilder.test.ts index f3d3d794e88..598ebdc4e50 100644 --- a/packages/amplify-e2e-tests/src/__tests__/uibuilder.test.ts +++ b/packages/amplify-e2e-tests/src/__tests__/uibuilder.test.ts @@ -1,7 +1,6 @@ import { getBackendAmplifyMeta, getAppId, amplifyPull, createNewProjectDir, deleteProject, deleteProjectDir, initJSProjectWithProfile, -} from 'amplify-e2e-core'; -import { + getNpxPath, getNpmPath, myIconComponent, formCheckoutComponent, } from 'amplify-e2e-core'; import { spawnSync, spawn } from 'child_process'; @@ -16,8 +15,17 @@ describe('amplify pull with uibuilder', () => { let projectName: string; let reactDir: string; let appId: string; + const envName = 'integtest'; + const cypressConfig = ` + const { defineConfig } = require('cypress') + module.exports = defineConfig({ + e2e: { + supportFile: false + } + }) + `; beforeEach(async () => { projRoot = await createNewProjectDir('pull-uibuilder'); projRoot2 = await createNewProjectDir('pull-uibuilder-2'); @@ -54,7 +62,7 @@ describe('amplify pull with uibuilder', () => { deleteProjectDir(reactDir); }); - it('appropriate uibiulder files are generated', async () => { + it('appropriate uibuilder files are generated', async () => { spawnSync(getNpxPath(), ['create-react-app', projectName], { cwd: projectDir, encoding: 'utf-8' }); await amplifyPull(reactDir, { appId, envName, emptyDir: true }); const fileList = fs.readdirSync(`${reactDir}/src/ui-components/`); @@ -74,10 +82,10 @@ describe('amplify pull with uibuilder', () => { fs.unlinkSync(`${reactDir}/src/App.js`); fs.writeFileSync(`${reactDir}/src/App.js`, fs.readFileSync(path.join(__dirname, '..', 'cypress', 'uibuilder', 'uibuilder-app.js'))); - fs.writeFileSync(`${reactDir}/cypress.json`, '{}'); - fs.mkdirsSync(`${reactDir}/cypress/integration/`); + fs.writeFileSync(`${reactDir}/cypress.config.js`, cypressConfig); + fs.mkdirsSync(`${reactDir}/cypress/e2e/`); fs.writeFileSync( - `${reactDir}/cypress/integration/sample_spec.js`, + `${reactDir}/cypress/e2e/sample_spec.cy.js`, fs.readFileSync(path.join(__dirname, '..', 'cypress', 'uibuilder', 'uibuilder-spec.js')), );