diff --git a/.eslintrc b/.eslintrc index b220e0ba4..84d3d13c2 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,7 +7,13 @@ "plugins": ["react", "@typescript-eslint", "react-hooks", "simple-import-sort"], "rules": { "simple-import-sort/exports": "error", - "simple-import-sort/imports": "error" + "simple-import-sort/imports": "error", + "prettier/prettier": [ + "error", + { + "endOfLine": "auto" + } + ] }, "extends": [ "eslint:recommended", diff --git a/.prettierrc b/.prettierrc index 2dc6df5b4..dc59f62f4 100644 --- a/.prettierrc +++ b/.prettierrc @@ -2,5 +2,6 @@ "semi": true, "tabWidth": 2, "singleQuote": false, - "trailingComma": "none" + "trailingComma": "none", + "endOfLine":"auto" } \ No newline at end of file diff --git a/README.md b/README.md index 6ed48382f..4a6298453 100644 --- a/README.md +++ b/README.md @@ -14,4 +14,19 @@ The required steps to develop and test the dApp interface locally are as follows 2. Navigate into the directory & install dependencies: i.e. Run `cd interface && npm ci` 3. Copy the `.env.example` file to `.env` and fill out any necessary values. 4. Start the application: i.e. Run `npm run dev` -5. Navigate to `http://localhost:3000/` in a browser. \ No newline at end of file +5. Navigate to `http://localhost:3000/` in a browser. + +## e2e tests + +### Prerequisites + +Playwright browsers need to be installed on your system +``` +npx playwright install +``` + +### Run e2e tests + +``` +npm run e2e +``` \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a0cce2b38..a61a9243b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,6 +40,7 @@ "@types/styled-components": "^5.1.25", "@typescript-eslint/eslint-plugin": "^5.18.0", "@typescript-eslint/parser": "^5.18.0", + "cross-env": "^7.0.3", "customize-cra": "^1.0.0", "eslint-config-prettier": "^8.5.0", "eslint-import-resolver-typescript": "^2.7.1", @@ -6744,6 +6745,24 @@ "node": ">=10" } }, + "node_modules/cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.1" + }, + "bin": { + "cross-env": "src/bin/cross-env.js", + "cross-env-shell": "src/bin/cross-env-shell.js" + }, + "engines": { + "node": ">=10.14", + "npm": ">=6", + "yarn": ">=1" + } + }, "node_modules/cross-fetch": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", @@ -23498,6 +23517,15 @@ "yaml": "^1.10.0" } }, + "cross-env": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.3.tgz", + "integrity": "sha512-+/HKd6EgcQCJGh2PSjZuUitQBQynKor4wrFbRg4DtAgS1aWO+gU52xpH7M9ScGgXSYmAVS9bIJ8EzuaGw0oNAw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + } + }, "cross-fetch": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.5.tgz", diff --git a/package.json b/package.json index 08cd41483..8edbe48d7 100644 --- a/package.json +++ b/package.json @@ -9,11 +9,11 @@ "test": "react-app-rewired test --testPathIgnorePatterns .spec.ts", "eject": "react-app-rewired eject", "lint": "eslint --ignore-path ./.gitignore --ext .js,.ts,.tsx . --quiet --fix", - "prettier": "prettier --write 'src/**/*.{ts,tsx}'", + "prettier": "prettier --write \"src/**/*.{ts,tsx}\"", "prepare": "husky install", "e2e": "playwright test --project=chromium", - "e2e:ci": "CI=true playwright test --project=chromium", - "e2e:debug": "PWDEBUG=console playwright test --project=chromium", + "e2e:ci": "cross-env CI=true playwright test --project=chromium", + "e2e:debug": "cross-env PWDEBUG=console playwright test --project=chromium", "e2e:report": "playwright show-report" }, "dependencies": { @@ -49,6 +49,7 @@ "@types/styled-components": "^5.1.25", "@typescript-eslint/eslint-plugin": "^5.18.0", "@typescript-eslint/parser": "^5.18.0", + "cross-env": "^7.0.3", "customize-cra": "^1.0.0", "eslint-config-prettier": "^8.5.0", "eslint-import-resolver-typescript": "^2.7.1",