Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test:PartialExport_Widgets spec file updated and import app method updated with validations #33343

Merged
merged 15 commits into from
May 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -36,7 +40,7 @@ describe(
} else {
cy.get(homePageLocatores.toastMessage).should(
"contain",
"Application imported successfully",
createMessage(IMPORT_APP_SUCCESSFUL),
);
}
agHelper.GenerateUUID();
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
);
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {

describe(
"Test Top + Inline navigation style",
{ tags: ["@tag.IDE"] },
{ tags: ["@tag.IDE", "@tag.ImportExport"] },
function () {
before(() => {
// Import an application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {

describe(
"Test Top + Stacked navigation style",
{ tags: ["@tag.IDE"] },
{ tags: ["@tag.IDE", "@tag.ImportExport"] },
function () {
before(() => {
// Import an application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down Expand Up @@ -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);
Expand Down
Loading
Loading