Skip to content

Commit

Permalink
feat: move cypress tests from examples folder's to root (#6147)
Browse files Browse the repository at this point in the history
Co-authored-by: Ali Emir Şen <[email protected]>
  • Loading branch information
BatuhanW and aliemir authored Jul 16, 2024
1 parent b07e95b commit f9774a2
Show file tree
Hide file tree
Showing 292 changed files with 27 additions and 1,944 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/scripts/e2e-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@ const getProjectInfo = (path) => {
command = `pnpm build --scope ${projectName} && pnpm run --filter ${projectName} start:prod`;
}

if (
dependencies.includes("react-scripts") ||
devDependencies.includes("react-scripts")
) {
additionalParams = "--host 127.0.0.1";
}

return {
port,
command,
Expand All @@ -97,11 +90,10 @@ const prettyLog = (bg, ...args) => {
const getProjectsWithE2E = () => {
return EXAMPLES.split(",")
.map((path) => {
const dir = pathJoin(EXAMPLES_DIR, path);
const isDirectory = fs.statSync(dir).isDirectory();
const isConfigExists = fs.existsSync(pathJoin(dir, "cypress"));
const dir = pathJoin("./cypress/e2e", path);
const isDirectory = fs.existsSync(dir);

if (isDirectory && isConfigExists) {
if (isDirectory) {
return path;
}
})
Expand Down Expand Up @@ -233,8 +225,8 @@ const runTests = async () => {

try {
if (!failed) {
const params = `-- --record --group ${path}`;
const runner = `pnpm lerna run cypress:run --scope ${path} ${params}`;
const params = `--record --group ${path}`;
const runner = `pnpm cypress:run --spec cypress/e2e/${path} ${params}`;

prettyLog("blue", `Running tests for ${path}`);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ import { defineConfig } from "cypress";

export default defineConfig({
projectId: "sq5j3e",
retries: 3,
e2e: {
fixturesFolder: "../../cypress/fixtures",
supportFile: "../../cypress/support/e2e.ts",
retries: {
runMode: 3,
},
chromeWebSecurity: false,
experimentalMemoryManagement: true,
numTestsKeptInMemory: 1,
viewportWidth: 1920,
viewportHeight: 1080,
e2e: {
setupNodeEvents(on, config) {
// implement node event listeners here
},
},
});
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ describe("form-material-ui-use-form", () => {
cy.get("#content").should("not.have.value", "").clear();
cy.get("#status").should("not.have.value", "").clear({ force: true });
cy.get("#category").should("not.have.value", "").clear({ force: true });
cy.get("#category").blur();

submitForm();

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion cypress/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"include": ["../**/cypress/**/*.ts", "../**/cypress.config.ts"],
"include": ["./**/*.ts", "cypress.config.ts"],
"compilerOptions": {
"resolveJsonModule": true,
"esModuleInterop": false,
Expand Down
1 change: 0 additions & 1 deletion examples/app-crm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"@typescript-eslint/parser": "5.48.0",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.1",
"cypress": "^13.6.3",
"eslint": "^8.24.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.29.1",
Expand Down
7 changes: 0 additions & 7 deletions examples/auth-antd/cypress/tsconfig.json

This file was deleted.

3 changes: 0 additions & 3 deletions examples/auth-antd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"type": "module",
"scripts": {
"build": "tsc && refine build",
"cypress": "cypress open -C ./cypress.config.ts",
"cypress:run": "cypress run -C ./cypress.config.ts",
"dev": "refine dev",
"preview": "refine start",
"refine": "refine"
Expand Down Expand Up @@ -41,7 +39,6 @@
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^4.2.1",
"cypress": "^13.6.3",
"typescript": "^5.4.2",
"vite": "^5.1.6"
}
Expand Down
15 changes: 0 additions & 15 deletions examples/auth-auth0/cypress.config.ts

This file was deleted.

7 changes: 0 additions & 7 deletions examples/auth-auth0/cypress/tsconfig.json

This file was deleted.

3 changes: 0 additions & 3 deletions examples/auth-auth0/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"type": "module",
"scripts": {
"build": "tsc && refine build",
"cypress": "cypress open -C ./cypress.config.ts",
"cypress:run": "cypress run -C ./cypress.config.ts",
"dev": "refine dev",
"preview": "refine start",
"refine": "refine"
Expand Down Expand Up @@ -42,7 +40,6 @@
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^4.2.1",
"cypress": "^13.6.3",
"typescript": "^5.4.2",
"vite": "^5.1.6"
}
Expand Down
15 changes: 0 additions & 15 deletions examples/auth-chakra-ui/cypress.config.ts

This file was deleted.

7 changes: 0 additions & 7 deletions examples/auth-chakra-ui/cypress/tsconfig.json

This file was deleted.

3 changes: 0 additions & 3 deletions examples/auth-chakra-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"type": "module",
"scripts": {
"build": "tsc && refine build",
"cypress": "cypress open -C ./cypress.config.ts",
"cypress:run": "cypress run -C ./cypress.config.ts",
"dev": "refine dev",
"preview": "refine start",
"refine": "refine"
Expand All @@ -30,7 +28,6 @@
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^4.2.1",
"cypress": "^13.6.3",
"typescript": "^5.4.2",
"vite": "^5.1.6"
}
Expand Down
15 changes: 0 additions & 15 deletions examples/auth-google-login/cypress.config.ts

This file was deleted.

7 changes: 0 additions & 7 deletions examples/auth-google-login/cypress/tsconfig.json

This file was deleted.

3 changes: 0 additions & 3 deletions examples/auth-google-login/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"type": "module",
"scripts": {
"build": "tsc && refine build",
"cypress": "cypress open -C ./cypress.config.ts",
"cypress:run": "cypress run -C ./cypress.config.ts",
"dev": "refine dev",
"preview": "refine start",
"refine": "refine"
Expand Down Expand Up @@ -41,7 +39,6 @@
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^4.2.1",
"cypress": "^13.6.3",
"typescript": "^5.4.2",
"vite": "^5.1.6"
}
Expand Down
15 changes: 0 additions & 15 deletions examples/auth-headless/cypress.config.ts

This file was deleted.

7 changes: 0 additions & 7 deletions examples/auth-headless/cypress/tsconfig.json

This file was deleted.

3 changes: 0 additions & 3 deletions examples/auth-headless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"type": "module",
"scripts": {
"build": "tsc && refine build",
"cypress": "cypress open -C ./cypress.config.ts",
"cypress:run": "cypress run -C ./cypress.config.ts",
"dev": "refine dev",
"preview": "refine start",
"refine": "refine"
Expand All @@ -27,7 +25,6 @@
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^4.2.1",
"cypress": "^13.6.3",
"typescript": "^5.4.2",
"vite": "^5.1.6"
}
Expand Down
15 changes: 0 additions & 15 deletions examples/auth-keycloak/cypress.config.ts

This file was deleted.

7 changes: 0 additions & 7 deletions examples/auth-keycloak/cypress/tsconfig.json

This file was deleted.

3 changes: 0 additions & 3 deletions examples/auth-keycloak/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"type": "module",
"scripts": {
"build": "tsc && refine build",
"cypress": "cypress open -C ./cypress.config.ts",
"cypress:run": "cypress run -C ./cypress.config.ts",
"dev": "refine dev",
"preview": "refine start",
"refine": "refine"
Expand Down Expand Up @@ -43,7 +41,6 @@
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^4.2.1",
"cypress": "^13.6.3",
"typescript": "^5.4.2",
"vite": "^5.1.6"
}
Expand Down
15 changes: 0 additions & 15 deletions examples/auth-mantine/cypress.config.ts

This file was deleted.

7 changes: 0 additions & 7 deletions examples/auth-mantine/cypress/tsconfig.json

This file was deleted.

3 changes: 0 additions & 3 deletions examples/auth-mantine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"type": "module",
"scripts": {
"build": "tsc && refine build",
"cypress": "cypress open -C ./cypress.config.ts",
"cypress:run": "cypress run -C ./cypress.config.ts",
"dev": "refine dev",
"preview": "refine start",
"refine": "refine"
Expand Down Expand Up @@ -34,7 +32,6 @@
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^4.2.1",
"cypress": "^13.6.3",
"typescript": "^5.4.2",
"vite": "^5.1.6"
}
Expand Down
15 changes: 0 additions & 15 deletions examples/auth-material-ui/cypress.config.ts

This file was deleted.

7 changes: 0 additions & 7 deletions examples/auth-material-ui/cypress/tsconfig.json

This file was deleted.

3 changes: 0 additions & 3 deletions examples/auth-material-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
"type": "module",
"scripts": {
"build": "tsc && refine build",
"cypress": "cypress open -C ./cypress.config.ts",
"cypress:run": "cypress run -C ./cypress.config.ts",
"dev": "refine dev",
"preview": "refine start",
"refine": "refine"
Expand Down Expand Up @@ -44,7 +42,6 @@
"@types/react": "^18.0.0",
"@types/react-dom": "^18.0.0",
"@vitejs/plugin-react": "^4.2.1",
"cypress": "^13.6.3",
"typescript": "^5.4.2",
"vite": "^5.1.6"
}
Expand Down
Loading

0 comments on commit f9774a2

Please sign in to comment.