From 25910e7655bb377e70efbcdce7270986d8d1747c Mon Sep 17 00:00:00 2001 From: Gabriel Dutra Date: Sun, 24 Mar 2019 11:24:59 -0300 Subject: [PATCH] Move cypress to client folder (#3566) --- .circleci/Dockerfile.cypress | 2 +- .circleci/config.yml | 2 +- .gitignore | 4 ++-- {cypress => client/cypress}/cypress.js | 0 .../integration/dashboard/dashboard_spec.js | 0 .../data-source/create_data_source_spec.js | 0 .../data-source/edit_data_source_spec.js | 0 .../destination/create_destination_spec.js | 0 .../cypress}/integration/group/edit_group_spec.js | 0 .../cypress}/integration/group/group_list_spec.js | 0 .../cypress}/integration/query/create_query_spec.js | 0 .../cypress}/integration/query/search_query_spec.js | 0 .../settings/organization_settings_spec.js | 0 .../cypress}/integration/user/edit_profile_spec.js | 0 .../cypress}/integration/user/login_spec.js | 0 .../cypress}/integration/user/logout_spec.js | 0 .../cypress}/integration/user/user_list_spec.js | 0 {cypress => client/cypress}/plugins/index.js | 0 {cypress => client/cypress}/seed-data.js | 0 {cypress => client/cypress}/support/commands.js | 2 +- {cypress => client/cypress}/support/index.js | 0 cypress.json | 8 +++++++- package.json | 13 ++++++++----- 23 files changed, 20 insertions(+), 11 deletions(-) rename {cypress => client/cypress}/cypress.js (100%) rename {cypress => client/cypress}/integration/dashboard/dashboard_spec.js (100%) rename {cypress => client/cypress}/integration/data-source/create_data_source_spec.js (100%) rename {cypress => client/cypress}/integration/data-source/edit_data_source_spec.js (100%) rename {cypress => client/cypress}/integration/destination/create_destination_spec.js (100%) rename {cypress => client/cypress}/integration/group/edit_group_spec.js (100%) rename {cypress => client/cypress}/integration/group/group_list_spec.js (100%) rename {cypress => client/cypress}/integration/query/create_query_spec.js (100%) rename {cypress => client/cypress}/integration/query/search_query_spec.js (100%) rename {cypress => client/cypress}/integration/settings/organization_settings_spec.js (100%) rename {cypress => client/cypress}/integration/user/edit_profile_spec.js (100%) rename {cypress => client/cypress}/integration/user/login_spec.js (100%) rename {cypress => client/cypress}/integration/user/logout_spec.js (100%) rename {cypress => client/cypress}/integration/user/user_list_spec.js (100%) rename {cypress => client/cypress}/plugins/index.js (100%) rename {cypress => client/cypress}/seed-data.js (100%) rename {cypress => client/cypress}/support/commands.js (80%) rename {cypress => client/cypress}/support/index.js (100%) diff --git a/.circleci/Dockerfile.cypress b/.circleci/Dockerfile.cypress index ac8efd848b..d4e29881cc 100644 --- a/.circleci/Dockerfile.cypress +++ b/.circleci/Dockerfile.cypress @@ -6,7 +6,7 @@ WORKDIR $APP COPY package.json $APP/package.json RUN npm run cypress:install > /dev/null -COPY cypress $APP/cypress +COPY client/cypress $APP/client/cypress COPY cypress.json $APP/cypress.json RUN ./node_modules/.bin/cypress verify diff --git a/.circleci/config.yml b/.circleci/config.yml index a6781df0de..5788c5b52e 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -72,7 +72,7 @@ jobs: name: Setup Redash server command: | npm run cypress start - docker-compose run cypress node ./cypress/cypress.js db-seed + docker-compose run cypress npm run cypress db-seed - run: name: Execute Cypress tests command: npm run cypress run-ci diff --git a/.gitignore b/.gitignore index 7307021b73..350e1f610d 100644 --- a/.gitignore +++ b/.gitignore @@ -24,5 +24,5 @@ node_modules .sass-cache npm-debug.log -cypress/screenshots -cypress/videos +client/cypress/screenshots +client/cypress/videos diff --git a/cypress/cypress.js b/client/cypress/cypress.js similarity index 100% rename from cypress/cypress.js rename to client/cypress/cypress.js diff --git a/cypress/integration/dashboard/dashboard_spec.js b/client/cypress/integration/dashboard/dashboard_spec.js similarity index 100% rename from cypress/integration/dashboard/dashboard_spec.js rename to client/cypress/integration/dashboard/dashboard_spec.js diff --git a/cypress/integration/data-source/create_data_source_spec.js b/client/cypress/integration/data-source/create_data_source_spec.js similarity index 100% rename from cypress/integration/data-source/create_data_source_spec.js rename to client/cypress/integration/data-source/create_data_source_spec.js diff --git a/cypress/integration/data-source/edit_data_source_spec.js b/client/cypress/integration/data-source/edit_data_source_spec.js similarity index 100% rename from cypress/integration/data-source/edit_data_source_spec.js rename to client/cypress/integration/data-source/edit_data_source_spec.js diff --git a/cypress/integration/destination/create_destination_spec.js b/client/cypress/integration/destination/create_destination_spec.js similarity index 100% rename from cypress/integration/destination/create_destination_spec.js rename to client/cypress/integration/destination/create_destination_spec.js diff --git a/cypress/integration/group/edit_group_spec.js b/client/cypress/integration/group/edit_group_spec.js similarity index 100% rename from cypress/integration/group/edit_group_spec.js rename to client/cypress/integration/group/edit_group_spec.js diff --git a/cypress/integration/group/group_list_spec.js b/client/cypress/integration/group/group_list_spec.js similarity index 100% rename from cypress/integration/group/group_list_spec.js rename to client/cypress/integration/group/group_list_spec.js diff --git a/cypress/integration/query/create_query_spec.js b/client/cypress/integration/query/create_query_spec.js similarity index 100% rename from cypress/integration/query/create_query_spec.js rename to client/cypress/integration/query/create_query_spec.js diff --git a/cypress/integration/query/search_query_spec.js b/client/cypress/integration/query/search_query_spec.js similarity index 100% rename from cypress/integration/query/search_query_spec.js rename to client/cypress/integration/query/search_query_spec.js diff --git a/cypress/integration/settings/organization_settings_spec.js b/client/cypress/integration/settings/organization_settings_spec.js similarity index 100% rename from cypress/integration/settings/organization_settings_spec.js rename to client/cypress/integration/settings/organization_settings_spec.js diff --git a/cypress/integration/user/edit_profile_spec.js b/client/cypress/integration/user/edit_profile_spec.js similarity index 100% rename from cypress/integration/user/edit_profile_spec.js rename to client/cypress/integration/user/edit_profile_spec.js diff --git a/cypress/integration/user/login_spec.js b/client/cypress/integration/user/login_spec.js similarity index 100% rename from cypress/integration/user/login_spec.js rename to client/cypress/integration/user/login_spec.js diff --git a/cypress/integration/user/logout_spec.js b/client/cypress/integration/user/logout_spec.js similarity index 100% rename from cypress/integration/user/logout_spec.js rename to client/cypress/integration/user/logout_spec.js diff --git a/cypress/integration/user/user_list_spec.js b/client/cypress/integration/user/user_list_spec.js similarity index 100% rename from cypress/integration/user/user_list_spec.js rename to client/cypress/integration/user/user_list_spec.js diff --git a/cypress/plugins/index.js b/client/cypress/plugins/index.js similarity index 100% rename from cypress/plugins/index.js rename to client/cypress/plugins/index.js diff --git a/cypress/seed-data.js b/client/cypress/seed-data.js similarity index 100% rename from cypress/seed-data.js rename to client/cypress/seed-data.js diff --git a/cypress/support/commands.js b/client/cypress/support/commands.js similarity index 80% rename from cypress/support/commands.js rename to client/cypress/support/commands.js index 3b5f00c8e4..e8b39361b1 100644 --- a/cypress/support/commands.js +++ b/client/cypress/support/commands.js @@ -1,4 +1,4 @@ -import '@percy/cypress'; +import '@percy/cypress'; // eslint-disable-line import/no-extraneous-dependencies Cypress.Commands.add('login', (email = 'admin@redash.io', password = 'password') => cy.request({ url: '/login', diff --git a/cypress/support/index.js b/client/cypress/support/index.js similarity index 100% rename from cypress/support/index.js rename to client/cypress/support/index.js diff --git a/cypress.json b/cypress.json index c4043d1fa5..fc64f9ddd5 100644 --- a/cypress.json +++ b/cypress.json @@ -1,4 +1,10 @@ { "baseUrl": "http://localhost:5000", - "video": false + "video": false, + "fixturesFolder": "client/cypress/fixtures", + "integrationFolder": "client/cypress/integration", + "pluginsFile": "client/cypress/plugins/index.js", + "screenshotsFolder": "client/cypress/screenshots", + "videosFolder": "client/cypress/videos", + "supportFile": "client/cypress/support/index.js" } diff --git a/package.json b/package.json index 8533ae3882..6b9b52f523 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "test": "TZ=Africa/Khartoum jest", "test:watch": "jest --watch", "cypress:install": "npm install --no-save cypress@^3.1.5 @percy/cypress@^0.2.3 atob@2.1.2", - "cypress": "node cypress/cypress.js" + "cypress": "node client/cypress/cypress.js" }, "repository": { "type": "git", @@ -155,9 +155,12 @@ } }, "lint-staged": { - "client/app/**/*.{js,jsx}": [ - "npm run lint:base", - "npm run test -- --bail --findRelatedTests" - ] + "linters": { + "client/**/*.{js,jsx}": [ + "npm run lint:base", + "npm run test -- --bail --findRelatedTests" + ] + }, + "ignore": ["client/dist/*"] } }