test:PartialExport_Widgets spec file updated and import app method updated with validations (#33343)
RCA: PartialExport_Widgets_spec.ts was failing where we export and compare files. Solution: - Updated the WidgetsExportedOnly.json, now the comparison step is working as expected - Improved the assertions within importApp() reduced wait time and waiting for import modal to close as a check. - Also updated tags which used importApp() below are the list of files [AppNavigation_spec.ts,Sidebar_spec.ts,TopStacked_spec.ts,TopInline_spec.ts,Editor_Segment_Context_Switching_spec.ts,JSOnLoad2_Spec.ts] - Reverted the intercept success check within ImportApp() - Updated PartialExport_Widgets_spec.ts with network call assertion post import /ok-to-test tags="@tag.Workspace,@tag.ImportExport"<!-- This is an auto-generated comment: Cypress test results --> > [!TIP] > 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉 > Workflow run: <https://github.com/appsmithorg/appsmith/actions/runs/9028944129> > Commit: b9ad3c9f7c9f6b52aa061f286b143b715b7d627a > Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=9028944129&attempt=1" target="_blank">Click here!</a> <!-- end of auto-generated comment: Cypress test results -->
This commit is contained in:
parent
9ade3d6bbb
commit
7135acae64
|
|
@ -6,6 +6,10 @@ import {
|
|||
dataSources,
|
||||
assertHelper,
|
||||
} from "../../../support/Objects/ObjectsCore";
|
||||
import {
|
||||
createMessage,
|
||||
IMPORT_APP_SUCCESSFUL,
|
||||
} from "../../../../src/ce/constants/messages";
|
||||
|
||||
describe(
|
||||
"Import, Export and Fork application and validate data binding",
|
||||
|
|
@ -36,7 +40,7 @@ describe(
|
|||
} else {
|
||||
cy.get(homePageLocatores.toastMessage).should(
|
||||
"contain",
|
||||
"Application imported successfully",
|
||||
createMessage(IMPORT_APP_SUCCESSFUL),
|
||||
);
|
||||
}
|
||||
agHelper.GenerateUUID();
|
||||
|
|
@ -132,7 +136,7 @@ describe(
|
|||
} else {
|
||||
cy.get(homePageLocatores.toastMessage).should(
|
||||
"contain",
|
||||
"Application imported successfully",
|
||||
createMessage(IMPORT_APP_SUCCESSFUL),
|
||||
);
|
||||
}
|
||||
const importedApp = interception.response.body.data.application;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ import PageList from "../../../../support/Pages/PageList";
|
|||
|
||||
describe(
|
||||
"General checks for app navigation",
|
||||
{ tags: ["@tag.IDE"] },
|
||||
{ tags: ["@tag.IDE", "@tag.ImportExport"] },
|
||||
function () {
|
||||
it("1. App header should appear when there is a single page in the application, and navigation should appear alongside app header when there are two pages", () => {
|
||||
// App header should appear when there is a single page in the application
|
||||
|
|
|
|||
|
|
@ -11,88 +11,98 @@ import {
|
|||
AppSidebarButton,
|
||||
} from "../../../../support/Pages/EditorNavigation";
|
||||
|
||||
describe("Test Sidebar navigation style", { tags: ["@tag.IDE"] }, function () {
|
||||
before(() => {
|
||||
// Import an application
|
||||
homePage.NavigateToHome();
|
||||
agHelper.RefreshPage();
|
||||
homePage.ImportApp("appNavigationTestingAppWithLongPageNamesAndTitle.json");
|
||||
assertHelper
|
||||
.WaitForNetworkCall("@importNewApplication")
|
||||
.then((response) => {
|
||||
const { isPartialImport } = response.body.data;
|
||||
if (isPartialImport) {
|
||||
homePage.AssertNCloseImport();
|
||||
} else {
|
||||
homePage.AssertImportToast();
|
||||
}
|
||||
});
|
||||
});
|
||||
describe(
|
||||
"Test Sidebar navigation style",
|
||||
{ tags: ["@tag.IDE", "@tag.ImportExport"] },
|
||||
function () {
|
||||
before(() => {
|
||||
// Import an application
|
||||
homePage.NavigateToHome();
|
||||
agHelper.RefreshPage();
|
||||
homePage.ImportApp(
|
||||
"appNavigationTestingAppWithLongPageNamesAndTitle.json",
|
||||
);
|
||||
assertHelper
|
||||
.WaitForNetworkCall("@importNewApplication")
|
||||
.then((response) => {
|
||||
const { isPartialImport } = response.body.data;
|
||||
if (isPartialImport) {
|
||||
homePage.AssertNCloseImport();
|
||||
} else {
|
||||
homePage.AssertImportToast();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
it("1. Change 'Orientation' to 'Side', sidebar should appear", () => {
|
||||
AppSidebar.navigate(AppSidebarButton.Settings);
|
||||
agHelper.GetNClick(appSettings.locators._navigationSettingsTab);
|
||||
agHelper.GetNClick(
|
||||
appSettings.locators._navigationSettings._orientationOptions._side,
|
||||
0,
|
||||
true,
|
||||
);
|
||||
deployMode.DeployApp();
|
||||
agHelper.AssertElementVisibility(appSettings.locators._sideNavbar);
|
||||
agHelper.AssertElementAbsence(appSettings.locators._topStacked);
|
||||
agHelper.AssertElementAbsence(appSettings.locators._topInline);
|
||||
//Page change should work
|
||||
const pageName = "Page5 - with long long name";
|
||||
agHelper.GetNClickByContains(
|
||||
appSettings.locators._navigationMenuItem,
|
||||
pageName,
|
||||
0,
|
||||
true,
|
||||
);
|
||||
agHelper.AssertElementVisibility(
|
||||
appSettings.locators._getActivePage(pageName),
|
||||
);
|
||||
});
|
||||
it("1. Change 'Orientation' to 'Side', sidebar should appear", () => {
|
||||
AppSidebar.navigate(AppSidebarButton.Settings);
|
||||
agHelper.GetNClick(appSettings.locators._navigationSettingsTab);
|
||||
agHelper.GetNClick(
|
||||
appSettings.locators._navigationSettings._orientationOptions._side,
|
||||
0,
|
||||
true,
|
||||
);
|
||||
deployMode.DeployApp();
|
||||
agHelper.AssertElementVisibility(appSettings.locators._sideNavbar);
|
||||
agHelper.AssertElementAbsence(appSettings.locators._topStacked);
|
||||
agHelper.AssertElementAbsence(appSettings.locators._topInline);
|
||||
//Page change should work
|
||||
const pageName = "Page5 - with long long name";
|
||||
agHelper.GetNClickByContains(
|
||||
appSettings.locators._navigationMenuItem,
|
||||
pageName,
|
||||
0,
|
||||
true,
|
||||
);
|
||||
agHelper.AssertElementVisibility(
|
||||
appSettings.locators._getActivePage(pageName),
|
||||
);
|
||||
});
|
||||
|
||||
it("2. Sidebar background should be default to white, and should change when background color is set to theme", () => {
|
||||
// The background of sidebar should be white since light color style is default
|
||||
agHelper.AssertCSS(
|
||||
appSettings.locators._sideNavbar,
|
||||
"background-color",
|
||||
"rgb(255, 255, 255)",
|
||||
0,
|
||||
);
|
||||
// Changing color style to theme should change navigation's background color
|
||||
deployMode.NavigateBacktoEditor();
|
||||
AppSidebar.navigate(AppSidebarButton.Settings);
|
||||
agHelper.GetNClick(appSettings.locators._navigationSettingsTab);
|
||||
agHelper.GetNClick(appSettings.locators._colorStyleOptions._theme, 0, true);
|
||||
deployMode.DeployApp();
|
||||
agHelper.AssertCSS(
|
||||
appSettings.locators._sideNavbar,
|
||||
"background-color",
|
||||
"rgb(85, 61, 233)",
|
||||
0,
|
||||
);
|
||||
//Application name, share button, edit button, and user dropdown should be available in the app sidebar
|
||||
agHelper.AssertElementVisibility(appSettings.locators._applicationName);
|
||||
agHelper.AssertElementVisibility(appSettings.locators._shareButton);
|
||||
agHelper.AssertElementVisibility(locators._backToEditor);
|
||||
agHelper.AssertElementVisibility(homePage._profileMenu);
|
||||
});
|
||||
it("2. Sidebar background should be default to white, and should change when background color is set to theme", () => {
|
||||
// The background of sidebar should be white since light color style is default
|
||||
agHelper.AssertCSS(
|
||||
appSettings.locators._sideNavbar,
|
||||
"background-color",
|
||||
"rgb(255, 255, 255)",
|
||||
0,
|
||||
);
|
||||
// Changing color style to theme should change navigation's background color
|
||||
deployMode.NavigateBacktoEditor();
|
||||
AppSidebar.navigate(AppSidebarButton.Settings);
|
||||
agHelper.GetNClick(appSettings.locators._navigationSettingsTab);
|
||||
agHelper.GetNClick(
|
||||
appSettings.locators._colorStyleOptions._theme,
|
||||
0,
|
||||
true,
|
||||
);
|
||||
deployMode.DeployApp();
|
||||
agHelper.AssertCSS(
|
||||
appSettings.locators._sideNavbar,
|
||||
"background-color",
|
||||
"rgb(85, 61, 233)",
|
||||
0,
|
||||
);
|
||||
//Application name, share button, edit button, and user dropdown should be available in the app sidebar
|
||||
agHelper.AssertElementVisibility(appSettings.locators._applicationName);
|
||||
agHelper.AssertElementVisibility(appSettings.locators._shareButton);
|
||||
agHelper.AssertElementVisibility(locators._backToEditor);
|
||||
agHelper.AssertElementVisibility(homePage._profileMenu);
|
||||
});
|
||||
|
||||
it("3. Share button should open the share modal, edit button should take us back to the editor, and clicking on user profile button should open up the dropdown menu", () => {
|
||||
// Share
|
||||
agHelper.GetNClick(
|
||||
`${appSettings.locators._sideNavbar} ${appSettings.locators._shareButton}`,
|
||||
);
|
||||
agHelper.WaitUntilEleAppear(appSettings.locators._modal);
|
||||
agHelper.AssertElementVisibility(appSettings.locators._modal);
|
||||
agHelper.GetNClick(appSettings.locators._modalClose, 0, true);
|
||||
// User profile dropdown
|
||||
agHelper.GetNClick(homePage._profileMenu);
|
||||
agHelper.AssertElementVisibility(
|
||||
appSettings.locators._userProfileDropdownMenu,
|
||||
);
|
||||
});
|
||||
});
|
||||
it("3. Share button should open the share modal, edit button should take us back to the editor, and clicking on user profile button should open up the dropdown menu", () => {
|
||||
// Share
|
||||
agHelper.GetNClick(
|
||||
`${appSettings.locators._sideNavbar} ${appSettings.locators._shareButton}`,
|
||||
);
|
||||
agHelper.WaitUntilEleAppear(appSettings.locators._modal);
|
||||
agHelper.AssertElementVisibility(appSettings.locators._modal);
|
||||
agHelper.GetNClick(appSettings.locators._modalClose, 0, true);
|
||||
// User profile dropdown
|
||||
agHelper.GetNClick(homePage._profileMenu);
|
||||
agHelper.AssertElementVisibility(
|
||||
appSettings.locators._userProfileDropdownMenu,
|
||||
);
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
|
||||
describe(
|
||||
"Test Top + Inline navigation style",
|
||||
{ tags: ["@tag.IDE"] },
|
||||
{ tags: ["@tag.IDE", "@tag.ImportExport"] },
|
||||
function () {
|
||||
before(() => {
|
||||
// Import an application
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import {
|
|||
|
||||
describe(
|
||||
"Test Top + Stacked navigation style",
|
||||
{ tags: ["@tag.IDE"] },
|
||||
{ tags: ["@tag.IDE", "@tag.ImportExport"] },
|
||||
function () {
|
||||
before(() => {
|
||||
// Import an application
|
||||
|
|
|
|||
|
|
@ -56,10 +56,6 @@ describe("Git import flow ", { tags: ["@tag.Git"] }, function () {
|
|||
cy.testDatasource(true);
|
||||
agHelper.GetNClick(dataSources._saveDs);
|
||||
cy.wait(2000);
|
||||
/*cy.get(homePageLocators.toastMessage).should(
|
||||
"contain",
|
||||
"Application imported successfully",
|
||||
); */
|
||||
cy.wait("@getWorkspace");
|
||||
cy.get(reconnectDatasourceModal.ImportSuccessModal).should("be.visible");
|
||||
cy.get(reconnectDatasourceModal.ImportSuccessModalCloseBtn).click({
|
||||
|
|
@ -113,10 +109,6 @@ describe("Git import flow ", { tags: ["@tag.Git"] }, function () {
|
|||
cy.get(reconnectDatasourceModal.ImportSuccessModalCloseBtn).click({
|
||||
force: true,
|
||||
});
|
||||
/* cy.get(homePageLocators.toastMessage).should(
|
||||
"contain",
|
||||
"Application imported successfully",
|
||||
); */
|
||||
cy.wait("@gitStatus").then((interception) => {
|
||||
cy.log(interception.response.body.data);
|
||||
cy.wait(1000);
|
||||
|
|
|
|||
|
|
@ -9,97 +9,105 @@ import EditorNavigation, {
|
|||
} from "../../../../support/Pages/EditorNavigation";
|
||||
import reconnectDatasourceModal from "../../../../locators/ReconnectLocators";
|
||||
|
||||
describe("Editor Segment Context Switch", { tags: ["@tag.IDE"] }, function () {
|
||||
before("Import the test application", () => {
|
||||
homePage.CreateNewWorkspace("IDETest", true);
|
||||
homePage.ImportApp("SampleAppIDETest.json", "IDETest");
|
||||
cy.wait("@importNewApplication").then((interception) => {
|
||||
agHelper.Sleep();
|
||||
const { isPartialImport } = interception.response?.body.data;
|
||||
cy.log("isPartialImport is", isPartialImport);
|
||||
if (isPartialImport) {
|
||||
// should reconnect modal
|
||||
cy.get("body").then(($ele) => {
|
||||
if ($ele.find(reconnectDatasourceModal.SkipToAppBtn))
|
||||
agHelper.GetNClick(reconnectDatasourceModal.SkipToAppBtn, 0, true);
|
||||
else agHelper.ClickButton("Got it");
|
||||
agHelper.Sleep(2000);
|
||||
});
|
||||
} else {
|
||||
homePage.AssertImportToast();
|
||||
}
|
||||
describe(
|
||||
"Editor Segment Context Switch",
|
||||
{ tags: ["@tag.IDE", "@tag.ImportExport"] },
|
||||
function () {
|
||||
before("Import the test application", () => {
|
||||
homePage.CreateNewWorkspace("IDETest", true);
|
||||
homePage.ImportApp("SampleAppIDETest.json", "IDETest");
|
||||
cy.wait("@importNewApplication").then((interception) => {
|
||||
agHelper.Sleep();
|
||||
const { isPartialImport } = interception.response?.body.data;
|
||||
cy.log("isPartialImport is", isPartialImport);
|
||||
if (isPartialImport) {
|
||||
// should reconnect modal
|
||||
cy.get("body").then(($ele) => {
|
||||
if ($ele.find(reconnectDatasourceModal.SkipToAppBtn))
|
||||
agHelper.GetNClick(
|
||||
reconnectDatasourceModal.SkipToAppBtn,
|
||||
0,
|
||||
true,
|
||||
);
|
||||
else agHelper.ClickButton("Got it");
|
||||
agHelper.Sleep(2000);
|
||||
});
|
||||
} else {
|
||||
homePage.AssertImportToast();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
it("will select an item when switched to it", () => {
|
||||
// Check JS item is selected
|
||||
PageLeftPane.switchSegment(PagePaneSegment.JS);
|
||||
PageLeftPane.selectedItem("not.exist");
|
||||
it("will select an item when switched to it", () => {
|
||||
// Check JS item is selected
|
||||
PageLeftPane.switchSegment(PagePaneSegment.JS);
|
||||
PageLeftPane.selectedItem("not.exist");
|
||||
|
||||
// Check Query item is selected
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Queries);
|
||||
PageLeftPane.selectedItem("not.exist");
|
||||
// Check Query item is selected
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Queries);
|
||||
PageLeftPane.selectedItem("not.exist");
|
||||
|
||||
// Check UI item is selected
|
||||
PageLeftPane.switchSegment(PagePaneSegment.UI);
|
||||
PageLeftPane.selectedItem().should("be.visible");
|
||||
});
|
||||
it("will select previously selected item when switched to it", () => {
|
||||
// Select a UI item
|
||||
EditorNavigation.SelectEntityByName(
|
||||
"txt_longitudeValue",
|
||||
EntityType.Widget,
|
||||
{},
|
||||
["con_userDetails"],
|
||||
);
|
||||
// Check UI item is selected
|
||||
PageLeftPane.switchSegment(PagePaneSegment.UI);
|
||||
PageLeftPane.selectedItem().should("be.visible");
|
||||
});
|
||||
it("will select previously selected item when switched to it", () => {
|
||||
// Select a UI item
|
||||
EditorNavigation.SelectEntityByName(
|
||||
"txt_longitudeValue",
|
||||
EntityType.Widget,
|
||||
{},
|
||||
["con_userDetails"],
|
||||
);
|
||||
|
||||
// Select a JS item
|
||||
EditorNavigation.SelectEntityByName("Transformers", EntityType.JSObject);
|
||||
// Select a JS item
|
||||
EditorNavigation.SelectEntityByName("Transformers", EntityType.JSObject);
|
||||
|
||||
// Select a Query item
|
||||
EditorNavigation.SelectEntityByName("addUser", EntityType.Query);
|
||||
// Select a Query item
|
||||
EditorNavigation.SelectEntityByName("addUser", EntityType.Query);
|
||||
|
||||
// Check UI item is selected
|
||||
PageLeftPane.switchSegment(PagePaneSegment.UI);
|
||||
PageLeftPane.selectedItem().contains("txt_longitudeValue");
|
||||
// Check UI item is selected
|
||||
PageLeftPane.switchSegment(PagePaneSegment.UI);
|
||||
PageLeftPane.selectedItem().contains("txt_longitudeValue");
|
||||
|
||||
// Check JS item is selected
|
||||
PageLeftPane.switchSegment(PagePaneSegment.JS);
|
||||
PageLeftPane.selectedItem().contains("Transformers");
|
||||
// Check JS item is selected
|
||||
PageLeftPane.switchSegment(PagePaneSegment.JS);
|
||||
PageLeftPane.selectedItem().contains("Transformers");
|
||||
|
||||
// Check Query item is selected
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Queries);
|
||||
PageLeftPane.selectedItem().contains("addUser");
|
||||
});
|
||||
it("will not retain the add state of the segment", () => {
|
||||
// Switch to add new in UI
|
||||
PageLeftPane.switchSegment(PagePaneSegment.UI);
|
||||
PageLeftPane.switchToAddNew();
|
||||
// Check Query item is selected
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Queries);
|
||||
PageLeftPane.selectedItem().contains("addUser");
|
||||
});
|
||||
it("will not retain the add state of the segment", () => {
|
||||
// Switch to add new in UI
|
||||
PageLeftPane.switchSegment(PagePaneSegment.UI);
|
||||
PageLeftPane.switchToAddNew();
|
||||
|
||||
// Switch to add new in Query
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Queries);
|
||||
PageLeftPane.switchToAddNew();
|
||||
// Switch to add new in Query
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Queries);
|
||||
PageLeftPane.switchToAddNew();
|
||||
|
||||
// Assert add state not in UI
|
||||
PageLeftPane.switchSegment(PagePaneSegment.UI);
|
||||
// Assumes that selected item is not visible when in add state
|
||||
PageLeftPane.selectedItem().should("be.visible");
|
||||
// Assert add state not in UI
|
||||
PageLeftPane.switchSegment(PagePaneSegment.UI);
|
||||
// Assumes that selected item is not visible when in add state
|
||||
PageLeftPane.selectedItem().should("be.visible");
|
||||
|
||||
// Assert add state not in Query
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Queries);
|
||||
// Assumes that selected item is not visible when in add state
|
||||
PageLeftPane.selectedItem().should("be.visible");
|
||||
});
|
||||
// Assert add state not in Query
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Queries);
|
||||
// Assumes that selected item is not visible when in add state
|
||||
PageLeftPane.selectedItem().should("be.visible");
|
||||
});
|
||||
|
||||
it("will retain segment and selected item on switching IDE state", () => {
|
||||
// Switch to add new in Query
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Queries);
|
||||
// Select a Query item
|
||||
EditorNavigation.SelectEntityByName("updateUsers", EntityType.Query);
|
||||
// Switch to Data state
|
||||
AppSidebar.navigate(AppSidebarButton.Data);
|
||||
it("will retain segment and selected item on switching IDE state", () => {
|
||||
// Switch to add new in Query
|
||||
PageLeftPane.switchSegment(PagePaneSegment.Queries);
|
||||
// Select a Query item
|
||||
EditorNavigation.SelectEntityByName("updateUsers", EntityType.Query);
|
||||
// Switch to Data state
|
||||
AppSidebar.navigate(AppSidebarButton.Data);
|
||||
|
||||
// Switch back to Editor state
|
||||
AppSidebar.navigate(AppSidebarButton.Editor);
|
||||
PageLeftPane.selectedItem().contains("updateUsers");
|
||||
});
|
||||
});
|
||||
// Switch back to Editor state
|
||||
AppSidebar.navigate(AppSidebarButton.Editor);
|
||||
PageLeftPane.selectedItem().contains("updateUsers");
|
||||
});
|
||||
},
|
||||
);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import { featureFlagIntercept } from "../../../../support/Objects/FeatureFlags";
|
|||
import {
|
||||
homePage,
|
||||
partialImportExport,
|
||||
assertHelper,
|
||||
} from "../../../../support/Objects/ObjectsCore";
|
||||
|
||||
const fixtureName = "PartialImportExportSampleApp.json";
|
||||
|
|
@ -12,6 +13,7 @@ describe(
|
|||
() => {
|
||||
before(() => {
|
||||
homePage.ImportApp(`PartialImportExport/${fixtureName}`);
|
||||
assertHelper.AssertNetworkStatus("@importNewApplication");
|
||||
featureFlagIntercept({
|
||||
release_show_partial_import_export_enabled: true,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -10,6 +10,10 @@ import {
|
|||
agHelper,
|
||||
homePage as homePageHelpers,
|
||||
} from "../../../../support/Objects/ObjectsCore";
|
||||
import {
|
||||
createMessage,
|
||||
IMPORT_APP_SUCCESSFUL,
|
||||
} from "../../../../../src/ce/constants/messages";
|
||||
|
||||
describe("Migration Validate", { tags: ["@tag.ImportExport"] }, function () {
|
||||
it("1. Import application and Validate Migration on pageload", function () {
|
||||
|
|
@ -28,7 +32,7 @@ describe("Migration Validate", { tags: ["@tag.ImportExport"] }, function () {
|
|||
cy.wait("@importNewApplication").then(() => {
|
||||
cy.get(homePage.toastMessage).should(
|
||||
"contain",
|
||||
"Application imported successfully",
|
||||
createMessage(IMPORT_APP_SUCCESSFUL),
|
||||
);
|
||||
|
||||
//Renaming imported app!
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ import EditorNavigation, {
|
|||
|
||||
describe(
|
||||
"JSObjects OnLoad Actions tests",
|
||||
{ tags: ["@tag.PropertyPane", "@tag.JS"] },
|
||||
{ tags: ["@tag.PropertyPane", "@tag.JS", "@tag.ImportExport"] },
|
||||
function () {
|
||||
before(() => {
|
||||
homePage.CreateNewWorkspace("JSOnLoadTest", true);
|
||||
|
|
|
|||
|
|
@ -4,6 +4,10 @@ import {
|
|||
dataSources,
|
||||
agHelper,
|
||||
} from "../../../support/Objects/ObjectsCore";
|
||||
import {
|
||||
createMessage,
|
||||
IMPORT_APP_SUCCESSFUL,
|
||||
} from "../../../../src/ce/constants/messages";
|
||||
|
||||
describe(
|
||||
"Reconnect Datasource Modal validation while importing application",
|
||||
|
|
@ -48,7 +52,7 @@ describe(
|
|||
} else {
|
||||
cy.get(homePageLocators.toastMessage).should(
|
||||
"contain",
|
||||
"Application imported successfully",
|
||||
createMessage(IMPORT_APP_SUCCESSFUL),
|
||||
);
|
||||
}
|
||||
// check datasource configured success modal
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -1,7 +1,10 @@
|
|||
import { ObjectsRegistry } from "../Objects/Registry";
|
||||
const GITHUB_API_BASE = "https://api.github.com";
|
||||
//const GITEA_API_BASE = "http://35.154.225.218";
|
||||
|
||||
import {
|
||||
createMessage,
|
||||
UNABLE_TO_IMPORT_APP,
|
||||
} from "../../../src/ce/constants/messages";
|
||||
export class GitSync {
|
||||
public agHelper = ObjectsRegistry.AggregateHelper;
|
||||
public locator = ObjectsRegistry.CommonLocators;
|
||||
|
|
@ -321,9 +324,7 @@ export class GitSync {
|
|||
assertCreateBranch &&
|
||||
this.assertHelper.AssertNetworkStatus("createBranch", 201);
|
||||
this.agHelper.AssertElementAbsence(
|
||||
this.locator._specificToast(
|
||||
"Unable to import application in workspace",
|
||||
),
|
||||
this.locator._specificToast(createMessage(UNABLE_TO_IMPORT_APP)),
|
||||
);
|
||||
this.agHelper.WaitUntilEleAppear(this._branchName(branch + uid));
|
||||
this.agHelper.AssertElementVisibility(this._branchName(branch + uid));
|
||||
|
|
|
|||
|
|
@ -3,6 +3,11 @@ import HomePageLocators from "../../locators/HomePage";
|
|||
import SignupPageLocators from "../../locators/SignupPage.json";
|
||||
import { ObjectsRegistry } from "../Objects/Registry";
|
||||
import { AppSidebar, PageLeftPane } from "./EditorNavigation";
|
||||
import {
|
||||
createMessage,
|
||||
IMPORT_APP_SUCCESSFUL,
|
||||
UNABLE_TO_IMPORT_APP,
|
||||
} from "../../../src/ce/constants/messages";
|
||||
export class HomePage {
|
||||
private agHelper = ObjectsRegistry.AggregateHelper;
|
||||
private locator = ObjectsRegistry.CommonLocators;
|
||||
|
|
@ -637,9 +642,11 @@ export class HomePage {
|
|||
cy.xpath(this._uploadFile).selectFile("cypress/fixtures/" + fixtureJson, {
|
||||
force: true,
|
||||
});
|
||||
this.agHelper.Sleep(3500);
|
||||
this.agHelper.WaitUntilEleDisappear(
|
||||
HomePageLocators.workspaceImportAppModal,
|
||||
);
|
||||
this.agHelper.AssertElementAbsence(
|
||||
this.locator._specificToast("Unable to import application in workspace"),
|
||||
this.locator._specificToast(createMessage(UNABLE_TO_IMPORT_APP)),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -731,7 +738,7 @@ export class HomePage {
|
|||
}
|
||||
|
||||
public AssertImportToast(timeout = 5000) {
|
||||
this.agHelper.AssertContains("Application imported successfully");
|
||||
this.agHelper.AssertContains(createMessage(IMPORT_APP_SUCCESSFUL));
|
||||
this.agHelper.Sleep(timeout); //for imported app to settle!
|
||||
cy.get(this.locator._loading).should("not.exist");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,10 @@ require("cypress-file-upload");
|
|||
import gitSyncLocators from "../locators/gitSyncLocators";
|
||||
import homePage from "../locators/HomePage";
|
||||
import { ObjectsRegistry } from "./Objects/Registry";
|
||||
|
||||
import {
|
||||
createMessage,
|
||||
UNABLE_TO_IMPORT_APP,
|
||||
} from "../../src/ce/constants/messages";
|
||||
const gitSync = ObjectsRegistry.GitSync;
|
||||
const agHelper = ObjectsRegistry.AggregateHelper;
|
||||
const dataManager = ObjectsRegistry.DataManager;
|
||||
|
|
@ -231,10 +234,7 @@ Cypress.Commands.add("gitDiscardChanges", () => {
|
|||
cy.contains(Cypress.env("MESSAGES").DISCARDING_AND_PULLING_CHANGES());
|
||||
cy.validateToastMessage("Discarded changes successfully.");
|
||||
cy.wait(2000);
|
||||
assertHelper.AssertContains(
|
||||
"Unable to import application in workspace",
|
||||
"not.exist",
|
||||
);
|
||||
assertHelper.AssertContains(createMessage(UNABLE_TO_IMPORT_APP), "not.exist");
|
||||
});
|
||||
|
||||
Cypress.Commands.add(
|
||||
|
|
|
|||
|
|
@ -691,6 +691,12 @@ export const JS_ACTION_EXECUTION_ERROR = (jsFunctionName: string) =>
|
|||
//Editor Page
|
||||
export const EDITOR_HEADER_SAVE_INDICATOR = () => "Saved";
|
||||
|
||||
//Import Application Succesful
|
||||
export const IMPORT_APP_SUCCESSFUL = () => "Application imported successfully";
|
||||
//Unable to import application in workspace
|
||||
export const UNABLE_TO_IMPORT_APP = () =>
|
||||
"Unable to import application in workspace";
|
||||
|
||||
//undo redo
|
||||
export const WIDGET_REMOVED = (widgetName: string) =>
|
||||
`${widgetName} is removed`;
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ import AnalyticsUtil from "@appsmith/utils/AnalyticsUtil";
|
|||
import {
|
||||
createMessage,
|
||||
ERROR_IMPORTING_APPLICATION_TO_WORKSPACE,
|
||||
IMPORT_APP_SUCCESSFUL,
|
||||
} from "@appsmith/constants/messages";
|
||||
import { APP_MODE } from "entities/App";
|
||||
import type { Workspace } from "@appsmith/constants/workspaceConstants";
|
||||
|
|
@ -122,7 +123,6 @@ import {
|
|||
import equal from "fast-deep-equal";
|
||||
import { getFromServerWhenNoPrefetchedResult } from "sagas/helper";
|
||||
import { getIsAnvilLayoutEnabled } from "layoutSystems/anvil/integrations/selectors";
|
||||
|
||||
export const getDefaultPageId = (
|
||||
pages?: ApplicationPagePayload[],
|
||||
): string | undefined => {
|
||||
|
|
@ -791,7 +791,7 @@ export function* importApplicationSaga(
|
|||
}
|
||||
history.push(pageURL);
|
||||
|
||||
toast.show("Application imported successfully", {
|
||||
toast.show(createMessage(IMPORT_APP_SUCCESSFUL), {
|
||||
kind: "success",
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -94,6 +94,7 @@ import {
|
|||
ERROR_GIT_INVALID_REMOTE,
|
||||
GIT_USER_UPDATED_SUCCESSFULLY,
|
||||
PROTECT_BRANCH_SUCCESS,
|
||||
IMPORT_APP_SUCCESSFUL,
|
||||
} from "@appsmith/constants/messages";
|
||||
import type { GitApplicationMetadata } from "@appsmith/api/ApplicationApi";
|
||||
|
||||
|
|
@ -849,7 +850,7 @@ function* importAppFromGitSaga(action: ConnectToGitReduxAction) {
|
|||
pageId,
|
||||
});
|
||||
history.push(pageURL);
|
||||
toast.show("Application imported successfully", {
|
||||
toast.show(createMessage(IMPORT_APP_SUCCESSFUL), {
|
||||
kind: "success",
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user