test: Cypress Flaky fixes + Mock api update + PgAdminspec fix (#20032)
## Description - Fixed PgAdminspec **Fixed below flaky tests** - PgAdmin_spec.ts - CreateNewApp_spec.js - DatasourceSchema_spec.ts - Tab_spec.js - GitBugs_spec.js - Fork_Template_Existing_app_spec.js - Fork_Template_To_App_spec.js - Fork_Template_spec.js - Scrolling_Spec.ts - APIOnLoad_Spec.ts - SetTimeout_spec.ts **Updated git helper methods** - MongoDBShoppingCart_spec.js - GitImport_spec.js - Deploy_spec.js - DisconnectGit_spec.js - GitBugs_spec.js - RepoLimitExceededErrorModal_spec.js - ForkTemplateToGitConnectedApp.js **Modified mock api url and refactored below specs accordingly** - PromisesApp_spec.js - Autocomplete_JS_spec.ts - Bug16377_spec.ts - InputTruncateCheck_Spec.ts - Refactoring_spec.ts - FilePickerV2_spec.js - CurlImportFlow_spec.js - SetTimeout_spec.ts ## Type of change - Flaky test fix ## How Has This Been Tested? - Cypress test runs ## Checklist: ### QA activity: - [ ] Test plan has been approved by relevant developers - [ ] Test plan has been peer reviewed by QA - [ ] Cypress test cases have been added and approved by either SDET or manual QA - [ ] Organized project review call with relevant stakeholders after Round 1/2 of QA - [ ] Added Test Plan Approved label after reveiwing all Cypress test --------- Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
This commit is contained in:
parent
e695284b95
commit
a2afc8c4d9
|
|
@ -13,9 +13,6 @@
|
||||||
"html": true,
|
"html": true,
|
||||||
"json": false
|
"json": false
|
||||||
},
|
},
|
||||||
"ignoreTestFiles": [
|
|
||||||
"**/Regression_TestSuite/Application/PgAdmin_spec*.js"
|
|
||||||
],
|
|
||||||
"chromeWebSecurity": false,
|
"chromeWebSecurity": false,
|
||||||
"viewportHeight": 1100,
|
"viewportHeight": 1100,
|
||||||
"viewportWidth": 1400,
|
"viewportWidth": 1400,
|
||||||
|
|
|
||||||
|
|
@ -1110,7 +1110,7 @@
|
||||||
"widgetId": "hzi419yzw9",
|
"widgetId": "hzi419yzw9",
|
||||||
"accentColor": "{{appsmith.theme.colors.primaryColor}}",
|
"accentColor": "{{appsmith.theme.colors.primaryColor}}",
|
||||||
"isVisibleFilters": true,
|
"isVisibleFilters": true,
|
||||||
"tableData": "{{TC1api.data.users}}",
|
"tableData": "{{TC1api.data}}",
|
||||||
"isVisible": true,
|
"isVisible": true,
|
||||||
"label": "Data",
|
"label": "Data",
|
||||||
"searchKey": "",
|
"searchKey": "",
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ const datasource = require("../../../locators/DatasourcesEditor.json");
|
||||||
const queryLocators = require("../../../locators/QueryEditor.json");
|
const queryLocators = require("../../../locators/QueryEditor.json");
|
||||||
const appPage = require("../../../locators/PgAdminlocators.json");
|
const appPage = require("../../../locators/PgAdminlocators.json");
|
||||||
const formControls = require("../../../locators/FormControl.json");
|
const formControls = require("../../../locators/FormControl.json");
|
||||||
|
import * as _ from "../../../support/Objects/ObjectsCore";
|
||||||
|
|
||||||
let repoName;
|
let repoName;
|
||||||
describe("Shopping cart App", function() {
|
describe("Shopping cart App", function() {
|
||||||
|
|
@ -193,19 +194,22 @@ describe("Shopping cart App", function() {
|
||||||
.should("have.text", "3");
|
.should("have.text", "3");
|
||||||
});
|
});
|
||||||
|
|
||||||
/*it("Connect the appplication to git and validate data in deploy mode and edit mode", function() {
|
it("3. Connect the appplication to git and validate data in deploy mode and edit mode", function() {
|
||||||
cy.generateUUID().then((uid) => {
|
_.gitSync.CreateNConnectToGit(repoName);
|
||||||
repoName = uid;
|
cy.get("@gitRepoName").then((repName) => {
|
||||||
cy.createTestGithubRepo(repoName);
|
repoName = repName;
|
||||||
cy.connectToGitRepo(repoName);
|
|
||||||
});
|
});
|
||||||
cy.latestDeployPreview();
|
cy.latestDeployPreview();
|
||||||
cy.wait(2000)
|
cy.wait(2000);
|
||||||
cy.get(".selected-row").children().eq(0)
|
cy.get(".selected-row")
|
||||||
|
.children()
|
||||||
|
.eq(0)
|
||||||
.should("have.text", "A man called ove");
|
.should("have.text", "A man called ove");
|
||||||
cy.get(commonlocators.backToEditor).click();
|
_.deployMode.NavigateBacktoEditor();
|
||||||
cy.get(".selected-row").children().eq(0)
|
cy.get(".selected-row")
|
||||||
|
.children()
|
||||||
|
.eq(0)
|
||||||
.should("have.text", "A man called ove");
|
.should("have.text", "A man called ove");
|
||||||
cy.wait(1000);
|
cy.wait(1000);
|
||||||
}) */
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import homePage from "../../../locators/HomePage";
|
import * as _ from "../../../support/Objects/ObjectsCore";
|
||||||
const dsl = require("../../../fixtures/PgAdmindsl.json");
|
const dsl = require("../../../fixtures/PgAdmindsl.json");
|
||||||
const datasource = require("../../../locators/DatasourcesEditor.json");
|
|
||||||
const queryLocators = require("../../../locators/QueryEditor.json");
|
const queryLocators = require("../../../locators/QueryEditor.json");
|
||||||
const widgetsPage = require("../../../locators/Widgets.json");
|
const widgetsPage = require("../../../locators/Widgets.json");
|
||||||
const appPage = require("../../../locators/PgAdminlocators.json");
|
const appPage = require("../../../locators/PgAdminlocators.json");
|
||||||
|
|
@ -12,25 +11,16 @@ describe("PgAdmin Clone App", function() {
|
||||||
cy.addDsl(dsl);
|
cy.addDsl(dsl);
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
it("1. Add dsl and authenticate datasource", function() {
|
||||||
cy.startRoutesForDatasource();
|
_.dataSources.CreateDataSource("Postgres");
|
||||||
});
|
cy.get("@dsName").then(($dsName) => {
|
||||||
|
datasourceName = $dsName;
|
||||||
it("Add dsl and authenticate datasource", function() {
|
|
||||||
// authenticating datasource
|
|
||||||
cy.NavigateToDatasourceEditor();
|
|
||||||
cy.get(datasource.PostgreSQL).click();
|
|
||||||
cy.fillPostgresDatasourceForm();
|
|
||||||
|
|
||||||
cy.testSaveDatasource();
|
|
||||||
|
|
||||||
cy.get("@saveDatasource").then((httpResponse) => {
|
|
||||||
datasourceName = httpResponse.response.body.data.name;
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Create queries", function() {
|
it("2. Create queries", function() {
|
||||||
cy.NavigateToQueryEditor();
|
cy.NavigateToQueryEditor();
|
||||||
|
cy.NavigateToActiveTab();
|
||||||
// clicking on new query to write a query
|
// clicking on new query to write a query
|
||||||
cy.contains(".t--datasource-name", datasourceName)
|
cy.contains(".t--datasource-name", datasourceName)
|
||||||
.find(queryLocators.createQuery)
|
.find(queryLocators.createQuery)
|
||||||
|
|
@ -43,16 +33,11 @@ describe("PgAdmin Clone App", function() {
|
||||||
cy.get(queryLocators.templateMenu).click();
|
cy.get(queryLocators.templateMenu).click();
|
||||||
cy.get(queryLocators.query).click({ force: true });
|
cy.get(queryLocators.query).click({ force: true });
|
||||||
// writing query to get the schema
|
// writing query to get the schema
|
||||||
cy.get(".CodeMirror textarea")
|
_.dataSources.EnterQuery(
|
||||||
.first()
|
"SELECT schema_name FROM information_schema.schemata;",
|
||||||
.focus()
|
);
|
||||||
.type("SELECT schema_name FROM information_schema.schemata;", {
|
_.dataSources.RunQuery();
|
||||||
force: true,
|
// clicking on chevron icon to go back to the _.dataSources page
|
||||||
parseSpecialCharSequences: false,
|
|
||||||
});
|
|
||||||
cy.WaitAutoSave();
|
|
||||||
cy.runQuery();
|
|
||||||
// clicking on chevron icon to go back to the datasources page
|
|
||||||
cy.get(appPage.dropdownChevronLeft).click();
|
cy.get(appPage.dropdownChevronLeft).click();
|
||||||
// clicking on new query to write a query
|
// clicking on new query to write a query
|
||||||
cy.contains(".t--datasource-name", datasourceName)
|
cy.contains(".t--datasource-name", datasourceName)
|
||||||
|
|
@ -61,19 +46,12 @@ describe("PgAdmin Clone App", function() {
|
||||||
cy.get(queryLocators.queryNameField).type("get_tables");
|
cy.get(queryLocators.queryNameField).type("get_tables");
|
||||||
cy.get(queryLocators.templateMenu).click();
|
cy.get(queryLocators.templateMenu).click();
|
||||||
// writing query to get all the tables
|
// writing query to get all the tables
|
||||||
cy.get(".CodeMirror textarea")
|
_.dataSources.EnterQuery(
|
||||||
.first()
|
`select * from pg_catalog.pg_tables where schemaname = {{schema_select.selectedOptionValue || "public"}} ;`,
|
||||||
.focus()
|
2000,
|
||||||
.type(
|
|
||||||
'select * from pg_catalog.pg_tables where schemaname = {{schema_select.selectedOptionValue || "public"}} ;',
|
|
||||||
{
|
|
||||||
force: true,
|
|
||||||
parseSpecialCharSequences: false,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
cy.WaitAutoSave();
|
_.dataSources.RunQuery();
|
||||||
cy.runQuery();
|
// clicking on chevron icon to go back to the _.dataSources page
|
||||||
// clicking on chevron icon to go back to the datasources page
|
|
||||||
cy.get(appPage.dropdownChevronLeft).click();
|
cy.get(appPage.dropdownChevronLeft).click();
|
||||||
// clicking on new query to write a query
|
// clicking on new query to write a query
|
||||||
cy.contains(".t--datasource-name", datasourceName)
|
cy.contains(".t--datasource-name", datasourceName)
|
||||||
|
|
@ -82,21 +60,40 @@ describe("PgAdmin Clone App", function() {
|
||||||
cy.get(queryLocators.queryNameField).type("get_columns");
|
cy.get(queryLocators.queryNameField).type("get_columns");
|
||||||
cy.get(queryLocators.templateMenu).click();
|
cy.get(queryLocators.templateMenu).click();
|
||||||
// creating query to get the columns of the table
|
// creating query to get the columns of the table
|
||||||
cy.get(".CodeMirror textarea")
|
_.dataSources.EnterQuery(
|
||||||
.first()
|
`SELECT column_name, data_type, table_name, ordinal_position, is_nullable FROM information_schema.COLUMNS`,
|
||||||
.focus()
|
|
||||||
.type(
|
|
||||||
"SELECT column_name, data_type, table_name, ordinal_position, is_nullable FROM information_schema.COLUMNS",
|
|
||||||
{
|
|
||||||
force: true,
|
|
||||||
parseSpecialCharSequences: false,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
cy.WaitAutoSave();
|
_.dataSources.RunQuery();
|
||||||
cy.runQuery();
|
_.ee.SelectEntityByName("Page1", "Pages");
|
||||||
// clicking on chevron icon to go back to the datasources page
|
_.agHelper.GetNClick(appPage.viewButton, 0, true);
|
||||||
cy.get(appPage.dropdownChevronLeft).click();
|
// adding new table
|
||||||
// clicking on new query to write a query
|
_.agHelper.GetNClick(appPage.addNewtable, 0, true);
|
||||||
|
_.agHelper.GenerateUUID();
|
||||||
|
cy.get("@guid").then((uid) => {
|
||||||
|
cy.xpath(appPage.addTablename)
|
||||||
|
.clear()
|
||||||
|
.type(`table${uid}`);
|
||||||
|
});
|
||||||
|
// adding column to the table
|
||||||
|
_.agHelper.GetNClick(appPage.addColumn, 0, true);
|
||||||
|
_.agHelper.AssertElementVisible(appPage.columnNamefield);
|
||||||
|
_.agHelper.AssertElementVisible(appPage.datatypefield);
|
||||||
|
cy.xpath(appPage.addTablename)
|
||||||
|
.click()
|
||||||
|
.type("id");
|
||||||
|
cy.get(appPage.dropdownChevronDown)
|
||||||
|
.last()
|
||||||
|
.click();
|
||||||
|
_.agHelper.GetNClick(appPage.selectDatatype);
|
||||||
|
// switching on the Not Null toggle
|
||||||
|
cy.get(widgetsPage.switchWidgetInactive)
|
||||||
|
.last()
|
||||||
|
.click();
|
||||||
|
_.agHelper.GetNClick(appPage.submitButton, 0, true);
|
||||||
|
_.agHelper.AssertElementVisible(appPage.addColumn);
|
||||||
|
_.agHelper.GetNClick(appPage.closeButton, 0, true);
|
||||||
|
_.dataSources.NavigateToActiveTab();
|
||||||
|
|
||||||
cy.contains(".t--datasource-name", datasourceName)
|
cy.contains(".t--datasource-name", datasourceName)
|
||||||
.find(queryLocators.createQuery)
|
.find(queryLocators.createQuery)
|
||||||
.click();
|
.click();
|
||||||
|
|
@ -107,19 +104,12 @@ describe("PgAdmin Clone App", function() {
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get(queryLocators.templateMenu).click();
|
cy.get(queryLocators.templateMenu).click();
|
||||||
// writing query to create new table
|
// writing query to create new table
|
||||||
cy.get(".CodeMirror textarea")
|
|
||||||
.first()
|
_.dataSources.EnterQuery(
|
||||||
.focus()
|
`CREATE TABLE {{schema_select.selectedOptionValue}}.{{nt_name.text.replaceAll(" ","_")}}({{appsmith.store.nt_col.map((c)=>c.name.replaceAll(" ","_") + " " + c.dtype + (c.nnull ? " NOT NULL " : "") + (c.pkey ? " PRIMARY KEY " : "")).join(" , ")}})`,
|
||||||
.type(
|
|
||||||
'CREATE TABLE {{schema_select.selectedOptionValue}}.{{nt_name.text.replaceAll(" ","_")}}({{appsmith.store.nt_col.map((c)=>c.name.replaceAll(" ","_") + " " + c.dtype + (c.nnull ? " NOT NULL " : "") + (c.pkey ? " PRIMARY KEY " : "")).join(" , ")}})',
|
|
||||||
{
|
|
||||||
force: true,
|
|
||||||
parseSpecialCharSequences: false,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
cy.WaitAutoSave();
|
_.dataSources.RunQuery();
|
||||||
cy.runQuery();
|
// clicking on chevron icon to go back to the _.dataSources page
|
||||||
// clicking on chevron icon to go back to the datasources page
|
|
||||||
cy.get(appPage.dropdownChevronLeft).click();
|
cy.get(appPage.dropdownChevronLeft).click();
|
||||||
// clicking on new query to write a query
|
// clicking on new query to write a query
|
||||||
cy.contains(".t--datasource-name", datasourceName)
|
cy.contains(".t--datasource-name", datasourceName)
|
||||||
|
|
@ -132,38 +122,30 @@ describe("PgAdmin Clone App", function() {
|
||||||
.last()
|
.last()
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
// creating query to delete the table
|
// creating query to delete the table
|
||||||
cy.get(".CodeMirror textarea")
|
_.dataSources.EnterQuery(
|
||||||
.first()
|
`DROP TABLE {{schema_select.selectedOptionValue}}.{{List1.selectedItem.tablename}};`,
|
||||||
.focus()
|
|
||||||
.type(
|
|
||||||
"DROP TABLE {{schema_select.selectedOptionValue}}.{{List1.selectedItem.tablename}};",
|
|
||||||
{
|
|
||||||
force: true,
|
|
||||||
parseSpecialCharSequences: false,
|
|
||||||
},
|
|
||||||
);
|
);
|
||||||
cy.WaitAutoSave();
|
_.dataSources.RunQuery();
|
||||||
cy.runQuery();
|
// clicking on chevron icon to go back to the _.dataSources page
|
||||||
// clicking on chevron icon to go back to the datasources page
|
|
||||||
cy.get(appPage.dropdownChevronLeft).click();
|
cy.get(appPage.dropdownChevronLeft).click();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Add new table", function() {
|
it("3. Add new table", function() {
|
||||||
const uuid = () => Cypress._.random(0, 1e6);
|
|
||||||
const id = uuid();
|
|
||||||
const Table = `table${id}`;
|
|
||||||
// clicking on chevron to go back to the application page
|
// clicking on chevron to go back to the application page
|
||||||
cy.get(appPage.dropdownChevronLeft).click();
|
cy.get(appPage.dropdownChevronLeft).click();
|
||||||
// adding new table
|
// adding new table
|
||||||
cy.xpath(appPage.addNewtable).click();
|
cy.xpath(appPage.addNewtable).click({ force: true });
|
||||||
|
cy.wait(500);
|
||||||
|
cy.generateUUID().then((UUID) => {
|
||||||
cy.xpath(appPage.addTablename)
|
cy.xpath(appPage.addTablename)
|
||||||
.clear()
|
.clear()
|
||||||
.type(Table);
|
.type(`table${UUID}`);
|
||||||
|
});
|
||||||
// adding column to the table
|
// adding column to the table
|
||||||
cy.xpath(appPage.addColumn).click();
|
cy.xpath(appPage.addColumn).click({ force: true });
|
||||||
cy.xpath(appPage.columnNamefield).should("be.visible");
|
cy.xpath(appPage.columnNamefield).should("be.visible");
|
||||||
cy.xpath(appPage.datatypefield).should("be.visible");
|
cy.xpath(appPage.datatypefield).should("be.visible");
|
||||||
cy.xpath(appPage.addTablename).type("id");
|
cy.xpath(appPage.addTablename).type("id2");
|
||||||
cy.get(appPage.dropdownChevronDown)
|
cy.get(appPage.dropdownChevronDown)
|
||||||
.last()
|
.last()
|
||||||
.click();
|
.click();
|
||||||
|
|
@ -176,13 +158,16 @@ describe("PgAdmin Clone App", function() {
|
||||||
cy.get(widgetsPage.switchWidgetInactive)
|
cy.get(widgetsPage.switchWidgetInactive)
|
||||||
.last()
|
.last()
|
||||||
.click();
|
.click();
|
||||||
cy.xpath(appPage.submitButton).click();
|
|
||||||
cy.xpath(appPage.addColumn).should("be.visible");
|
|
||||||
cy.xpath(appPage.submitButton).click({ force: true });
|
cy.xpath(appPage.submitButton).click({ force: true });
|
||||||
cy.xpath(appPage.closeButton).click();
|
cy.xpath(appPage.addColumn).should("be.visible");
|
||||||
|
cy.wait(500);
|
||||||
|
cy.xpath(appPage.submitButton)
|
||||||
|
.first()
|
||||||
|
.click({ force: true });
|
||||||
|
cy.xpath(appPage.closeButton).click({ force: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
it("View and Delete table", function() {
|
it("4.View and Delete table", function() {
|
||||||
cy.xpath(appPage.addNewtable).should("be.visible");
|
cy.xpath(appPage.addNewtable).should("be.visible");
|
||||||
// viewing the table's columns by clicking on view button
|
// viewing the table's columns by clicking on view button
|
||||||
cy.xpath(appPage.viewButton)
|
cy.xpath(appPage.viewButton)
|
||||||
|
|
@ -192,7 +177,7 @@ describe("PgAdmin Clone App", function() {
|
||||||
cy.xpath(appPage.deleteButton)
|
cy.xpath(appPage.deleteButton)
|
||||||
.last()
|
.last()
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.xpath(appPage.confirmButton).click();
|
cy.xpath(appPage.confirmButton).click({ force: true });
|
||||||
cy.xpath(appPage.closeButton).click();
|
cy.xpath(appPage.closeButton).click({ force: true });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ describe("JSEditor tests", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("Testing promises with resetWidget, storeValue action and API call", () => {
|
it("Testing promises with resetWidget, storeValue action and API call", () => {
|
||||||
_.apiPage.CreateAndFillApi("https://mock-api.appsmith.com/users", "TC1api");
|
_.apiPage.CreateAndFillApi(_.agHelper.mockApiUrl, "TC1api");
|
||||||
_.apiPage.RunAPI();
|
_.apiPage.RunAPI();
|
||||||
_.jsEditor.CreateJSObject(
|
_.jsEditor.CreateJSObject(
|
||||||
`export default {
|
`export default {
|
||||||
|
|
|
||||||
|
|
@ -147,7 +147,7 @@ describe("Autocomplete tests", () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("5. Api data with array of object autocompletion test", () => {
|
it("5. Api data with array of object autocompletion test", () => {
|
||||||
ApiPage.CreateAndFillApi("https://mock-api.appsmith.com/users");
|
ApiPage.CreateAndFillApi(agHelper.mockApiUrl);
|
||||||
agHelper.Sleep(2000);
|
agHelper.Sleep(2000);
|
||||||
ApiPage.RunAPI();
|
ApiPage.RunAPI();
|
||||||
// Using same js object
|
// Using same js object
|
||||||
|
|
@ -155,10 +155,10 @@ describe("Autocomplete tests", () => {
|
||||||
agHelper.GetNClick(jsEditor._lineinJsEditor(5), 0, true);
|
agHelper.GetNClick(jsEditor._lineinJsEditor(5), 0, true);
|
||||||
agHelper.SelectNRemoveLineText(CommonLocators._codeMirrorTextArea);
|
agHelper.SelectNRemoveLineText(CommonLocators._codeMirrorTextArea);
|
||||||
//agHelper.GetNClick(jsEditor._lineinJsEditor(5));
|
//agHelper.GetNClick(jsEditor._lineinJsEditor(5));
|
||||||
agHelper.TypeText(CommonLocators._codeMirrorTextArea, "Api1.data.u");
|
agHelper.TypeText(CommonLocators._codeMirrorTextArea, "Api1.d");
|
||||||
agHelper.GetNAssertElementText(CommonLocators._hints, "users");
|
agHelper.GetNAssertElementText(CommonLocators._hints, "data");
|
||||||
agHelper.Sleep();
|
agHelper.Sleep();
|
||||||
agHelper.TypeText(CommonLocators._codeMirrorTextArea, "sers[0].e");
|
agHelper.TypeText(CommonLocators._codeMirrorTextArea, "ata[0].e");
|
||||||
agHelper.GetNAssertElementText(CommonLocators._hints, "email");
|
agHelper.GetNAssertElementText(CommonLocators._hints, "email");
|
||||||
agHelper.Sleep();
|
agHelper.Sleep();
|
||||||
agHelper.TypeText(CommonLocators._codeMirrorTextArea, "mail");
|
agHelper.TypeText(CommonLocators._codeMirrorTextArea, "mail");
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,8 @@ const locator = ObjectsRegistry.CommonLocators,
|
||||||
|
|
||||||
describe("Binding Expressions should not be truncated in Url and path extraction", function() {
|
describe("Binding Expressions should not be truncated in Url and path extraction", function() {
|
||||||
it("Bug 16377, When Api url has dynamic binding expressions, ensure the url and path derived is not corrupting Api execution", function() {
|
it("Bug 16377, When Api url has dynamic binding expressions, ensure the url and path derived is not corrupting Api execution", function() {
|
||||||
const apiUrl = `https://mock-api.appsmith.com/{{true ? 'users' : 'user'}}`;
|
//Since the specified expression always returns true - it will never run mock-apis - which actually doesn't exist
|
||||||
|
const apiUrl = `http://host.docker.internal:5001/v1/{{true ? 'mock-api' : 'mock-apis'}}?records=10`;
|
||||||
|
|
||||||
apiPage.CreateAndFillApi(apiUrl, "BindingExpressions");
|
apiPage.CreateAndFillApi(apiUrl, "BindingExpressions");
|
||||||
apiPage.RunAPI();
|
apiPage.RunAPI();
|
||||||
|
|
|
||||||
|
|
@ -17,20 +17,24 @@ describe("Datasource form related tests", function() {
|
||||||
dataSources.CreatePlugIn("PostgreSQL");
|
dataSources.CreatePlugIn("PostgreSQL");
|
||||||
agHelper.RenameWithInPane(dataSourceName, false);
|
agHelper.RenameWithInPane(dataSourceName, false);
|
||||||
dataSources.FillPostgresDSForm(false, "docker", "wrongPassword");
|
dataSources.FillPostgresDSForm(false, "docker", "wrongPassword");
|
||||||
dataSources.verifySchema(dataSourceName, "Failed to initialize pool");
|
dataSources.VerifySchema(dataSourceName, "Failed to initialize pool");
|
||||||
agHelper.GetNClick(dataSources._editButton);
|
agHelper.GetNClick(dataSources._editButton);
|
||||||
dataSources.updatePassword("docker");
|
dataSources.UpdatePassword("docker");
|
||||||
dataSources.verifySchema(dataSourceName, "public.", true);
|
dataSources.VerifySchema(dataSourceName, "public.", true);
|
||||||
|
agHelper.GetNClick(dataSources._createQuery)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("2. Verify if schema was fetched once #18448", () => {
|
it("2. Verify if schema was fetched once #18448", () => {
|
||||||
agHelper.RefreshPage();
|
agHelper.RefreshPage()
|
||||||
|
ee.ExpandCollapseEntity("Datasources");
|
||||||
|
ee.ExpandCollapseEntity(dataSourceName,false);
|
||||||
cy.intercept("GET", dataSources._getStructureReq).as("getDSStructure");
|
cy.intercept("GET", dataSources._getStructureReq).as("getDSStructure");
|
||||||
ee.ExpandCollapseEntity("Datasources");
|
ee.ExpandCollapseEntity("Datasources");
|
||||||
ee.ExpandCollapseEntity(dataSourceName);
|
ee.ExpandCollapseEntity(dataSourceName);
|
||||||
agHelper.Sleep(1500);
|
agHelper.Sleep(1500);
|
||||||
cy.verifyCallCount(`@getDatasourceStructure`, 1);
|
agHelper.VerifyCallCount(`@getDatasourceStructure`, 1);
|
||||||
|
dataSources.DeleteQuery("Query1");
|
||||||
dataSources.DeleteDatasouceFromWinthinDS(dataSourceName);
|
dataSources.DeleteDatasouceFromWinthinDS(dataSourceName);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ describe("Git Bugs", function() {
|
||||||
_.agHelper.AssertElementVisible(_.gitSync._branchButton);
|
_.agHelper.AssertElementVisible(_.gitSync._branchButton);
|
||||||
cy.get("@gitRepoName").then((repoName) => {
|
cy.get("@gitRepoName").then((repoName) => {
|
||||||
testName = repoName;
|
testName = repoName;
|
||||||
|
cy.log("testName is :"+ testName)
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -54,6 +55,6 @@ describe("Git Bugs", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
after(() => {
|
after(() => {
|
||||||
//_.gitSync.DeleteTestGithubRepo(testName);
|
_.gitSync.DeleteTestGithubRepo(testName);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ const widgetsToTest = {
|
||||||
};
|
};
|
||||||
|
|
||||||
function configureApi() {
|
function configureApi() {
|
||||||
apiPage.CreateAndFillApi("https://mock-api.appsmith.com/users", "FirstAPI");
|
apiPage.CreateAndFillApi(agHelper.mockApiUrl, "FirstAPI");
|
||||||
apiPage.EnterHeader("value", "{{this.params.value}}");
|
apiPage.EnterHeader("value", "{{this.params.value}}");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,15 @@ describe("Entity explorer context menu should hide on scrolling", function() {
|
||||||
dataSources.CreateQuery(mockDBNameMovies);
|
dataSources.CreateQuery(mockDBNameMovies);
|
||||||
});
|
});
|
||||||
cy.get('@usersDB').then((dbName : any)=> {
|
cy.get('@usersDB').then((dbName : any)=> {
|
||||||
|
agHelper.Sleep();//time for mock schema to load
|
||||||
ee.ExpandCollapseEntity(dbName);
|
ee.ExpandCollapseEntity(dbName);
|
||||||
})
|
})
|
||||||
cy.get('@moviesDB').then((dbName: any)=> {
|
cy.get('@moviesDB').then((dbName: any)=> {
|
||||||
|
agHelper.Sleep();//time for mock schema to load
|
||||||
ee.ExpandCollapseEntity(dbName);
|
ee.ExpandCollapseEntity(dbName);
|
||||||
})
|
})
|
||||||
ee.ExpandCollapseEntity("public.users");
|
ee.ExpandCollapseEntity("public.users");
|
||||||
|
ee.ExpandCollapseEntity("movies")
|
||||||
agHelper.GetNClick(locator._createNew);
|
agHelper.GetNClick(locator._createNew);
|
||||||
agHelper.AssertElementVisible(ee._createNewPopup);
|
agHelper.AssertElementVisible(ee._createNewPopup);
|
||||||
agHelper.ScrollTo(ee._entityExplorerWrapper, "bottom");
|
agHelper.ScrollTo(ee._entityExplorerWrapper, "bottom");
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ const commonlocators = require("../../../../../locators/commonlocators.json");
|
||||||
const datasourceEditor = require("../../../../../locators/DatasourcesEditor.json");
|
const datasourceEditor = require("../../../../../locators/DatasourcesEditor.json");
|
||||||
import * as _ from "../../../../../support/Objects/ObjectsCore";
|
import * as _ from "../../../../../support/Objects/ObjectsCore";
|
||||||
const jsObject = "JSObject1";
|
const jsObject = "JSObject1";
|
||||||
const newBranch = "feat/temp";
|
let newBranch = "feat/temp";
|
||||||
const mainBranch = "master";
|
const mainBranch = "master";
|
||||||
let repoName, newWorkspaceName;
|
let repoName, newWorkspaceName;
|
||||||
|
|
||||||
|
|
@ -65,17 +65,13 @@ describe("Git import flow ", function() {
|
||||||
force: true,
|
force: true,
|
||||||
});
|
});
|
||||||
cy.wait(1000);
|
cy.wait(1000);
|
||||||
cy.generateUUID().then((uid) => {
|
|
||||||
repoName = uid;
|
_.gitSync.CreateNConnectToGit();
|
||||||
_.gitSync.CreateNConnectToGit(repoName);
|
|
||||||
cy.get("@gitRepoName").then((repName) => {
|
cy.get("@gitRepoName").then((repName) => {
|
||||||
repoName = repName;
|
repoName = repName;
|
||||||
_.gitSync.CreateGitBranch(repoName);
|
_.gitSync.CreateGitBranch(repoName);
|
||||||
});
|
});
|
||||||
|
|
||||||
// cy.createTestGithubRepo(repoName);
|
|
||||||
// cy.connectToGitRepo(repoName);
|
|
||||||
});
|
|
||||||
cy.wait(5000); // for git connection to settle!
|
cy.wait(5000); // for git connection to settle!
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -149,9 +145,15 @@ describe("Git import flow ", function() {
|
||||||
cy.xpath("//input[@value='Success']").should("be.visible");
|
cy.xpath("//input[@value='Success']").should("be.visible");
|
||||||
});
|
});
|
||||||
|
|
||||||
// skipping this due to open bug #18776
|
it("4. Create a new branch, clone page and validate data on that branch in view and edit mode", () => {
|
||||||
it.skip("4. Create a new branch, clone page and validate data on that branch in view and edit mode", () => {
|
//cy.createGitBranch(newBranch);
|
||||||
cy.createGitBranch(newBranch);
|
_.gitSync.CreateGitBranch(newBranch, true);
|
||||||
|
|
||||||
|
cy.get("@gitbranchName").then((branName) => {
|
||||||
|
newBranch = branName;
|
||||||
|
cy.log("newBranch is " + newBranch);
|
||||||
|
});
|
||||||
|
|
||||||
cy.get(".tbody")
|
cy.get(".tbody")
|
||||||
.first()
|
.first()
|
||||||
.should("contain.text", "Test user 7");
|
.should("contain.text", "Test user 7");
|
||||||
|
|
@ -188,6 +190,7 @@ describe("Git import flow ", function() {
|
||||||
// deploy the app and validate data binding
|
// deploy the app and validate data binding
|
||||||
cy.wait(2000);
|
cy.wait(2000);
|
||||||
cy.get(homePage.publishButton).click();
|
cy.get(homePage.publishButton).click();
|
||||||
|
_.agHelper.AssertElementExist(_.gitSync._bottomBarPull);
|
||||||
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
|
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
|
||||||
cy.get(gitSyncLocators.commitButton).click();
|
cy.get(gitSyncLocators.commitButton).click();
|
||||||
cy.intercept("POST", "api/v1/git/commit/app/*").as("commit");
|
cy.intercept("POST", "api/v1/git/commit/app/*").as("commit");
|
||||||
|
|
@ -220,8 +223,7 @@ describe("Git import flow ", function() {
|
||||||
cy.wait(2000);
|
cy.wait(2000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// skipping this due to open bug #18776
|
it("5. Switch to master and verify data in edit and view mode", () => {
|
||||||
it.skip("5. Switch to master and verify data in edit and view mode", () => {
|
|
||||||
cy.switchGitBranch("master");
|
cy.switchGitBranch("master");
|
||||||
cy.wait(2000);
|
cy.wait(2000);
|
||||||
// validate data binding in edit and deploy mode
|
// validate data binding in edit and deploy mode
|
||||||
|
|
@ -244,8 +246,7 @@ describe("Git import flow ", function() {
|
||||||
cy.wait(2000);
|
cy.wait(2000);
|
||||||
});
|
});
|
||||||
|
|
||||||
// skipping this due to open bug #18776
|
it("6. Add widget to master, merge then checkout to child branch and verify data", () => {
|
||||||
it.skip("6. Add widget to master, merge then checkout to child branch and verify data", () => {
|
|
||||||
_.canvasHelper.OpenWidgetPane();
|
_.canvasHelper.OpenWidgetPane();
|
||||||
cy.wait(2000); // wait for transition
|
cy.wait(2000); // wait for transition
|
||||||
cy.dragAndDropToCanvas("buttonwidget", { x: 300, y: 600 });
|
cy.dragAndDropToCanvas("buttonwidget", { x: 300, y: 600 });
|
||||||
|
|
@ -261,6 +262,6 @@ describe("Git import flow ", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
after(() => {
|
after(() => {
|
||||||
//cy.deleteTestGithubRepo(repoName);
|
_.gitSync.DeleteTestGithubRepo(repoName);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2,18 +2,18 @@ import gitSyncLocators from "../../../../../locators/gitSyncLocators";
|
||||||
import homePage from "../../../../../locators/HomePage";
|
import homePage from "../../../../../locators/HomePage";
|
||||||
import * as _ from "../../../../../support/Objects/ObjectsCore";
|
import * as _ from "../../../../../support/Objects/ObjectsCore";
|
||||||
|
|
||||||
let repoName: string;
|
let repoName;
|
||||||
describe("Git sync modal: deploy tab", function() {
|
describe("Git sync modal: deploy tab", function() {
|
||||||
before(() => {
|
before(() => {
|
||||||
_.homePage.NavigateToHome();
|
_.homePage.NavigateToHome();
|
||||||
cy.createWorkspace();
|
cy.createWorkspace();
|
||||||
//_.homePage.CreateNewWorkspace("DeployGitTest");
|
//_.homePage.CreateNewWorkspace("DeployGitTest");
|
||||||
cy.wait("@createWorkspace").then((interception: any) => {
|
cy.wait("@createWorkspace").then((interception) => {
|
||||||
const newWorkspaceName = interception.response.body.data.name;
|
const newWorkspaceName = interception.response.body.data.name;
|
||||||
cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName);
|
cy.CreateAppForWorkspace(newWorkspaceName, newWorkspaceName);
|
||||||
});
|
});
|
||||||
_.gitSync.CreateNConnectToGit("Test", false);
|
_.gitSync.CreateNConnectToGit("Test");
|
||||||
cy.get("@gitRepoName").then((repName: any) => {
|
cy.get("@gitRepoName").then((repName) => {
|
||||||
repoName = repName;
|
repoName = repName;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
@ -14,13 +14,11 @@ describe("Git disconnect modal:", function() {
|
||||||
cy.generateUUID().then((uid) => {
|
cy.generateUUID().then((uid) => {
|
||||||
repoName = uid;
|
repoName = uid;
|
||||||
_.gitSync.CreateTestGiteaRepo(repoName);
|
_.gitSync.CreateTestGiteaRepo(repoName);
|
||||||
//cy.createTestGithubRepo(repoName);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("1. should be opened with proper components", function() {
|
it("1. should be opened with proper components", function() {
|
||||||
_.gitSync.AuthorizeKeyToGitea(repoName, false);
|
_.gitSync.AuthorizeKeyToGitea(repoName);
|
||||||
//cy.connectToGitRepo(repoName, false);
|
|
||||||
cy.get(gitSyncLocators.bottomBarCommitButton).click();
|
cy.get(gitSyncLocators.bottomBarCommitButton).click();
|
||||||
cy.get("[data-cy=t--tab-GIT_CONNECTION]").click();
|
cy.get("[data-cy=t--tab-GIT_CONNECTION]").click();
|
||||||
// after clicked disconnect on connection modal,
|
// after clicked disconnect on connection modal,
|
||||||
|
|
@ -62,7 +60,6 @@ describe("Git disconnect modal:", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("2. should have disconnect repo button", function() {
|
it("2. should have disconnect repo button", function() {
|
||||||
cy.wait(4000);
|
|
||||||
cy.get(gitSyncLocators.bottomBarCommitButton).click();
|
cy.get(gitSyncLocators.bottomBarCommitButton).click();
|
||||||
cy.get("[data-cy=t--tab-GIT_CONNECTION]").click();
|
cy.get("[data-cy=t--tab-GIT_CONNECTION]").click();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,7 @@ describe("Git sync Bug #10773", function() {
|
||||||
);
|
);
|
||||||
// deploy the app and validate data binding
|
// deploy the app and validate data binding
|
||||||
cy.get(homePage.publishButton).click();
|
cy.get(homePage.publishButton).click();
|
||||||
|
_.agHelper.AssertElementExist(_.gitSync._bottomBarPull);
|
||||||
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
|
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
|
||||||
cy.get(gitSyncLocators.commitButton).click();
|
cy.get(gitSyncLocators.commitButton).click();
|
||||||
cy.wait(8000);
|
cy.wait(8000);
|
||||||
|
|
@ -166,7 +167,6 @@ describe("Git sync Bug #10773", function() {
|
||||||
201,
|
201,
|
||||||
);
|
);
|
||||||
_.gitSync.DeleteTestGithubRepo(repoName);
|
_.gitSync.DeleteTestGithubRepo(repoName);
|
||||||
//cy.deleteTestGithubRepo(repoName);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("4. Create an app with JSObject, connect it to git and verify its data in edit and deploy mode", function() {
|
it("4. Create an app with JSObject, connect it to git and verify its data in edit and deploy mode", function() {
|
||||||
|
|
@ -203,13 +203,10 @@ describe("Git sync Bug #10773", function() {
|
||||||
201,
|
201,
|
||||||
);
|
);
|
||||||
// connect app to git and deploy
|
// connect app to git and deploy
|
||||||
_.gitSync.CreateNConnectToGit(repoName);
|
_.gitSync.CreateNConnectToGit();
|
||||||
cy.get("@gitRepoName").then((repName) => {
|
cy.get("@gitRepoName").then((repName) => {
|
||||||
repoName = repName;
|
repoName = repName;
|
||||||
|
cy.wait(2000);
|
||||||
// cy.createTestGithubRepo(repoName);
|
|
||||||
// cy.connectToGitRepo(repoName);
|
|
||||||
cy.wait(3000);
|
|
||||||
|
|
||||||
cy.window()
|
cy.window()
|
||||||
.its("store")
|
.its("store")
|
||||||
|
|
@ -218,6 +215,7 @@ describe("Git sync Bug #10773", function() {
|
||||||
const commitInputDisabled =
|
const commitInputDisabled =
|
||||||
state.ui.gitSync.gitStatus?.isClean ||
|
state.ui.gitSync.gitStatus?.isClean ||
|
||||||
state.ui.gitSync.isCommitting;
|
state.ui.gitSync.isCommitting;
|
||||||
|
cy.log("commitInputDisabled is " + commitInputDisabled);
|
||||||
if (!commitInputDisabled) {
|
if (!commitInputDisabled) {
|
||||||
cy.commitAndPush();
|
cy.commitAndPush();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,10 +22,7 @@ describe("Git sync modal: merge tab", function() {
|
||||||
|
|
||||||
it("1. Verify the functionality of the default dropdown under merge tab", function() {
|
it("1. Verify the functionality of the default dropdown under merge tab", function() {
|
||||||
cy.get(commonLocators.canvas).click({ force: true });
|
cy.get(commonLocators.canvas).click({ force: true });
|
||||||
//cy.createGitBranch(childBranchKey);
|
|
||||||
|
|
||||||
_.gitSync.CreateGitBranch(childBranchKey);
|
_.gitSync.CreateGitBranch(childBranchKey);
|
||||||
|
|
||||||
cy.get(gitSyncLocators.bottomBarMergeButton).click();
|
cy.get(gitSyncLocators.bottomBarMergeButton).click();
|
||||||
cy.get(gitSyncLocators.gitSyncModal).should("exist");
|
cy.get(gitSyncLocators.gitSyncModal).should("exist");
|
||||||
cy.get("[data-cy=t--tab-MERGE]").should("exist");
|
cy.get("[data-cy=t--tab-MERGE]").should("exist");
|
||||||
|
|
@ -39,7 +36,9 @@ describe("Git sync modal: merge tab", function() {
|
||||||
cy.get(commonLocators.dropdownmenu)
|
cy.get(commonLocators.dropdownmenu)
|
||||||
.contains(mainBranch)
|
.contains(mainBranch)
|
||||||
.click();
|
.click();
|
||||||
cy.wait("@mergeStatus").should(
|
_.agHelper.AssertElementAbsence(_.gitSync._checkMergeability, 30000);
|
||||||
|
|
||||||
|
cy.wait("@mergeStatus", { timeout: 35000 }).should(
|
||||||
"have.nested.property",
|
"have.nested.property",
|
||||||
"response.body.data.isMergeAble",
|
"response.body.data.isMergeAble",
|
||||||
true,
|
true,
|
||||||
|
|
@ -51,6 +50,5 @@ describe("Git sync modal: merge tab", function() {
|
||||||
|
|
||||||
after(() => {
|
after(() => {
|
||||||
_.gitSync.DeleteTestGithubRepo(repoName);
|
_.gitSync.DeleteTestGithubRepo(repoName);
|
||||||
//cy.deleteTestGithubRepo(repoName);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ import gitSyncLocators from "../../../../../locators/gitSyncLocators";
|
||||||
import * as _ from "../../../../../support/Objects/ObjectsCore";
|
import * as _ from "../../../../../support/Objects/ObjectsCore";
|
||||||
|
|
||||||
let repoName1, repoName2, repoName3, repoName4, windowOpenSpy;
|
let repoName1, repoName2, repoName3, repoName4, windowOpenSpy;
|
||||||
describe.skip("Repo Limit Exceeded Error Modal", function() {
|
describe("Repo Limit Exceeded Error Modal", function() {
|
||||||
before(() => {
|
before(() => {
|
||||||
cy.generateUUID().then((uid) => {
|
cy.generateUUID().then((uid) => {
|
||||||
cy.Signup(`${uid}@appsmithtest.com`, uid);
|
cy.Signup(`${uid}@appsmithtest.com`, uid);
|
||||||
|
|
@ -12,23 +12,31 @@ describe.skip("Repo Limit Exceeded Error Modal", function() {
|
||||||
repoName2 = uuid.v4().split("-")[0];
|
repoName2 = uuid.v4().split("-")[0];
|
||||||
repoName3 = uuid.v4().split("-")[0];
|
repoName3 = uuid.v4().split("-")[0];
|
||||||
repoName4 = uuid.v4().split("-")[0];
|
repoName4 = uuid.v4().split("-")[0];
|
||||||
|
_.agHelper.ClickButton("Build on my own");
|
||||||
});
|
});
|
||||||
|
|
||||||
it("1. Modal should be opened with proper components", function() {
|
it("1. Modal should be opened with proper components", function() {
|
||||||
|
_.homePage.NavigateToHome();
|
||||||
_.homePage.CreateNewApplication();
|
_.homePage.CreateNewApplication();
|
||||||
_.gitSync.CreateNConnectToGit(repoName1, false, true);
|
_.gitSync.CreateNConnectToGit(repoName1, true, true);
|
||||||
cy.get("@gitRepoName").then((repName) => {
|
cy.get("@gitRepoName").then((repName) => {
|
||||||
repoName1 = repName;
|
repoName1 = repName;
|
||||||
});
|
});
|
||||||
_.gitSync.CreateNConnectToGit(repoName2, false, true);
|
_.homePage.NavigateToHome();
|
||||||
|
_.homePage.CreateNewApplication();
|
||||||
|
_.gitSync.CreateNConnectToGit(repoName2, true, true);
|
||||||
cy.get("@gitRepoName").then((repName) => {
|
cy.get("@gitRepoName").then((repName) => {
|
||||||
repoName2 = repName;
|
repoName2 = repName;
|
||||||
});
|
});
|
||||||
_.gitSync.CreateNConnectToGit(repoName3, false, true);
|
_.homePage.NavigateToHome();
|
||||||
|
_.homePage.CreateNewApplication();
|
||||||
|
_.gitSync.CreateNConnectToGit(repoName3, true, true);
|
||||||
cy.get("@gitRepoName").then((repName) => {
|
cy.get("@gitRepoName").then((repName) => {
|
||||||
repoName3 = repName;
|
repoName3 = repName;
|
||||||
});
|
});
|
||||||
_.gitSync.CreateNConnectToGit(repoName4, true, true);
|
_.homePage.NavigateToHome();
|
||||||
|
_.homePage.CreateNewApplication();
|
||||||
|
_.gitSync.CreateNConnectToGit(repoName4, false, true);
|
||||||
cy.get("@gitRepoName").then((repName) => {
|
cy.get("@gitRepoName").then((repName) => {
|
||||||
repoName4 = repName;
|
repoName4 = repName;
|
||||||
});
|
});
|
||||||
|
|
@ -77,6 +85,7 @@ describe.skip("Repo Limit Exceeded Error Modal", function() {
|
||||||
cy.get(gitSyncLocators.repoLimitExceededErrorModal).should("not.exist");
|
cy.get(gitSyncLocators.repoLimitExceededErrorModal).should("not.exist");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
after(() => {
|
after(() => {
|
||||||
cy.request({
|
cy.request({
|
||||||
method: "DELETE",
|
method: "DELETE",
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,13 @@ describe("Creating new app after discontinuing guided tour should not start the
|
||||||
.click()
|
.click()
|
||||||
.wait(2000);
|
.wait(2000);
|
||||||
datasources.CloseReconnectDataSourceModal();
|
datasources.CloseReconnectDataSourceModal();
|
||||||
|
cy.get("body").then(($ele) => {
|
||||||
|
if ($ele.find(guidedTourLocators.welcomeTour).length) {
|
||||||
|
cy.get(guidedTourLocators.welcomeTour)
|
||||||
|
.click()
|
||||||
|
.wait(2000);
|
||||||
|
}
|
||||||
|
});
|
||||||
cy.get(guidedTourLocators.startBuilding).should("be.visible");
|
cy.get(guidedTourLocators.startBuilding).should("be.visible");
|
||||||
// Go back to applications page
|
// Go back to applications page
|
||||||
cy.get(commonlocators.homeIcon).click({ force: true });
|
cy.get(commonlocators.homeIcon).click({ force: true });
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ const jsCode = `//TextWidget, InputWidget, QueryRefactor and RefactorAPI are use
|
||||||
return 10;`;
|
return 10;`;
|
||||||
const query =
|
const query =
|
||||||
"SELECT * FROM paintings ORDER BY id LIMIT {{JSObject1.myFun1()}};";
|
"SELECT * FROM paintings ORDER BY id LIMIT {{JSObject1.myFun1()}};";
|
||||||
const apiURL = "https://mock-api.appsmith.com/users";
|
const apiURL = _.agHelper.mockApiUrl;
|
||||||
const refactorInput = {
|
const refactorInput = {
|
||||||
api: { oldName: "RefactorAPI", newName: "RefactorAPIRenamed" },
|
api: { oldName: "RefactorAPI", newName: "RefactorAPIRenamed" },
|
||||||
query: { oldName: "QueryRefactor", newName: "QueryRefactorRenamed" },
|
query: { oldName: "QueryRefactor", newName: "QueryRefactorRenamed" },
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,12 @@
|
||||||
import template from "../../../../locators/TemplatesLocators.json";
|
import template from "../../../../locators/TemplatesLocators.json";
|
||||||
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
|
|
||||||
import gitSyncLocators from "../../../../locators/gitSyncLocators";
|
import gitSyncLocators from "../../../../locators/gitSyncLocators";
|
||||||
import widgetLocators from "../../../../locators/Widgets.json";
|
import widgetLocators from "../../../../locators/Widgets.json";
|
||||||
let repoName;
|
let repoName;
|
||||||
let appId;
|
let appId;
|
||||||
const branchName = "test/template";
|
let branchName = "test/template";
|
||||||
const mainBranch = "master";
|
const jsObject = "JSObject1";
|
||||||
const jsObject = "Utils";
|
|
||||||
const homePage = require("../../../../locators/HomePage");
|
const homePage = require("../../../../locators/HomePage");
|
||||||
|
import * as _ from "../../../../support/Objects/ObjectsCore";
|
||||||
let ee = ObjectsRegistry.EntityExplorer;
|
|
||||||
|
|
||||||
describe("Fork a template to the current app", () => {
|
describe("Fork a template to the current app", () => {
|
||||||
before(() => {
|
before(() => {
|
||||||
|
|
@ -19,35 +16,40 @@ describe("Fork a template to the current app", () => {
|
||||||
cy.CreateAppInFirstListedWorkspace(id);
|
cy.CreateAppInFirstListedWorkspace(id);
|
||||||
localStorage.setItem("AppName", appId);
|
localStorage.setItem("AppName", appId);
|
||||||
});
|
});
|
||||||
cy.generateUUID().then((uid) => {
|
_.gitSync.CreateNConnectToGit(repoName);
|
||||||
repoName = uid;
|
cy.get("@gitRepoName").then((repName) => {
|
||||||
|
repoName = repName;
|
||||||
cy.createTestGithubRepo(repoName);
|
|
||||||
cy.connectToGitRepo(repoName);
|
|
||||||
});
|
});
|
||||||
|
_.agHelper.Sleep(2000);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("1.Bug #17002 Forking a template into an existing app which is connected to git makes the application go into a bad state ", function() {
|
it("1.Bug #17002 Forking a template into an existing app which is connected to git makes the application go into a bad state ", function() {
|
||||||
cy.wait(5000);
|
|
||||||
cy.get(template.startFromTemplateCard).click();
|
cy.get(template.startFromTemplateCard).click();
|
||||||
cy.wait("@fetchTemplate").should(
|
cy.wait("@fetchTemplate", { timeout: 30000 }).should(
|
||||||
"have.nested.property",
|
"have.nested.property",
|
||||||
"response.body.responseMeta.status",
|
"response.body.responseMeta.status",
|
||||||
200,
|
200,
|
||||||
);
|
);
|
||||||
cy.wait(1000);
|
cy.wait(1000);
|
||||||
cy.get(template.templateDialogBox).should("be.visible");
|
cy.get(template.templateDialogBox).should("be.visible");
|
||||||
cy.xpath(
|
|
||||||
"//div[text()='Customer Support Dashboard']/following-sibling::div//button[contains(@class, 'fork-button')]//span[contains(@class, 't--left-icon')]",
|
|
||||||
)
|
|
||||||
.scrollIntoView()
|
|
||||||
.click();
|
|
||||||
cy.wait("@getTemplatePages").should(
|
cy.wait("@getTemplatePages").should(
|
||||||
"have.nested.property",
|
"have.nested.property",
|
||||||
"response.body.responseMeta.status",
|
"response.body.responseMeta.status",
|
||||||
200,
|
200,
|
||||||
);
|
);
|
||||||
cy.wait(6000);
|
cy.xpath(
|
||||||
|
"//div[text()='Meeting Scheduler']/following-sibling::div//button[contains(@class, 'fork-button')]//span[contains(@class, 't--left-icon')]",
|
||||||
|
)
|
||||||
|
.scrollIntoView()
|
||||||
|
.click();
|
||||||
|
cy.waitUntil(() => cy.xpath("//span[text()='Setting up the template']"), {
|
||||||
|
errorMsg: "Setting Templates did not finish even after 75 seconds",
|
||||||
|
timeout: 950000,
|
||||||
|
interval: 5000,
|
||||||
|
}).then(($ele) => {
|
||||||
|
cy.wrap($ele).should("have.length", 0);
|
||||||
|
});
|
||||||
|
cy.wait(10000);
|
||||||
cy.get("body").then(($ele) => {
|
cy.get("body").then(($ele) => {
|
||||||
if ($ele.find(widgetLocators.toastAction).length <= 0) {
|
if ($ele.find(widgetLocators.toastAction).length <= 0) {
|
||||||
if ($ele.find(template.templateViewForkButton).length > 0) {
|
if ($ele.find(template.templateViewForkButton).length > 0) {
|
||||||
|
|
@ -55,34 +57,34 @@ describe("Fork a template to the current app", () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
cy.get(widgetLocators.toastAction).should(
|
// cy.get(widgetLocators.toastAction, { timeout: 40000 }).should(
|
||||||
"contain",
|
// "contain",
|
||||||
"template added successfully",
|
// "template added successfully",
|
||||||
);
|
// );
|
||||||
cy.commitAndPush();
|
cy.commitAndPush();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("2. Bug #17262 On forking template to a child branch of git connected app is throwing Page not found error ", function() {
|
it("2. Bug #17262 On forking template to a child branch of git connected app is throwing Page not found error ", function() {
|
||||||
cy.createGitBranch(branchName);
|
_.gitSync.CreateGitBranch(branchName, true);
|
||||||
ee.AddNewPage();
|
cy.get("@gitbranchName").then((branName) => {
|
||||||
ee.AddNewPage("add-page-from-template");
|
branchName = branName;
|
||||||
|
_.ee.AddNewPage();
|
||||||
cy.wait(5000);
|
_.ee.AddNewPage("add-page-from-template");
|
||||||
cy.get(template.templateDialogBox).should("be.visible");
|
cy.get(template.templateDialogBox).should("be.visible");
|
||||||
cy.xpath("//div[text()='Customer Support Dashboard']").click();
|
cy.xpath("//div[text()='Slack Bot']").click();
|
||||||
|
cy.wait(10000); // for templates page to load fully
|
||||||
cy.xpath(template.selectAllPages)
|
// cy.xpath(template.selectAllPages)
|
||||||
.next()
|
// .next()
|
||||||
.click();
|
// .click();
|
||||||
cy.wait(1000);
|
// cy.wait(1000);
|
||||||
cy.xpath("//span[text()='SEARCH']")
|
// cy.xpath("//span[text()='SEARCH']")
|
||||||
.parent()
|
// .parent()
|
||||||
.next()
|
// .next()
|
||||||
.click();
|
// .click();
|
||||||
// [Bug]: On forking selected pages from a template, resource not found error is shown #17270
|
// [Bug]: On forking selected pages from a template, resource not found error is shown #17270
|
||||||
cy.get(template.templateViewForkButton).click();
|
cy.get(template.templateViewForkButton).click();
|
||||||
|
cy.wait(5000);
|
||||||
cy.wait(3000);
|
cy.get(widgetLocators.toastAction, { timeout: 40000 }).should(
|
||||||
cy.get(widgetLocators.toastAction).should(
|
|
||||||
"contain",
|
"contain",
|
||||||
"template added successfully",
|
"template added successfully",
|
||||||
);
|
);
|
||||||
|
|
@ -102,10 +104,16 @@ describe("Fork a template to the current app", () => {
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.wait(5000);
|
cy.wait(5000);
|
||||||
cy.switchGitBranch(branchName);
|
cy.switchGitBranch(branchName);
|
||||||
cy.get(homePage.publishButton).click();
|
cy.get(homePage.publishButton).click({ force: true });
|
||||||
|
_.agHelper.AssertElementExist(_.gitSync._bottomBarPull);
|
||||||
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
|
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
|
||||||
cy.get(gitSyncLocators.commitButton).click();
|
cy.get(gitSyncLocators.commitButton).click();
|
||||||
cy.wait(10000);
|
cy.wait(10000);
|
||||||
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
cy.get(gitSyncLocators.closeGitSyncModal).click();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
after(() => {
|
||||||
|
_.gitSync.DeleteTestGithubRepo(repoName);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,21 @@
|
||||||
import widgetLocators from "../../../../locators/Widgets.json";
|
import widgetLocators from "../../../../locators/Widgets.json";
|
||||||
import template from "../../../../locators/TemplatesLocators.json";
|
import template from "../../../../locators/TemplatesLocators.json";
|
||||||
const publish = require("../../../../locators/publishWidgetspage.json");
|
const publish = require("../../../../locators/publishWidgetspage.json");
|
||||||
|
import * as _ from "../../../../support/Objects/ObjectsCore"
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
// Closes template dialog if it is already open - useful for retry
|
||||||
|
cy.get("body").then(($ele) => {
|
||||||
|
if ($ele.find(template.templateDialogBox).length) {
|
||||||
|
cy.get(template.closeButton).click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
cy.CheckAndUnfoldEntityItem("Pages");
|
||||||
|
cy.get(`.t--entity-name:contains(Page1)`)
|
||||||
|
.trigger("mouseover")
|
||||||
|
.click({ force: true });
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
describe("Fork a template to the current app from new page popover", () => {
|
describe("Fork a template to the current app from new page popover", () => {
|
||||||
it("1. Fork template from page section", () => {
|
it("1. Fork template from page section", () => {
|
||||||
|
|
@ -21,6 +36,9 @@ describe("Fork a template to the current app from new page popover", () => {
|
||||||
200,
|
200,
|
||||||
);
|
);
|
||||||
cy.wait(6000);
|
cy.wait(6000);
|
||||||
|
_.agHelper.CheckForErrorToast(
|
||||||
|
"Internal server error while processing request",
|
||||||
|
);
|
||||||
cy.get("body").then(($ele) => {
|
cy.get("body").then(($ele) => {
|
||||||
if ($ele.find(widgetLocators.toastAction).length <= 0) {
|
if ($ele.find(widgetLocators.toastAction).length <= 0) {
|
||||||
if ($ele.find(template.templateViewForkButton).length > 0) {
|
if ($ele.find(template.templateViewForkButton).length > 0) {
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,38 @@
|
||||||
import widgetLocators from "../../../../locators/Widgets.json";
|
import widgetLocators from "../../../../locators/Widgets.json";
|
||||||
import template from "../../../../locators/TemplatesLocators.json";
|
import template from "../../../../locators/TemplatesLocators.json";
|
||||||
const publish = require("../../../../locators/publishWidgetspage.json");
|
const publish = require("../../../../locators/publishWidgetspage.json");
|
||||||
import { ObjectsRegistry } from "../../../../support/Objects/Registry";
|
import * as _ from "../../../../support/Objects/ObjectsCore";
|
||||||
|
|
||||||
let agHelper = ObjectsRegistry.AggregateHelper;
|
let appId, newWorkspaceName;
|
||||||
|
|
||||||
describe("Fork a template to the current app", () => {
|
describe("Fork a template to the current app", () => {
|
||||||
afterEach(() => {
|
afterEach(() => {
|
||||||
agHelper.SaveLocalStorageCache();
|
_.agHelper.SaveLocalStorageCache();
|
||||||
});
|
});
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
agHelper.RestoreLocalStorageCache();
|
_.agHelper.RestoreLocalStorageCache();
|
||||||
|
// Closes template dialog if it is already open - useful for retry
|
||||||
|
cy.get("body").then(($ele) => {
|
||||||
|
if ($ele.find(template.templateDialogBox).length) {
|
||||||
|
cy.get(template.closeButton).click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
cy.CheckAndUnfoldEntityItem("Pages");
|
||||||
|
cy.get(`.t--entity-name:contains(Page1)`)
|
||||||
|
.trigger("mouseover")
|
||||||
|
.click({ force: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
it("1. Fork a template to the current app", () => {
|
it("1. Fork a template to the current app", () => {
|
||||||
cy.wait(5000);
|
cy.wait(5000);
|
||||||
cy.get(template.startFromTemplateCard).click();
|
cy.get(template.startFromTemplateCard).click();
|
||||||
cy.wait("@fetchTemplate").should(
|
// Commented out below code as fetch template call is not going through when template dialog is closed
|
||||||
"have.nested.property",
|
// cy.wait("@fetchTemplate").should(
|
||||||
"response.body.responseMeta.status",
|
// "have.nested.property",
|
||||||
200,
|
// "response.body.responseMeta.status",
|
||||||
);
|
// 200,
|
||||||
|
// );
|
||||||
cy.wait(5000);
|
cy.wait(5000);
|
||||||
cy.get(template.templateDialogBox).should("be.visible");
|
cy.get(template.templateDialogBox).should("be.visible");
|
||||||
cy.xpath(
|
cy.xpath(
|
||||||
|
|
@ -29,6 +40,7 @@ describe("Fork a template to the current app", () => {
|
||||||
)
|
)
|
||||||
.scrollIntoView()
|
.scrollIntoView()
|
||||||
.click();
|
.click();
|
||||||
|
_.agHelper.CheckForErrorToast("INTERNAL_SERVER_ERROR");
|
||||||
cy.wait("@getTemplatePages").should(
|
cy.wait("@getTemplatePages").should(
|
||||||
"have.nested.property",
|
"have.nested.property",
|
||||||
"response.body.responseMeta.status",
|
"response.body.responseMeta.status",
|
||||||
|
|
@ -40,22 +52,6 @@ describe("Fork a template to the current app", () => {
|
||||||
if ($ele.find(template.templateViewForkButton).length > 0) {
|
if ($ele.find(template.templateViewForkButton).length > 0) {
|
||||||
cy.get(template.templateViewForkButton).click();
|
cy.get(template.templateViewForkButton).click();
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
cy.wrap($ele)
|
|
||||||
.invoke("text")
|
|
||||||
.then((text) => {
|
|
||||||
if (text.includes("Unexpected state.")) {
|
|
||||||
cy.reload();
|
|
||||||
cy.get(template.startFromTemplateCard).click();
|
|
||||||
cy.wait(5000);
|
|
||||||
cy.get(template.templateDialogBox).should("be.visible");
|
|
||||||
cy.xpath(
|
|
||||||
"//div[text()='Customer Support Dashboard']/following-sibling::div//button[contains(@class, 'fork-button')]//span[contains(@class, 't--left-icon')]",
|
|
||||||
)
|
|
||||||
.scrollIntoView()
|
|
||||||
.click();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
cy.get(widgetLocators.toastAction).should(
|
cy.get(widgetLocators.toastAction).should(
|
||||||
|
|
@ -80,14 +76,16 @@ describe("Fork a template to the current app", () => {
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.wait(1000);
|
cy.wait(1000);
|
||||||
cy.get(template.startFromTemplateCard).click();
|
cy.get(template.startFromTemplateCard).click();
|
||||||
cy.wait("@fetchTemplate").should(
|
// Commented out below code as fetch template call is not going through when template dialog is closed
|
||||||
"have.nested.property",
|
// cy.wait("@fetchTemplate").should(
|
||||||
"response.body.responseMeta.status",
|
// "have.nested.property",
|
||||||
200,
|
// "response.body.responseMeta.status",
|
||||||
);
|
// 200,
|
||||||
|
// );
|
||||||
cy.wait(5000);
|
cy.wait(5000);
|
||||||
cy.get(template.templateDialogBox).should("be.visible");
|
cy.get(template.templateDialogBox).should("be.visible");
|
||||||
cy.xpath("//div[text()='Customer Support Dashboard']").click();
|
cy.xpath("//div[text()='Customer Support Dashboard']").click();
|
||||||
|
_.agHelper.CheckForErrorToast("INTERNAL_SERVER_ERROR");
|
||||||
cy.wait("@getTemplatePages").should(
|
cy.wait("@getTemplatePages").should(
|
||||||
"have.nested.property",
|
"have.nested.property",
|
||||||
"response.body.responseMeta.status",
|
"response.body.responseMeta.status",
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,7 @@ describe("Fork a template to an workspace", () => {
|
||||||
cy.get(templateLocators.templateCard)
|
cy.get(templateLocators.templateCard)
|
||||||
.first()
|
.first()
|
||||||
.click();
|
.click();
|
||||||
|
AggregateHelper.CheckForErrorToast("INTERNAL_SERVER_ERROR");
|
||||||
cy.get(templateLocators.templateViewForkButton).click();
|
cy.get(templateLocators.templateViewForkButton).click();
|
||||||
cy.location().should((location) => {
|
cy.location().should((location) => {
|
||||||
expect(location.search).to.eq("?showForkTemplateModal=true");
|
expect(location.search).to.eq("?showForkTemplateModal=true");
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
const explorer = require("../../../../../locators/explorerlocators.json");
|
const explorer = require("../../../../../locators/explorerlocators.json");
|
||||||
const commonlocators = require("../../../../../locators/commonlocators.json");
|
const commonlocators = require("../../../../../locators/commonlocators.json");
|
||||||
const widgetsPage = require("../../../../../locators/Widgets.json");
|
const widgetsPage = require("../../../../../locators/Widgets.json");
|
||||||
|
import { agHelper } from "../../../../../support/Objects/ObjectsCore";
|
||||||
import { ObjectsRegistry } from "../../../../../support/Objects/Registry";
|
import { ObjectsRegistry } from "../../../../../support/Objects/Registry";
|
||||||
let ee = ObjectsRegistry.EntityExplorer,
|
let ee = ObjectsRegistry.EntityExplorer,
|
||||||
canvasHelper = ObjectsRegistry.CanvasHelper;
|
canvasHelper = ObjectsRegistry.CanvasHelper;
|
||||||
|
|
@ -38,7 +39,7 @@ describe("File picker widget v2", () => {
|
||||||
".t--property-control-text",
|
".t--property-control-text",
|
||||||
`{{FilePicker1.files[0].name}}`,
|
`{{FilePicker1.files[0].name}}`,
|
||||||
);
|
);
|
||||||
cy.createAndFillApi("https://mock-api.appsmith.com/users", "");
|
cy.createAndFillApi(agHelper.mockApiUrl, "");
|
||||||
cy.updateCodeInput(
|
cy.updateCodeInput(
|
||||||
"[class*='t--actionConfiguration']",
|
"[class*='t--actionConfiguration']",
|
||||||
"{{FilePicker1.files}}",
|
"{{FilePicker1.files}}",
|
||||||
|
|
|
||||||
|
|
@ -31,14 +31,14 @@ describe("Tab widget test", function() {
|
||||||
cy.get(Layoutpage.tabButton).click({ force: true });
|
cy.get(Layoutpage.tabButton).click({ force: true });
|
||||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||||
cy.tabVerify(1, "Day");
|
cy.tabVerify(1, "Day");
|
||||||
cy.get(Layoutpage.tabDelete)
|
cy.xpath(Layoutpage.deleteTab.replace("tabName", "Day")).click({
|
||||||
.eq(1)
|
force: true,
|
||||||
.click({ force: true });
|
});
|
||||||
cy.get(Layoutpage.tabWidget)
|
cy.get(Layoutpage.tabWidget)
|
||||||
.contains("Day")
|
.contains("Day")
|
||||||
.should("not.exist");
|
.should("not.exist");
|
||||||
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
// eslint-disable-next-line cypress/no-unnecessary-waiting
|
||||||
cy.wait(300);
|
cy.wait(500);
|
||||||
/**
|
/**
|
||||||
* @param{toggleButton Css} Assert to be checked
|
* @param{toggleButton Css} Assert to be checked
|
||||||
*/
|
*/
|
||||||
|
|
@ -46,7 +46,7 @@ describe("Tab widget test", function() {
|
||||||
cy.get(Layoutpage.tabContainer)
|
cy.get(Layoutpage.tabContainer)
|
||||||
.scrollIntoView({ easing: "linear" })
|
.scrollIntoView({ easing: "linear" })
|
||||||
.should("be.visible");
|
.should("be.visible");
|
||||||
cy.CheckForPageSaveError();
|
cy.assertPageSave();
|
||||||
cy.PublishtheApp();
|
cy.PublishtheApp();
|
||||||
});
|
});
|
||||||
it("2. Tab Widget Functionality To Select Tabs", function() {
|
it("2. Tab Widget Functionality To Select Tabs", function() {
|
||||||
|
|
@ -72,9 +72,9 @@ describe("Tab widget test", function() {
|
||||||
});
|
});
|
||||||
it("5. Tab Widget Functionality To Check tab invisiblity", function() {
|
it("5. Tab Widget Functionality To Check tab invisiblity", function() {
|
||||||
cy.openPropertyPane("tabswidget");
|
cy.openPropertyPane("tabswidget");
|
||||||
cy.get(Layoutpage.tabEdit)
|
cy.xpath(Layoutpage.tabEdit.replace("tabName", "Tab 1")).click({
|
||||||
.eq(1)
|
force: true,
|
||||||
.click({ force: true });
|
});
|
||||||
cy.get(Layoutpage.tabVisibility)
|
cy.get(Layoutpage.tabVisibility)
|
||||||
.first()
|
.first()
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
|
|
@ -89,9 +89,9 @@ describe("Tab widget test", function() {
|
||||||
});
|
});
|
||||||
it("6. Tab Widget Functionality To Check tab visibility", function() {
|
it("6. Tab Widget Functionality To Check tab visibility", function() {
|
||||||
cy.openPropertyPane("tabswidget");
|
cy.openPropertyPane("tabswidget");
|
||||||
cy.get(Layoutpage.tabEdit)
|
cy.xpath(Layoutpage.tabEdit.replace("tabName", "Tab 1")).click({
|
||||||
.eq(1)
|
force: true,
|
||||||
.click({ force: true });
|
});
|
||||||
cy.get(Layoutpage.tabVisibility)
|
cy.get(Layoutpage.tabVisibility)
|
||||||
.first()
|
.first()
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ const apiwidget = require("../../../../locators/apiWidgetslocator.json");
|
||||||
const pages = require("../../../../locators/Pages.json");
|
const pages = require("../../../../locators/Pages.json");
|
||||||
const globalSearchLocators = require("../../../../locators/GlobalSearch.json");
|
const globalSearchLocators = require("../../../../locators/GlobalSearch.json");
|
||||||
import ApiEditor from "../../../../locators/ApiEditor";
|
import ApiEditor from "../../../../locators/ApiEditor";
|
||||||
|
import { agHelper } from "../../../../support/Objects/ObjectsCore";
|
||||||
|
|
||||||
describe("Test curl import flow", function() {
|
describe("Test curl import flow", function() {
|
||||||
it("Test curl import flow Run and Delete", function() {
|
it("Test curl import flow Run and Delete", function() {
|
||||||
|
|
@ -11,7 +12,7 @@ describe("Test curl import flow", function() {
|
||||||
.should("be.visible")
|
.should("be.visible")
|
||||||
.click({ force: true });
|
.click({ force: true });
|
||||||
cy.get(ApiEditor.curlImage).click({ force: true });
|
cy.get(ApiEditor.curlImage).click({ force: true });
|
||||||
cy.get("textarea").type("curl -X GET https://mock-api.appsmith.com/users");
|
cy.get("textarea").type("curl -X GET "+agHelper.mockApiUrl);
|
||||||
cy.importCurl();
|
cy.importCurl();
|
||||||
cy.get("@curlImport").then((response) => {
|
cy.get("@curlImport").then((response) => {
|
||||||
cy.expect(response.response.body.responseMeta.success).to.eq(true);
|
cy.expect(response.response.body.responseMeta.success).to.eq(true);
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ describe("Tests setTimeout API", function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
it("6. Access to args passed into success/error callback functions in API.run when using setTimeout", () => {
|
it("6. Access to args passed into success/error callback functions in API.run when using setTimeout", () => {
|
||||||
apiPage.CreateAndFillApi("https://mock-api.appsmith.com/users");//https://mock-api.appsmith.com/users?page=2&pageSize=10
|
apiPage.CreateAndFillApi(agHelper.mockApiUrl);
|
||||||
jsEditor.CreateJSObject(
|
jsEditor.CreateJSObject(
|
||||||
`export default {
|
`export default {
|
||||||
myVar1: [],
|
myVar1: [],
|
||||||
|
|
@ -154,7 +154,7 @@ describe("Tests setTimeout API", function() {
|
||||||
myFun1: (x) => {
|
myFun1: (x) => {
|
||||||
Api1.run((res) => {
|
Api1.run((res) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
showAlert(res.users[0].name);
|
showAlert(res[0].name);
|
||||||
}, 3000);
|
}, 3000);
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
console.log(error);
|
console.log(error);
|
||||||
|
|
@ -163,7 +163,7 @@ describe("Tests setTimeout API", function() {
|
||||||
myFun2: (x) => {
|
myFun2: (x) => {
|
||||||
Api1.run().then((res) => {
|
Api1.run().then((res) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
showAlert(res.users[0].name);
|
showAlert(res[0].name);
|
||||||
}, 3000);
|
}, 3000);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -182,7 +182,7 @@ describe("Tests setTimeout API", function() {
|
||||||
agHelper.Sleep(3000);
|
agHelper.Sleep(3000);
|
||||||
|
|
||||||
cy.wait("@postExecute").then((interception : any) => { //Js function to match any name returned from API
|
cy.wait("@postExecute").then((interception : any) => { //Js function to match any name returned from API
|
||||||
userName = JSON.stringify(interception.response.body.data.body.users[0].name).replace(/['"]+/g, '');//removing double quotes
|
userName = JSON.stringify(interception.response.body.data.body[0].name).replace(/['"]+/g, '');//removing double quotes
|
||||||
agHelper.AssertContains(userName);
|
agHelper.AssertContains(userName);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -191,20 +191,20 @@ describe("Tests setTimeout API", function() {
|
||||||
jsEditor.RunJSObj();
|
jsEditor.RunJSObj();
|
||||||
agHelper.Sleep(3000);
|
agHelper.Sleep(3000);
|
||||||
cy.wait("@postExecute").then((interception : any) => {
|
cy.wait("@postExecute").then((interception : any) => {
|
||||||
userName = JSON.stringify(interception.response.body.data.body.users[0].name).replace(/['"]+/g, '');
|
userName = JSON.stringify(interception.response.body.data.body[0].name).replace(/['"]+/g, '');
|
||||||
agHelper.AssertContains(userName);
|
agHelper.AssertContains(userName);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
it("7. Verifies whether setTimeout executes on page load", () => {
|
it("7. Verifies whether setTimeout executes on page load", () => {
|
||||||
//apiPage.CreateAndFillApi("https://mock-api.appsmith.com/users");
|
//apiPage.CreateAndFillApi(agHelper.mockApiUrl);
|
||||||
jsEditor.CreateJSObject(
|
jsEditor.CreateJSObject(
|
||||||
`export default {
|
`export default {
|
||||||
myVar1: [],
|
myVar1: [],
|
||||||
myVar2: {},
|
myVar2: {},
|
||||||
myFun1: (x) => {
|
myFun1: (x) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
Api1.run().then(() => showAlert("Success!"));
|
showAlert("Success!");
|
||||||
Timeouts.myFun2();
|
Timeouts.myFun2();
|
||||||
}, 3000)
|
}, 3000)
|
||||||
},
|
},
|
||||||
|
|
@ -219,11 +219,11 @@ describe("Tests setTimeout API", function() {
|
||||||
);
|
);
|
||||||
jsEditor.EnableDisableAsyncFuncSettings("myFun1", true, false);
|
jsEditor.EnableDisableAsyncFuncSettings("myFun1", true, false);
|
||||||
deployMode.DeployApp();
|
deployMode.DeployApp();
|
||||||
agHelper.Sleep(3000);
|
agHelper.Sleep(1000);//DeployApp already waiting 2000ms hence reducing it here to equate to 3000 timeout
|
||||||
agHelper.AssertContains("Success!");
|
agHelper.AssertContains("Success!");
|
||||||
agHelper.Sleep(3000);
|
agHelper.Sleep(1000);
|
||||||
cy.wait("@postExecute").then((interception : any) => {
|
cy.wait("@postExecute").then((interception : any) => {
|
||||||
userName = JSON.stringify(interception.response.body.data.body.users[0].name).replace(/['"]+/g, '');
|
userName = JSON.stringify(interception.response.body.data.body[0].name).replace(/['"]+/g, '');
|
||||||
agHelper.AssertContains(userName);
|
agHelper.AssertContains(userName);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ describe("JSObjects OnLoad Actions tests", function() {
|
||||||
|
|
||||||
it("1. Api mapping on page load", function() {
|
it("1. Api mapping on page load", function() {
|
||||||
apiPage.CreateAndFillApi(dataSet.baseUrl + dataSet.methods, "PageLoadApi");
|
apiPage.CreateAndFillApi(dataSet.baseUrl + dataSet.methods, "PageLoadApi");
|
||||||
|
agHelper.PressEscape();
|
||||||
ee.ExpandCollapseEntity("Container3");
|
ee.ExpandCollapseEntity("Container3");
|
||||||
ee.SelectEntityByName("Table1");
|
ee.SelectEntityByName("Table1");
|
||||||
propPane.UpdatePropertyFieldValue(
|
propPane.UpdatePropertyFieldValue(
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,6 @@ describe("Layout OnLoad Actions tests", function() {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//Skipping others tests due to RTS server changes
|
|
||||||
|
|
||||||
it("2. Bug 8595: OnPageLoad execution - when Query Parmas added via Params tab", function() {
|
it("2. Bug 8595: OnPageLoad execution - when Query Parmas added via Params tab", function() {
|
||||||
cy.fixture("onPageLoadActionsDsl").then((val: any) => {
|
cy.fixture("onPageLoadActionsDsl").then((val: any) => {
|
||||||
agHelper.AddDsl(val, locator._imageWidget);
|
agHelper.AddDsl(val, locator._imageWidget);
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,8 @@
|
||||||
"tabButton": ".t--property-control-tabs button",
|
"tabButton": ".t--property-control-tabs button",
|
||||||
"tabDelete": ".t--property-control-tabs .t--delete-column-btn",
|
"tabDelete": ".t--property-control-tabs .t--delete-column-btn",
|
||||||
"tabContainer": "div[type='TABS_WIDGET']",
|
"tabContainer": "div[type='TABS_WIDGET']",
|
||||||
"tabEdit": ".t--property-control-tabs .t--edit-column-btn",
|
"tabEdit": "//input[@value ='tabName']//parent::div//parent::div//following-sibling::div//div[contains(@class,'t--edit-column-btn')]",
|
||||||
"tabVisibility": ".t--property-control-visible .bp3-control-indicator",
|
"tabVisibility": ".t--property-control-visible .bp3-control-indicator",
|
||||||
"tabNumber": ".t--number-of-tabs"
|
"tabNumber": ".t--number-of-tabs",
|
||||||
|
"deleteTab":"//input[@value ='tabName']//parent::div//parent::div//following-sibling::div//div[contains(@class,'t--delete-column-btn')]"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@
|
||||||
"dropdownChevronLeft":".bp3-icon-chevron-left",
|
"dropdownChevronLeft":".bp3-icon-chevron-left",
|
||||||
"addNewtable":"//span[text()='New Table']",
|
"addNewtable":"//span[text()='New Table']",
|
||||||
"addTablename":"(//div[@class='bp3-input-group']//input)[2]",
|
"addTablename":"(//div[@class='bp3-input-group']//input)[2]",
|
||||||
"addColumn":"//span[text()='Add Column']",
|
"addColumn":"//span[text()='Add Column']/parent::button/parent::div",
|
||||||
"textField":"//span[text()='Text']",
|
"textField":"//span[text()='Text']",
|
||||||
"selectDatatype":"//div[text()='Varchar']",
|
"selectDatatype":"//div[text()='Varchar']",
|
||||||
"submitButton":"//span[text()='Submit']",
|
"submitButton":"//span[text()='Submit']",
|
||||||
"closeButton":"//span[text()='Close']",
|
"closeButton":"//span[text()='Close']",
|
||||||
"viewButton":"//span[text()='View']",
|
"viewButton":"//span[text()='View']",
|
||||||
"dropdownChevronDown":".t--draggable-selectwidget",
|
"dropdownChevronDown":".t--draggable-dropdownwidget",
|
||||||
"selectInformationSchema":"//div[text()='information_schema']",
|
"selectInformationSchema":"//div[text()='information_schema']",
|
||||||
"deleteButton":"//span[text()='Delete']",
|
"deleteButton":"//span[text()='Delete']",
|
||||||
"confirmButton":"//span[text()='Confirm']",
|
"confirmButton":"//span[text()='Confirm']",
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
"templateViewForkButton": "[data-cy='template-fork-button']",
|
"templateViewForkButton": "[data-cy='template-fork-button']",
|
||||||
"startFromTemplateCard": "[data-cy=start-from-template]",
|
"startFromTemplateCard": "[data-cy=start-from-template]",
|
||||||
"templateDialogBox": "[data-testid='t--dialog-component']",
|
"templateDialogBox": "[data-testid='t--dialog-component']",
|
||||||
"selectAllPages": "//span[text()='Select all']"
|
"selectAllPages": "//span[text()='Select all']",
|
||||||
|
"closeButton":"[name='close-x']"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -18,7 +18,7 @@ const DEFAULT_ENTERVALUE_OPTIONS = {
|
||||||
};
|
};
|
||||||
export class AggregateHelper {
|
export class AggregateHelper {
|
||||||
private locator = ObjectsRegistry.CommonLocators;
|
private locator = ObjectsRegistry.CommonLocators;
|
||||||
|
public mockApiUrl = "http://host.docker.internal:5001/v1/mock-api?records=10"
|
||||||
public isMac = Cypress.platform === "darwin";
|
public isMac = Cypress.platform === "darwin";
|
||||||
private selectLine = `${
|
private selectLine = `${
|
||||||
this.isMac ? "{cmd}{shift}{leftArrow}" : "{shift}{home}"
|
this.isMac ? "{cmd}{shift}{leftArrow}" : "{shift}{home}"
|
||||||
|
|
@ -504,6 +504,11 @@ export class AggregateHelper {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public VerifyCallCount(alias: string, expectedNumberOfCalls: number) {
|
||||||
|
cy.wait(alias);
|
||||||
|
cy.get(`${alias}.all`).should("have.length", expectedNumberOfCalls);
|
||||||
|
}
|
||||||
|
|
||||||
public GetNClick(
|
public GetNClick(
|
||||||
selector: string,
|
selector: string,
|
||||||
index = 0,
|
index = 0,
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ export class DataSources {
|
||||||
_templateMenu = ".t--template-menu";
|
_templateMenu = ".t--template-menu";
|
||||||
_templateMenuOption = (action: string) =>
|
_templateMenuOption = (action: string) =>
|
||||||
"//div[contains(@class, 't--template-menu')]//div[text()='" + action + "']";
|
"//div[contains(@class, 't--template-menu')]//div[text()='" + action + "']";
|
||||||
private _createQuery = ".t--create-query";
|
_createQuery = ".t--create-query";
|
||||||
_visibleTextSpan = (spanText: string) =>
|
_visibleTextSpan = (spanText: string) =>
|
||||||
"//span[contains(text(),'" + spanText + "')]";
|
"//span[contains(text(),'" + spanText + "')]";
|
||||||
_dropdownTitle = (ddTitle: string) =>
|
_dropdownTitle = (ddTitle: string) =>
|
||||||
|
|
@ -621,12 +621,13 @@ export class DataSources {
|
||||||
this.agHelper.AssertAutoSave();
|
this.agHelper.AssertAutoSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnterQuery(query: string) {
|
public EnterQuery(query: string, sleep= 500) {
|
||||||
cy.get(this.locator._codeEditorTarget).then(($field: any) => {
|
cy.get(this.locator._codeEditorTarget).then(($field: any) => {
|
||||||
this.agHelper.UpdateCodeInput($field, query);
|
this.agHelper.UpdateCodeInput($field, query);
|
||||||
});
|
});
|
||||||
this.agHelper.AssertAutoSave();
|
this.agHelper.AssertAutoSave();
|
||||||
this.agHelper.Sleep(500); //waiting a bit before proceeding!
|
this.agHelper.Sleep(sleep); //waiting a bit before proceeding!
|
||||||
|
cy.wait("@saveAction");
|
||||||
}
|
}
|
||||||
|
|
||||||
public RunQueryNVerifyResponseViews(
|
public RunQueryNVerifyResponseViews(
|
||||||
|
|
@ -778,13 +779,13 @@ export class DataSources {
|
||||||
}
|
}
|
||||||
|
|
||||||
//Update with new password in the datasource conf page
|
//Update with new password in the datasource conf page
|
||||||
public updatePassword(newPassword: string) {
|
public UpdatePassword(newPassword: string) {
|
||||||
this.ExpandSectionByName(this._sectionAuthentication);
|
this.ExpandSectionByName(this._sectionAuthentication);
|
||||||
cy.get(this._password).type(newPassword);
|
cy.get(this._password).type(newPassword);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Fetch schema from server and validate UI for the updates
|
//Fetch schema from server and validate UI for the updates
|
||||||
public verifySchema(
|
public VerifySchema(
|
||||||
dataSourceName: string,
|
dataSourceName: string,
|
||||||
schema: string,
|
schema: string,
|
||||||
isUpdate = false,
|
isUpdate = false,
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,7 @@ export class DeployMode {
|
||||||
cy.get(this.locator._backToEditor).click();
|
cy.get(this.locator._backToEditor).click();
|
||||||
this.agHelper.Sleep(2000);
|
this.agHelper.Sleep(2000);
|
||||||
localStorage.setItem("inDeployedMode", "false");
|
localStorage.setItem("inDeployedMode", "false");
|
||||||
|
this.agHelper.AssertElementVisible(this.locator._dropHere);//Assert if canvas is visible after Navigating back!
|
||||||
}
|
}
|
||||||
|
|
||||||
public EnterJSONInputValue(fieldName: string, value: string, index = 0) {
|
public EnterJSONInputValue(fieldName: string, value: string, index = 0) {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,11 @@ export class GitSync {
|
||||||
private _gitConfigEmailInput = ".t--git-config-email-input";
|
private _gitConfigEmailInput = ".t--git-config-email-input";
|
||||||
_branchButton = "[data-testid=t--branch-button-container]";
|
_branchButton = "[data-testid=t--branch-button-container]";
|
||||||
private _branchSearchInput = ".t--branch-search-input";
|
private _branchSearchInput = ".t--branch-search-input";
|
||||||
|
private _bottomBarCommit = ".t--bottom-bar-commit span[name='plus']";
|
||||||
|
_bottomBarPull = ".t--bottom-bar-pull span[name='down-arrow-2']";
|
||||||
|
private _branchName = (branch: string) =>
|
||||||
|
"//div[contains(@class, 't--branch-button')]//*[text()='" + branch + "']";
|
||||||
|
_checkMergeability = "//span[contains(text(), 'Checking mergeability')]";
|
||||||
|
|
||||||
OpenGitSyncModal() {
|
OpenGitSyncModal() {
|
||||||
this.agHelper.GetNClick(this._connectGitBottomBar);
|
this.agHelper.GetNClick(this._connectGitBottomBar);
|
||||||
|
|
@ -28,11 +33,15 @@ export class GitSync {
|
||||||
this.agHelper.AssertElementAbsence(this._gitSyncModal);
|
this.agHelper.AssertElementAbsence(this._gitSyncModal);
|
||||||
}
|
}
|
||||||
|
|
||||||
CreateNConnectToGit(repoName: string = "Test", assertConnect = true, privateFlag = false) {
|
CreateNConnectToGit(
|
||||||
|
repoName: string = "Test",
|
||||||
|
assertConnect = true,
|
||||||
|
privateFlag = false,
|
||||||
|
) {
|
||||||
this.agHelper.GenerateUUID();
|
this.agHelper.GenerateUUID();
|
||||||
cy.get("@guid").then((uid) => {
|
cy.get("@guid").then((uid) => {
|
||||||
repoName += uid;
|
repoName += uid;
|
||||||
this.CreateTestGiteaRepo(repoName);
|
this.CreateTestGiteaRepo(repoName, privateFlag);
|
||||||
//this.CreateLocalGithubRepo(repoName);
|
//this.CreateLocalGithubRepo(repoName);
|
||||||
this.AuthorizeKeyToGitea(repoName, assertConnect);
|
this.AuthorizeKeyToGitea(repoName, assertConnect);
|
||||||
// cy.get("@remoteUrl").then((remoteUrl: any) => {
|
// cy.get("@remoteUrl").then((remoteUrl: any) => {
|
||||||
|
|
@ -92,8 +101,9 @@ export class GitSync {
|
||||||
this.agHelper.ClickButton("CONNECT");
|
this.agHelper.ClickButton("CONNECT");
|
||||||
if (assertConnect) {
|
if (assertConnect) {
|
||||||
this.agHelper.ValidateNetworkStatus("@connectGitLocalRepo");
|
this.agHelper.ValidateNetworkStatus("@connectGitLocalRepo");
|
||||||
}
|
this.agHelper.AssertElementExist(this._bottomBarCommit);
|
||||||
this.CloseGitSyncModal();
|
this.CloseGitSyncModal();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -215,6 +225,7 @@ export class GitSync {
|
||||||
|
|
||||||
CreateGitBranch(branch: string = "Test", toUseNewGuid = false) {
|
CreateGitBranch(branch: string = "Test", toUseNewGuid = false) {
|
||||||
if (toUseNewGuid) this.agHelper.GenerateUUID();
|
if (toUseNewGuid) this.agHelper.GenerateUUID();
|
||||||
|
this.agHelper.AssertElementExist(this._bottomBarCommit);
|
||||||
this.agHelper.GetNClick(this._branchButton);
|
this.agHelper.GetNClick(this._branchButton);
|
||||||
this.agHelper.Sleep(2000); //branch pop up to open
|
this.agHelper.Sleep(2000); //branch pop up to open
|
||||||
cy.get("@guid").then((uid) => {
|
cy.get("@guid").then((uid) => {
|
||||||
|
|
@ -225,9 +236,10 @@ export class GitSync {
|
||||||
0,
|
0,
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
this.agHelper.AssertElementExist(this.locator._runBtnSpinner);
|
||||||
|
this.agHelper.AssertElementAbsence(this.locator._runBtnSpinner, 70000); //Since page taking more time to laod in some cases
|
||||||
|
this.agHelper.AssertElementVisible(this._branchName(branch + uid));
|
||||||
cy.wrap(branch + uid).as("gitbranchName");
|
cy.wrap(branch + uid).as("gitbranchName");
|
||||||
});
|
});
|
||||||
this.agHelper.AssertElementExist(this.locator._spinner);
|
|
||||||
this.agHelper.AssertElementAbsence(this.locator._spinner, 30000);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,10 +81,7 @@ export class JSEditor {
|
||||||
"')]//*[contains(text(),'" +
|
"')]//*[contains(text(),'" +
|
||||||
jsFuncName +
|
jsFuncName +
|
||||||
"')]";
|
"')]";
|
||||||
_dialogInDeployView =
|
_dialogInDeployView = "//div[@class='bp3-dialog-body']//*[contains(text(), '" + Cypress.env("MESSAGES").QUERY_CONFIRMATION_MODAL_MESSAGE() +"')]";
|
||||||
"//div[@class='bp3-dialog-body']//*[contains(text(), '" +
|
|
||||||
Cypress.env("MESSAGES").QUERY_CONFIRMATION_MODAL_MESSAGE() +
|
|
||||||
"')]";
|
|
||||||
_funcDropdown = ".t--formActionButtons div[role='listbox']";
|
_funcDropdown = ".t--formActionButtons div[role='listbox']";
|
||||||
_funcDropdownOptions = ".ads-dropdown-options-wrapper div > span div";
|
_funcDropdownOptions = ".ads-dropdown-options-wrapper div > span div";
|
||||||
_getJSFunctionSettingsId = (JSFunctionName: string) =>
|
_getJSFunctionSettingsId = (JSFunctionName: string) =>
|
||||||
|
|
|
||||||
|
|
@ -1181,7 +1181,7 @@ Cypress.Commands.add("CheckForPageSaveError", () => {
|
||||||
Cypress.Commands.add("assertPageSave", () => {
|
Cypress.Commands.add("assertPageSave", () => {
|
||||||
cy.CheckForPageSaveError();
|
cy.CheckForPageSaveError();
|
||||||
cy.get(commonlocators.saveStatusContainer).should("not.exist", {
|
cy.get(commonlocators.saveStatusContainer).should("not.exist", {
|
||||||
timeout: 40000,
|
timeout: 30000,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,10 @@ require("cy-verify-downloads").addCustomCommand();
|
||||||
require("cypress-file-upload");
|
require("cypress-file-upload");
|
||||||
import gitSyncLocators from "../locators/gitSyncLocators";
|
import gitSyncLocators from "../locators/gitSyncLocators";
|
||||||
import homePage from "../locators/HomePage";
|
import homePage from "../locators/HomePage";
|
||||||
|
import { ObjectsRegistry } from "../support/Objects/Registry";
|
||||||
|
|
||||||
|
let gitSync = ObjectsRegistry.GitSync,
|
||||||
|
agHelper = ObjectsRegistry.AggregateHelper;
|
||||||
|
|
||||||
const commonLocators = require("../locators/commonlocators.json");
|
const commonLocators = require("../locators/commonlocators.json");
|
||||||
const GITHUB_API_BASE = "https://api.github.com";
|
const GITHUB_API_BASE = "https://api.github.com";
|
||||||
|
|
@ -157,6 +161,7 @@ Cypress.Commands.add("createGitBranch", (branch) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
Cypress.Commands.add("switchGitBranch", (branch, expectError) => {
|
Cypress.Commands.add("switchGitBranch", (branch, expectError) => {
|
||||||
|
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||||
cy.get(gitSyncLocators.branchButton).click({ force: true });
|
cy.get(gitSyncLocators.branchButton).click({ force: true });
|
||||||
cy.get(gitSyncLocators.branchSearchInput).type(`{selectall}${branch}`);
|
cy.get(gitSyncLocators.branchSearchInput).type(`{selectall}${branch}`);
|
||||||
cy.wait(1000);
|
cy.wait(1000);
|
||||||
|
|
@ -233,18 +238,20 @@ Cypress.Commands.add(
|
||||||
|
|
||||||
Cypress.Commands.add("commitAndPush", (assertFailure) => {
|
Cypress.Commands.add("commitAndPush", (assertFailure) => {
|
||||||
cy.get(homePage.publishButton).click();
|
cy.get(homePage.publishButton).click();
|
||||||
|
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||||
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
|
cy.get(gitSyncLocators.commitCommentInput).type("Initial Commit");
|
||||||
cy.get(gitSyncLocators.commitButton).click();
|
cy.get(gitSyncLocators.commitButton).click();
|
||||||
if (!assertFailure) {
|
if (!assertFailure) {
|
||||||
// check for commit success
|
// check for commit success
|
||||||
cy.wait("@commit").should(
|
//adding timeout since commit is taking longer sometimes
|
||||||
|
cy.wait("@commit", { timeout: 35000 }).should(
|
||||||
"have.nested.property",
|
"have.nested.property",
|
||||||
"response.body.responseMeta.status",
|
"response.body.responseMeta.status",
|
||||||
201,
|
201,
|
||||||
);
|
);
|
||||||
cy.wait(3000);
|
cy.wait(3000);
|
||||||
} else {
|
} else {
|
||||||
cy.wait("@commit").then((interception) => {
|
cy.wait("@commit", { timeout: 35000 }).then((interception) => {
|
||||||
const status = interception.response.body.responseMeta.status;
|
const status = interception.response.body.responseMeta.status;
|
||||||
expect(status).to.be.gte(400);
|
expect(status).to.be.gte(400);
|
||||||
});
|
});
|
||||||
|
|
@ -285,6 +292,7 @@ Cypress.Commands.add(
|
||||||
);
|
);
|
||||||
|
|
||||||
Cypress.Commands.add("merge", (destinationBranch) => {
|
Cypress.Commands.add("merge", (destinationBranch) => {
|
||||||
|
agHelper.AssertElementExist(gitSync._bottomBarPull);
|
||||||
cy.get(gitSyncLocators.bottomBarMergeButton).click();
|
cy.get(gitSyncLocators.bottomBarMergeButton).click();
|
||||||
cy.wait(6000); // wait for git status call to finish
|
cy.wait(6000); // wait for git status call to finish
|
||||||
/*cy.wait("@gitStatus").should(
|
/*cy.wait("@gitStatus").should(
|
||||||
|
|
@ -292,11 +300,19 @@ Cypress.Commands.add("merge", (destinationBranch) => {
|
||||||
"response.body.responseMeta.status",
|
"response.body.responseMeta.status",
|
||||||
200,
|
200,
|
||||||
); */
|
); */
|
||||||
|
|
||||||
|
agHelper.AssertElementEnabledDisabled(
|
||||||
|
gitSyncLocators.mergeBranchDropdownDestination,
|
||||||
|
0,
|
||||||
|
false,
|
||||||
|
);
|
||||||
|
cy.wait(3000);
|
||||||
cy.get(gitSyncLocators.mergeBranchDropdownDestination).click();
|
cy.get(gitSyncLocators.mergeBranchDropdownDestination).click();
|
||||||
cy.get(commonLocators.dropdownmenu)
|
cy.get(commonLocators.dropdownmenu)
|
||||||
.contains(destinationBranch)
|
.contains(destinationBranch)
|
||||||
.click();
|
.click();
|
||||||
cy.wait("@mergeStatus").should(
|
agHelper.AssertElementAbsence(gitSync._checkMergeability, 30000);
|
||||||
|
cy.wait("@mergeStatus", { timeout: 35000 }).should(
|
||||||
"have.nested.property",
|
"have.nested.property",
|
||||||
"response.body.data.isMergeAble",
|
"response.body.data.isMergeAble",
|
||||||
true,
|
true,
|
||||||
|
|
@ -304,11 +320,11 @@ Cypress.Commands.add("merge", (destinationBranch) => {
|
||||||
cy.wait(2000);
|
cy.wait(2000);
|
||||||
cy.contains(Cypress.env("MESSAGES").NO_MERGE_CONFLICT());
|
cy.contains(Cypress.env("MESSAGES").NO_MERGE_CONFLICT());
|
||||||
cy.get(gitSyncLocators.mergeCTA).click();
|
cy.get(gitSyncLocators.mergeCTA).click();
|
||||||
cy.wait("@mergeBranch").should(
|
cy.wait("@mergeBranch", { timeout: 35000 }).should(
|
||||||
"have.nested.property",
|
"have.nested.property",
|
||||||
"response.body.responseMeta.status",
|
"response.body.responseMeta.status",
|
||||||
200,
|
200,
|
||||||
);
|
); //adding timeout since merge is taking longer sometimes
|
||||||
cy.contains(Cypress.env("MESSAGES").MERGED_SUCCESSFULLY());
|
cy.contains(Cypress.env("MESSAGES").MERGED_SUCCESSFULLY());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,9 +13,6 @@
|
||||||
"html": true,
|
"html": true,
|
||||||
"json": false
|
"json": false
|
||||||
},
|
},
|
||||||
"ignoreTestFiles": [
|
|
||||||
"**/Regression_TestSuite/Application/PgAdmin_spec*.js"
|
|
||||||
],
|
|
||||||
"chromeWebSecurity": false,
|
"chromeWebSecurity": false,
|
||||||
"viewportHeight": 1100,
|
"viewportHeight": 1100,
|
||||||
"viewportWidth": 1400,
|
"viewportWidth": 1400,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user