diff --git a/app/client/cypress/fixtures/datasources.json b/app/client/cypress/fixtures/datasources.json index 5d551de022..708d13e007 100644 --- a/app/client/cypress/fixtures/datasources.json +++ b/app/client/cypress/fixtures/datasources.json @@ -6,12 +6,14 @@ "mongo-uri": "mongodb+srv://localhost:localhost@mockdb.net/mock?retryWrites=true&w=majority", "postgres-host": "localhost", + "postgres-host-fat": "host.docker.internal", "postgres-port": 5432, "postgres-databaseName": "fakeapi", "postgres-username": "docker", "postgres-password": "docker", "mysql-host": "localhost", + "mysql-host-fat": "host.docker.internal", "mysql-port": 3306, "mysql-databaseName": "fakeapi", "mysql-username": "root", diff --git a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitSync/GitSyncedApps_spec.js b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitSync/GitSyncedApps_spec.js index 79d39477d4..baac0cdfcb 100644 --- a/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitSync/GitSyncedApps_spec.js +++ b/app/client/cypress/integration/Smoke_TestSuite/ClientSideTests/Git/GitSync/GitSyncedApps_spec.js @@ -458,6 +458,7 @@ describe("Git sync apps", function() { cy.get(`.t--entity-item:contains(Child_Page Copy)`).within(() => { cy.get(".t--context-menu").click({ force: true }); }); + cy.wait(2000); cy.selectAction("Hide"); cy.get(`.t--entity-item:contains(Child_Page)`) diff --git a/app/client/cypress/locators/HomePage.js b/app/client/cypress/locators/HomePage.js index 5b6325818e..ac661c1b1f 100644 --- a/app/client/cypress/locators/HomePage.js +++ b/app/client/cypress/locators/HomePage.js @@ -95,4 +95,5 @@ export default { optionsIcon: ".t--options-icon", reconnectDatasourceModal: ".reconnect-datasource-modal", importAppProgressWrapper: ".t-import-app-progress-wrapper", + backtoHome: ".t--back-to-home", }; diff --git a/app/client/cypress/support/commands.js b/app/client/cypress/support/commands.js index ab9397afd8..1ac218ea1f 100644 --- a/app/client/cypress/support/commands.js +++ b/app/client/cypress/support/commands.js @@ -1929,3 +1929,20 @@ Cypress.Commands.add("AddPageFromTemplate", () => { .click({ force: true }); cy.get("[data-cy='add-page-from-template']").click(); }); + +Cypress.Commands.add("LogintoAppTestUser", (uname, pword) => { + cy.wait(1000); //waiting for window to load + cy.window() + .its("store") + .invoke("dispatch", { type: "LOGOUT_USER_INIT" }); + cy.wait("@postLogout"); + + cy.visit("/user/login"); + cy.get(loginPage.username).should("be.visible"); + cy.get(loginPage.username).type(uname); + cy.get(loginPage.password).type(pword, { log: false }); + cy.get(loginPage.submitBtn).click(); + cy.wait("@getMe"); + cy.wait(3000); + initLocalstorage(); +}); diff --git a/app/client/cypress/support/dataSourceCommands.js b/app/client/cypress/support/dataSourceCommands.js index 6babb8cc50..7e6acf0afb 100644 --- a/app/client/cypress/support/dataSourceCommands.js +++ b/app/client/cypress/support/dataSourceCommands.js @@ -549,3 +549,51 @@ Cypress.Commands.add("mockDatasourceDescriptionStyle", (tag) => { .and("have.css", "line-height", "17px") .and("have.css", "letter-spacing", "-0.24px"); }); +Cypress.Commands.add( + "fillPostgresDatasourceFormFat", + (shouldAddTrailingSpaces = false) => { + const hostAddress = shouldAddTrailingSpaces + ? datasourceFormData["postgres-host-fat"] + " " + : datasourceFormData["postgres-host-fat"]; + const databaseName = shouldAddTrailingSpaces + ? datasourceFormData["postgres-databaseName"] + " " + : datasourceFormData["postgres-databaseName"]; + + cy.get(datasourceEditor.host).type(hostAddress); + cy.get(datasourceEditor.port).type(datasourceFormData["postgres-port"]); + cy.get(datasourceEditor.databaseName) + .clear() + .type(databaseName); + dataSources.ExpandSectionByName(datasourceEditor.sectionAuthentication); + cy.get(datasourceEditor.username).type( + datasourceFormData["postgres-username"], + ); + cy.get(datasourceEditor.password).type( + datasourceFormData["postgres-password"], + ); + }, +); +Cypress.Commands.add( + "fillMySQLDatasourceFormFat", + (shouldAddTrailingSpaces = false) => { + const hostAddress = shouldAddTrailingSpaces + ? datasourceFormData["mysql-host-fat"] + " " + : datasourceFormData["mysql-host-fat"]; + const databaseName = shouldAddTrailingSpaces + ? datasourceFormData["mysql-databaseName"] + " " + : datasourceFormData["mysql-databaseName"]; + + cy.get(datasourceEditor.host).type(hostAddress); + cy.get(datasourceEditor.port).type(datasourceFormData["mysql-port"]); + cy.get(datasourceEditor.databaseName) + .clear() + .type(databaseName); + dataSources.ExpandSectionByName(datasourceEditor.sectionAuthentication); + cy.get(datasourceEditor.username).type( + datasourceFormData["mysql-username"], + ); + cy.get(datasourceEditor.password).type( + datasourceFormData["mysql-password"], + ); + }, +); diff --git a/app/client/cypress/support/widgetCommands.js b/app/client/cypress/support/widgetCommands.js index 0379a64c11..d1cee2dcfa 100644 --- a/app/client/cypress/support/widgetCommands.js +++ b/app/client/cypress/support/widgetCommands.js @@ -1106,6 +1106,7 @@ Cypress.Commands.add("Deletepage", (Pagename) => { cy.get(`.t--entity-item:contains(${Pagename})`).within(() => { cy.get(".t--context-menu").click({ force: true }); }); + cy.wait(2000); cy.selectAction("Delete"); cy.selectAction("Are you sure?"); cy.wait("@deletePage");