PromucFlow_constructor/app/client/cypress/support/Objects/DataManager.ts

254 lines
8.9 KiB
TypeScript
Raw Normal View History

export class DataManager {
environments = ["Production", "Staging"];
defaultEnviorment = this.environments[0];
2024-04-23 04:31:14 +00:00
GIT_API_BASE = "localhost:4200";
GIT_CLONE_URL = "git@host.docker.internal:Cypress";
dsValues: Record<string, any> = {
Production: {
mongo_authenticationAuthtype: "SCRAM-SHA-1",
mongo_host: "host.docker.internal",
mongo_port: 28017,
mongo_databaseName: "mongo_prod",
postgres_host: "host.docker.internal",
postgres_port: 5432,
postgres_databaseName: "fakeapi",
postgres_username: "docker",
postgres_password: "docker",
mysql_host: "host.docker.internal",
mysql_port: 3306,
mysql_databaseName: "fakeapi",
mysql_username: "root",
mysql_password: "root",
mssql_host: "host.docker.internal",
mssql_port: 1433,
mssql_databaseName: "fakeapi",
mssql_username: "SA",
mssql_password: "Root@123",
arango_host: "host.docker.internal",
arango_port: 8529,
arango_databaseName: "_system",
arango_username: "root",
arango_password: "Arango",
elastic_host: "http://host.docker.internal",
elastic_port: 9200,
elastic_username: "elastic",
elastic_password: "docker",
redshift_host: "localhost",
redshift_port: 543,
redshift_databaseName: "fakeapi",
redshift_username: "root",
redshift_password: "Redshift$123",
smtp_host: "host.docker.internal",
smtp_port: "25",
smtp_username: "root",
smtp_password: "root",
oracle_host: Cypress.env("ORACLE_HOST"),
oracle_port: 1521,
oracle_service: Cypress.env("ORACLE_SERVICE"),
oracle_username: Cypress.env("ORACLE_USERNAME"),
oracle_password: Cypress.env("ORACLE_PASSWORD"),
redis_host: "host.docker.internal",
redis_port: "6379",
OAuth_Username: "testuser@appsmith.com",
OAuth_Host: "http://localhost:6001",
OAuth_ApiUrl: "http://host.docker.internal:6001",
OAUth_AccessTokenUrl: "http://host.docker.internal:6001/oauth/token",
OAuth_AuthUrl: "http://localhost:6001/oauth/authorize",
OAuth_RedirectUrl: "http://localhost/api/v1/datasources/authorize",
AirtableBase: "appubHrVbovcudwN6",
AirtableTable: "tblsFCQSskVFf7xNd",
mockApiUrl: "http://host.docker.internal:5001/v1/mock-api?records=10",
mockGenderAge:
"http://host.docker.internal:5001/v1/genderize_agify?name=",
test: Cypress | Replacing some external api's with TED + Flaky fix (#31118) ## Description - This PR does some clean up of comments - in DeployHelper.ts - This PR replaced external image api with TED mock api in ServerSide/OnLoadTests/OnLoadActions_Spec.ts - Extrenal example api to TED in Widgets/Image/Image_spec.js - Extrenal api links in app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js to TED api's - Flaky fixes /ServerSide/LoginTests/LoginFailure_spec.js - for EE CI run failure (Added multiple Dynamic checks) - support command.js method LoginUser() - added Dynamic check - Encapsulated Datasources/Arango_Basic_Spec.ts into conditional check to run in CE alone, instead of entirely skipping, since its failing in EE due to chrome crash #### Media #### Type of change - Script fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? - [X] Cypress CI runs ## Checklist: #### QA activity: - [X] Added `Test Plan Approved` label after Cypress tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Tests** - Updated Cypress regression tests to use flower images instead of cat images for API calls. - Modified limited test configurations to run with different spec files. - Adjusted GitHub Actions workflow to change `matrix_count` values based on the event type and retrieve PR number for manual triggers. - Updated Docker image tag in CI tests to `nightly`. - **Refactor** - Enhanced `DataManager` class with new properties for flower image URLs. - Improved `EntityExplorer` class method to ensure more reliable triggering of events. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-02-23 07:48:01 +00:00
mockGzipApi: "http://host.docker.internal:5001/v1/gzip",
fix: property pane table binding issue fixed (#26124) ## Description When REST API with which returns response in non array format is bound to table widget, We are not able to see table's data property populated with that api name. This PR fixes the issue ![Screenshot 2023-08-08 at 2 51 12 PM](https://github.com/appsmithorg/appsmith/assets/30018882/0ad16d2b-75ea-4f3c-a47b-31e3811eafd3) #### PR fixes following issue(s) Fixes #25432 > if no issue exists, please create an issue and ask the maintainers about this first > > #### Media > A video or a GIF is preferred. when using Loom, don’t embed because it looks like it’s a GIF. instead, just link to the video > > #### Type of change - Bug fix (non-breaking change which fixes an issue) > > > ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [x] Manual - [ ] Jest - [x] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [x] My code follows the style guidelines of this project - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [x] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [ ] Test plan has been peer reviewed by project stakeholders and other QA members - [ ] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed --------- Co-authored-by: “sneha122” <“sneha@appsmith.com”>
2023-08-11 13:25:29 +00:00
mockApiObjectUrl:
"http://host.docker.internal:5001/v1/mock-api-object?records=10",
echoApiUrl: "http://host.docker.internal:5001/v1/mock-api/echo",
randomCatfactUrl: "http://host.docker.internal:5001/v1/catfact/random",
randomTrumpApi:
"http://host.docker.internal:5001/v1/whatdoestrumpthink/random",
mockHttpCodeUrl: "http://host.docker.internal:5001/v1/mock-http-codes/",
test: Cypress | Replacing some external api's with TED + Flaky fix (#31118) ## Description - This PR does some clean up of comments - in DeployHelper.ts - This PR replaced external image api with TED mock api in ServerSide/OnLoadTests/OnLoadActions_Spec.ts - Extrenal example api to TED in Widgets/Image/Image_spec.js - Extrenal api links in app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js to TED api's - Flaky fixes /ServerSide/LoginTests/LoginFailure_spec.js - for EE CI run failure (Added multiple Dynamic checks) - support command.js method LoginUser() - added Dynamic check - Encapsulated Datasources/Arango_Basic_Spec.ts into conditional check to run in CE alone, instead of entirely skipping, since its failing in EE due to chrome crash #### Media #### Type of change - Script fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? - [X] Cypress CI runs ## Checklist: #### QA activity: - [X] Added `Test Plan Approved` label after Cypress tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Tests** - Updated Cypress regression tests to use flower images instead of cat images for API calls. - Modified limited test configurations to run with different spec files. - Adjusted GitHub Actions workflow to change `matrix_count` values based on the event type and retrieve PR number for manual triggers. - Updated Docker image tag in CI tests to `nightly`. - **Refactor** - Enhanced `DataManager` class with new properties for flower image URLs. - Improved `EntityExplorer` class method to ensure more reliable triggering of events. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-02-23 07:48:01 +00:00
flowerImageUrl1:
2024-04-23 04:31:14 +00:00
"http://host.docker.internal:4200/photo-1503469432756-4aae2e18d881.jpeg",
test: Cypress | Replacing some external api's with TED + Flaky fix (#31118) ## Description - This PR does some clean up of comments - in DeployHelper.ts - This PR replaced external image api with TED mock api in ServerSide/OnLoadTests/OnLoadActions_Spec.ts - Extrenal example api to TED in Widgets/Image/Image_spec.js - Extrenal api links in app/client/cypress/e2e/Regression/ServerSide/ApiTests/API_Bugs_Spec.js to TED api's - Flaky fixes /ServerSide/LoginTests/LoginFailure_spec.js - for EE CI run failure (Added multiple Dynamic checks) - support command.js method LoginUser() - added Dynamic check - Encapsulated Datasources/Arango_Basic_Spec.ts into conditional check to run in CE alone, instead of entirely skipping, since its failing in EE due to chrome crash #### Media #### Type of change - Script fix (non-breaking change which fixes an issue) ## Testing #### How Has This Been Tested? - [X] Cypress CI runs ## Checklist: #### QA activity: - [X] Added `Test Plan Approved` label after Cypress tests were reviewed <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Tests** - Updated Cypress regression tests to use flower images instead of cat images for API calls. - Modified limited test configurations to run with different spec files. - Adjusted GitHub Actions workflow to change `matrix_count` values based on the event type and retrieve PR number for manual triggers. - Updated Docker image tag in CI tests to `nightly`. - **Refactor** - Enhanced `DataManager` class with new properties for flower image URLs. - Improved `EntityExplorer` class method to ensure more reliable triggering of events. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
2024-02-23 07:48:01 +00:00
flowerImageUrl2:
2024-04-23 04:31:14 +00:00
"http://host.docker.internal:4200/photo-1492529029602-33e53698f407.jpeg",
AirtableBaseForME: "appubHrVbovcudwN6",
AirtableTableForME: "tblsFCQSskVFf7xNd",
ApiUrlME: "http://host.docker.internal:5001/v1/production",
firestore_database_url: "https://appsmith-22e8b.firebaseio.com",
firestore_projectID: "appsmith-22e8b",
firestore_serviceaccountkey: Cypress.env("FIRESTORE_PRIVATE_KEY"),
restapi_url: "https://my-json-server.typicode.com/typicode/demo/posts",
connection_type: "Replica set",
mockHostAddress: "fake_api.cvuydmurdlas.us-east-1.rds.amazonaws.com",
mockDatabaseName: "fakeapi",
mockDatabaseUsername: "fakeapi",
mockDatabasePassword: "LimitedAccess123#",
readonly: "readonly",
authenticatedApiUrl: "https://fakeapi.com",
2024-04-23 04:31:14 +00:00
GraphqlApiUrl_TED: "http://host.docker.internal:4200/graphql",
fix: Fix issue with navigation for uqi form queries (#26411) When you have two UQI plugin queries for example Twilio and MongoDB. Navigation between these two queries resets the Mongo actionConfiguration command state. This PR fixes that. Fixes #26410 - Bug fix (non-breaking change which fixes an issue) ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [x] Manual - [ ] Jest - [ ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [x] Test plan has been peer reviewed by project stakeholders and other QA members - [x] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-08-22 17:22:36 +00:00
twilio_username: "random-username",
twilio_password: "random-password",
},
Staging: {
mongo_authenticationAuthtype: "SCRAM-SHA-1",
mongo_host: "host.docker.internal",
mongo_port: 28017,
mongo_databaseName: "mongo_staging",
postgres_host: "host.docker.internal",
postgres_port: 5432,
postgres_databaseName: "stagingdb",
postgres_username: "dockerstaging",
postgres_password: "dockerstaging",
mysql_host: "host.docker.internal",
mysql_port: 3306,
mysql_databaseName: "fakeapi",
mysql_username: "root",
mysql_password: "root",
mssql_host: "host.docker.internal",
mssql_port: 1433,
mssql_databaseName: "fakeapi",
mssql_username: "SA",
mssql_password: "Root@123",
arango_host: "host.docker.internal",
arango_port: 8529,
arango_databaseName: "_system",
arango_username: "root",
arango_password: "Arango",
elastic_host: "http://host.docker.internal",
elastic_port: 9200,
elastic_username: "elastic",
elastic_password: "docker",
redshift_host: "localhost",
redshift_port: 543,
redshift_databaseName: "fakeapi",
redshift_username: "root",
redshift_password: "Redshift$123",
smtp_host: "host.docker.internal",
smtp_port: "25",
smtp_username: "root",
smtp_password: "root",
oracle_host: "random-data",
oracle_port: 40,
oracle_service: "random-name",
oracle_username: "random-username",
oracle_password: "random-password",
redis_host: "host.docker.internal",
redis_port: "6379",
OAuth_Username: "testuser@appsmith.com",
OAuth_Host: "http://localhost:6001",
OAuth_ApiUrl: "http://host.docker.internal:6001",
OAUth_AccessTokenUrl: "http://host.docker.internal:6001/oauth/token",
OAuth_AuthUrl: "http://localhost:6001/oauth/authorize",
OAuth_RedirectUrl: "http://localhost/api/v1/datasources/authorize",
AirtableBase: "appubHrVbovcudwN6",
AirtableTable: "tblsFCQSskVFf7xNd",
mockApiUrl: "http://host.docker.internal:5001/v1/mock-api?records=10",
echoApiUrl: "http://host.docker.internal:5001/v1/mock-api/echo",
randomCatfactUrl: "http://host.docker.internal:5001/v1/catfact/random",
mockHttpCodeUrl: "http://host.docker.internal:5001/v1/mock-http-codes/",
AirtableBaseForME: "appubHrVbovcudwN6",
AirtableTableForME: "tblsFCQSskVFf7xNd",
ApiUrlME: "http://host.docker.internal:5001/v1/staging",
firestore_database_url: "https://staging-sample.firebaseio.com",
firestore_projectID: "appsmith-dummy",
firestore_serviceaccountkey: "dummy_service_creds_key",
restapi_url: "https://my-json-server.typicode.com/typicode/demo/posts",
connection_type: "Replica set",
mockHostAddress: "fake_api.cvuydmurdlas.us-east-1.rds.amazonaws.com",
mockDatabaseName: "fakeapi",
mockDatabaseUsername: "fakeapi",
mockDatabasePassword: "LimitedAccess123#",
readonly: "readonly",
authenticatedApiUrl: "https://fakeapi.com",
2024-04-23 04:31:14 +00:00
GraphqlApiUrl_TED: "http://host.docker.internal:4200/graphql",
fix: Fix issue with navigation for uqi form queries (#26411) When you have two UQI plugin queries for example Twilio and MongoDB. Navigation between these two queries resets the Mongo actionConfiguration command state. This PR fixes that. Fixes #26410 - Bug fix (non-breaking change which fixes an issue) ## Testing > #### How Has This Been Tested? > Please describe the tests that you ran to verify your changes. Also list any relevant details for your test configuration. > Delete anything that is not relevant - [x] Manual - [ ] Jest - [ ] Cypress > > #### Test Plan > Add Testsmith test cases links that relate to this PR > > #### Issues raised during DP testing > Link issues raised during DP testing for better visiblity and tracking (copy link from comments dropped on this PR) > > > ## Checklist: #### Dev activity - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have made corresponding changes to the documentation - [ ] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] PR is being merged under a feature flag #### QA activity: - [ ] [Speedbreak features](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#speedbreakers-) have been covered - [ ] Test plan covers all impacted features and [areas of interest](https://github.com/appsmithorg/TestSmith/wiki/Guidelines-for-test-plans#areas-of-interest-) - [x] Test plan has been peer reviewed by project stakeholders and other QA members - [x] Manually tested functionality on DP - [ ] We had an implementation alignment call with stakeholders post QA Round 2 - [ ] Cypress test cases have been added and approved by SDET/manual QA - [ ] Added `Test Plan Approved` label after Cypress tests were reviewed - [ ] Added `Test Plan Approved` label after JUnit tests were reviewed
2023-08-22 17:22:36 +00:00
twilio_username: "random-username",
twilio_password: "random-password",
},
};
paginationUrl = (records = 20, page = 4, size = 3) => {
return `http://host.docker.internal:5001/v1/mock-api?records=${records}&page=${page}&size=${size}`;
};
mongo_uri = (environment = this.defaultEnviorment) => {
return `mongodb://${this.dsValues[environment].mongo_host}:${this.dsValues[environment].mongo_port}/${this.dsValues[environment].mongo_databaseName}`;
};
mssql_docker = (
containerName: string,
environment = this.defaultEnviorment,
) => {
return `docker run --name=${containerName} -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=${
this.dsValues[environment].mssql_password
}" -p ${this.dsValues[environment].mssql_port.toString()}:${this.dsValues[
environment
].mssql_port.toString()} -d mcr.microsoft.com/azure-sql-edge`;
};
arango_docker = (
containerName: string,
environment = this.defaultEnviorment,
) => {
return `docker run --name ${containerName} -e ARANGO_USERNAME=${
this.dsValues[environment].arango_username
} -e ARANGO_ROOT_PASSWORD=${
this.dsValues[environment].arango_password
} -p ${this.dsValues[environment].arango_port.toString()}:${this.dsValues[
environment
].arango_port.toString()} -d arangodb`;
};
elastic_docker = (
containerName: string,
environment = this.defaultEnviorment,
) => {
return `docker run --name ${containerName} -d -p ${this.dsValues[
environment
].elastic_port.toString()}:${this.dsValues[
environment
].elastic_port.toString()} -e "discovery.type=single-node" -e "ELASTIC_USERNAME=${
this.dsValues[environment].elastic_username
}" -e "ELASTIC_PASSWORD=${
this.dsValues[environment].elastic_password
}" -e "xpack.security.enabled=true" docker.elastic.co/elasticsearch/elasticsearch:7.16.2`;
};
}