ToolJet/cypress-tests/cypress/support/utils/version.js

175 lines
5.8 KiB
JavaScript
Raw Normal View History

import { commonSelectors, commonWidgetSelector } from "Selectors/common";
Feature/draft versioning support (#14284) * added app_versions fields * added data migration for backward compatibility * added ce specific logic * fixed ce migration (need to dev-test) * moved to data migration * migration changes * added endpoint to create draft version * backend changes * added draft to app_import scenario * added version description * minor changes (needs improvement) * fixed breaking dropdown in editor * updated submodule commits * revert package.json * revert ui not used changes * submodule changes * reverting non used files * ui changes * ui changes * ui changes * ui changes * ui changes * copywriting changes * ui changes * ui changes * edit version modal changes * ui integration changes * added button solid and removed unused css * removed commented code from create version modal * updated button size to use large * ui changes * draft version modal changes * added sub-module commits to main * draft version endpoint changes * ui changes for draft version modal * fix breaking ui * ui changes for banner * minor ui changes * remove scss changes from themes file * removed unused components (cleanup) * removed unused components (pr cleanup) * draft version changes * create version modal changes * canvas banner fixes * comment creation logic * refactor: version dropdown * update endpoint changes * fix: promote logic * update submodule * fix: released version and create version modal * fix draft version creation * minor ui changes * minor backend fixes * tooltip changes * added all components in same folder * added minor comments * import fixes * refactor files * fix: overlay issues * fix: on version creation * fix ce bugs * bug fixes * bug fixes * bug fixes * bug fixes * base merge * feat: draft versioning support with UI enhancements and backend adjustments - Updated AppCanvas to conditionally render AppCanvasBanner based on edit mode. - Enhanced CreateDraftVersionModal to handle version selection and creation logic. - Modified CreateVersionModal to streamline version creation process and handle commits. - Improved ReleaseConfirmation to include development versions in release context. - Refactored CreateDraftButton and VersionDropdownItem for better UI consistency and dark mode support. - Updated VersionManagerDropdown to manage draft versions and improve version selection logic. - Enhanced version switcher and promote/release buttons with dark mode styling. - Adjusted server-side features and constants to support new draft versioning capabilities. - Updated styles across components for better visual consistency and responsiveness. * minor fixes * rebase * merge base * update submodule * Add data-cy attribute for draft version components * Update cypress test cases for draft version feature * Update failing test cases * Update draft version test cases * Skip older flow * migration changes * migration fixes * Update the failed test cases * removed multiple api calls * fix: version set on draft creation * fixes * fix: version update on save version * fixes * name fix * fix version lock banner styling * bump version to 3.20.50-lts across all components --------- Co-authored-by: Vijaykant Yadav <[email protected]> Co-authored-by: ajith-k-v <[email protected]> Co-authored-by: gsmithun4 <[email protected]>
2025-12-05 16:43:00 +00:00
import { versionModalSelector } from "Selectors/eeCommon";
import { appVersionSelectors } from "Selectors/exportImport";
import {
2023-06-16 07:18:29 +00:00
confirmVersionModalSelectors,
editVersionSelectors,
Feature/draft versioning support (#14284) * added app_versions fields * added data migration for backward compatibility * added ce specific logic * fixed ce migration (need to dev-test) * moved to data migration * migration changes * added endpoint to create draft version * backend changes * added draft to app_import scenario * added version description * minor changes (needs improvement) * fixed breaking dropdown in editor * updated submodule commits * revert package.json * revert ui not used changes * submodule changes * reverting non used files * ui changes * ui changes * ui changes * ui changes * ui changes * copywriting changes * ui changes * ui changes * edit version modal changes * ui integration changes * added button solid and removed unused css * removed commented code from create version modal * updated button size to use large * ui changes * draft version modal changes * added sub-module commits to main * draft version endpoint changes * ui changes for draft version modal * fix breaking ui * ui changes for banner * minor ui changes * remove scss changes from themes file * removed unused components (cleanup) * removed unused components (pr cleanup) * draft version changes * create version modal changes * canvas banner fixes * comment creation logic * refactor: version dropdown * update endpoint changes * fix: promote logic * update submodule * fix: released version and create version modal * fix draft version creation * minor ui changes * minor backend fixes * tooltip changes * added all components in same folder * added minor comments * import fixes * refactor files * fix: overlay issues * fix: on version creation * fix ce bugs * bug fixes * bug fixes * bug fixes * bug fixes * base merge * feat: draft versioning support with UI enhancements and backend adjustments - Updated AppCanvas to conditionally render AppCanvasBanner based on edit mode. - Enhanced CreateDraftVersionModal to handle version selection and creation logic. - Modified CreateVersionModal to streamline version creation process and handle commits. - Improved ReleaseConfirmation to include development versions in release context. - Refactored CreateDraftButton and VersionDropdownItem for better UI consistency and dark mode support. - Updated VersionManagerDropdown to manage draft versions and improve version selection logic. - Enhanced version switcher and promote/release buttons with dark mode styling. - Adjusted server-side features and constants to support new draft versioning capabilities. - Updated styles across components for better visual consistency and responsiveness. * minor fixes * rebase * merge base * update submodule * Add data-cy attribute for draft version components * Update cypress test cases for draft version feature * Update failing test cases * Update draft version test cases * Skip older flow * migration changes * migration fixes * Update the failed test cases * removed multiple api calls * fix: version set on draft creation * fixes * fix: version update on save version * fixes * name fix * fix version lock banner styling * bump version to 3.20.50-lts across all components --------- Co-authored-by: Vijaykant Yadav <[email protected]> Co-authored-by: ajith-k-v <[email protected]> Co-authored-by: gsmithun4 <[email protected]>
2025-12-05 16:43:00 +00:00
versionSwitcherSelectors,
} from "Selectors/version";
import { closeModal } from "Support/utils/common";
Feature/draft versioning support (#14284) * added app_versions fields * added data migration for backward compatibility * added ce specific logic * fixed ce migration (need to dev-test) * moved to data migration * migration changes * added endpoint to create draft version * backend changes * added draft to app_import scenario * added version description * minor changes (needs improvement) * fixed breaking dropdown in editor * updated submodule commits * revert package.json * revert ui not used changes * submodule changes * reverting non used files * ui changes * ui changes * ui changes * ui changes * ui changes * copywriting changes * ui changes * ui changes * edit version modal changes * ui integration changes * added button solid and removed unused css * removed commented code from create version modal * updated button size to use large * ui changes * draft version modal changes * added sub-module commits to main * draft version endpoint changes * ui changes for draft version modal * fix breaking ui * ui changes for banner * minor ui changes * remove scss changes from themes file * removed unused components (cleanup) * removed unused components (pr cleanup) * draft version changes * create version modal changes * canvas banner fixes * comment creation logic * refactor: version dropdown * update endpoint changes * fix: promote logic * update submodule * fix: released version and create version modal * fix draft version creation * minor ui changes * minor backend fixes * tooltip changes * added all components in same folder * added minor comments * import fixes * refactor files * fix: overlay issues * fix: on version creation * fix ce bugs * bug fixes * bug fixes * bug fixes * bug fixes * base merge * feat: draft versioning support with UI enhancements and backend adjustments - Updated AppCanvas to conditionally render AppCanvasBanner based on edit mode. - Enhanced CreateDraftVersionModal to handle version selection and creation logic. - Modified CreateVersionModal to streamline version creation process and handle commits. - Improved ReleaseConfirmation to include development versions in release context. - Refactored CreateDraftButton and VersionDropdownItem for better UI consistency and dark mode support. - Updated VersionManagerDropdown to manage draft versions and improve version selection logic. - Enhanced version switcher and promote/release buttons with dark mode styling. - Adjusted server-side features and constants to support new draft versioning capabilities. - Updated styles across components for better visual consistency and responsiveness. * minor fixes * rebase * merge base * update submodule * Add data-cy attribute for draft version components * Update cypress test cases for draft version feature * Update failing test cases * Update draft version test cases * Skip older flow * migration changes * migration fixes * Update the failed test cases * removed multiple api calls * fix: version set on draft creation * fixes * fix: version update on save version * fixes * name fix * fix version lock banner styling * bump version to 3.20.50-lts across all components --------- Co-authored-by: Vijaykant Yadav <[email protected]> Co-authored-by: ajith-k-v <[email protected]> Co-authored-by: gsmithun4 <[email protected]>
2025-12-05 16:43:00 +00:00
import { appPromote } from "Support/utils/platform/multiEnv";
import { commonText } from "Texts/common";
import { appVersionText } from "Texts/exportImport";
import { deleteVersionText, releasedVersionText } from "Texts/version";
export const navigateToCreateNewVersionModal = (value) => {
Feature/draft versioning support (#14284) * added app_versions fields * added data migration for backward compatibility * added ce specific logic * fixed ce migration (need to dev-test) * moved to data migration * migration changes * added endpoint to create draft version * backend changes * added draft to app_import scenario * added version description * minor changes (needs improvement) * fixed breaking dropdown in editor * updated submodule commits * revert package.json * revert ui not used changes * submodule changes * reverting non used files * ui changes * ui changes * ui changes * ui changes * ui changes * copywriting changes * ui changes * ui changes * edit version modal changes * ui integration changes * added button solid and removed unused css * removed commented code from create version modal * updated button size to use large * ui changes * draft version modal changes * added sub-module commits to main * draft version endpoint changes * ui changes for draft version modal * fix breaking ui * ui changes for banner * minor ui changes * remove scss changes from themes file * removed unused components (cleanup) * removed unused components (pr cleanup) * draft version changes * create version modal changes * canvas banner fixes * comment creation logic * refactor: version dropdown * update endpoint changes * fix: promote logic * update submodule * fix: released version and create version modal * fix draft version creation * minor ui changes * minor backend fixes * tooltip changes * added all components in same folder * added minor comments * import fixes * refactor files * fix: overlay issues * fix: on version creation * fix ce bugs * bug fixes * bug fixes * bug fixes * bug fixes * base merge * feat: draft versioning support with UI enhancements and backend adjustments - Updated AppCanvas to conditionally render AppCanvasBanner based on edit mode. - Enhanced CreateDraftVersionModal to handle version selection and creation logic. - Modified CreateVersionModal to streamline version creation process and handle commits. - Improved ReleaseConfirmation to include development versions in release context. - Refactored CreateDraftButton and VersionDropdownItem for better UI consistency and dark mode support. - Updated VersionManagerDropdown to manage draft versions and improve version selection logic. - Enhanced version switcher and promote/release buttons with dark mode styling. - Adjusted server-side features and constants to support new draft versioning capabilities. - Updated styles across components for better visual consistency and responsiveness. * minor fixes * rebase * merge base * update submodule * Add data-cy attribute for draft version components * Update cypress test cases for draft version feature * Update failing test cases * Update draft version test cases * Skip older flow * migration changes * migration fixes * Update the failed test cases * removed multiple api calls * fix: version set on draft creation * fixes * fix: version update on save version * fixes * name fix * fix version lock banner styling * bump version to 3.20.50-lts across all components --------- Co-authored-by: Vijaykant Yadav <[email protected]> Co-authored-by: ajith-k-v <[email protected]> Co-authored-by: gsmithun4 <[email protected]>
2025-12-05 16:43:00 +00:00
cy.get(versionSwitcherSelectors.versionName).click();
cy.contains(appVersionText.createNewVersion).first().should("be.visible");
cy.contains(appVersionText.createNewVersion).first().click();
};
export const navigateToEditVersionModal = (value) => {
cy.get(appVersionSelectors.currentVersionField(value))
.should("be.visible")
.click();
cy.get('[style="padding: 8px 12px;"] .row')
.should("be.visible")
.within(() => {
cy.get(".icon").trigger("mouseover").click();
});
};
export const verifyElementsOfCreateNewVersionModal = (version = []) => {
cy.get(appVersionSelectors.createNewVersion).verifyVisibleElement(
"have.text",
appVersionText.createNewVersion
);
cy.get(appVersionSelectors.versionNamelabel).verifyVisibleElement(
"have.text",
appVersionText.versionNameLabel
);
cy.get(appVersionSelectors.createVersionFromLabel).verifyVisibleElement(
"have.text",
appVersionText.createVersionFromLabel
);
cy.get(appVersionSelectors.versionNameInputField).should("be.visible");
cy.get(appVersionSelectors.createVersionInputField).verifyVisibleElement(
"have.text",
version[0]
);
2025-11-12 20:07:42 +00:00
cy.get(commonSelectors.buttonSelector(appVersionText.createNewVersion))
.first()
.verifyVisibleElement("have.text", appVersionText.createNewVersion);
cy.get(commonSelectors.buttonSelector(commonText.cancelButton))
.should("be.visible")
.and("have.text", commonText.cancelButton);
cy.get(commonSelectors.buttonSelector(commonText.closeButton))
.should("be.visible")
.click();
};
export const editVersionAndVerify = (
currentVersion,
newVersion = [],
toastMessageText
) => {
cy.get(appVersionSelectors.currentVersionField(currentVersion)).then(
($ele) => {
if ($ele.hasClass("color-light-green")) {
cy.contains(releasedVersionText.releasedModalText).should("be.visible");
closeModal(commonText.closeButton);
}
}
);
cy.wait(500);
navigateToEditVersionModal(currentVersion);
cy.waitForElement(editVersionSelectors.versionNameInputField);
cy.get(editVersionSelectors.versionNameInputField).verifyVisibleElement(
"have.value",
currentVersion
);
cy.clearAndType(editVersionSelectors.versionNameInputField, newVersion[0]);
cy.get(editVersionSelectors.saveButton).click();
cy.wait(1000);
cy.verifyToastMessage(commonSelectors.toastMessage, toastMessageText);
};
export const deleteVersionAndVerify = (value) => {
cy.get(appVersionSelectors.currentVersionField(value))
.should("be.visible")
.click();
cy.contains(`[id*="react-select-"]`, value)
.should("be.visible")
.within(() => {
cy.get(" .app-version-list-item")
.trigger("mouseover")
.trigger("mouseenter")
.find(".app-version-delete")
.click({ force: true });
});
cy.get(commonSelectors.modalMessage).verifyVisibleElement(
"have.text",
deleteVersionText.deleteModalText(value)
);
2023-06-16 07:18:29 +00:00
cy.get(confirmVersionModalSelectors.yesButton).click();
cy.verifyToastMessage(
commonSelectors.toastMessage,
deleteVersionText.deleteToastMessage(value),
false
);
};
export const verifyDuplicateVersion = (newVersion = [], version) => {
cy.contains(appVersionText.createNewVersion).should("be.visible").click();
cy.get(appVersionSelectors.createVersionInputField).click();
cy.contains(`[id*="react-select-"]`, version).click();
cy.clearAndType(appVersionSelectors.versionNameInputField, newVersion[0]);
cy.get(appVersionSelectors.createNewVersionButton).first().click();
cy.verifyToastMessage(
commonSelectors.toastMessage,
appVersionText.versionNameAlreadyExists
// "Already exists!"
);
};
export const releasedVersionAndVerify = (currentVersion) => {
cy.ifEnv("Enterprise", () => {
appPromote("development", "production");
});
cy.contains("Release").click();
2023-06-16 07:18:29 +00:00
cy.get(confirmVersionModalSelectors.yesButton).click();
cy.verifyToastMessage(
commonSelectors.toastMessage,
releasedVersionText.releasedToastMessage(currentVersion)
);
cy.forceClickOnCanvas();
2023-05-12 10:40:16 +00:00
cy.get(".released-version-popup-cover").verifyVisibleElement(
"have.text",
releasedVersionText.releasedAppText
);
};
export const verifyVersionAfterPreview = (currentVersion) => {
cy.get(appVersionSelectors.currentVersionField(currentVersion)).should(
"be.visible"
);
cy.get(commonWidgetSelector.previewButton)
.invoke("removeAttr", "target")
.click();
cy.url().should("include", "/home");
cy.wait(2000);
cy.get('[data-cy^="draggable-widget-table"]').should("be.visible");
cy.url().should("include", `version=${currentVersion}`);
Platform LTS Final fixes (#13221) * Cloud Blocker bugfixes (#13160) * fix * minor email fixes * settings menu fix * fixes * Bugfixes/whitelabelling apis (#13180) * white-labelling apis * removed consoles logs * reverts * fixes for white-labelling * fixes * reverted breadcrumb changes (#13194) * fixes for getting public sso configurations * fix for enable signup on cloud * Cloud Trial and Banners (#13182) * Cloud Blocker bugfixes (#13160) * fix * minor email fixes * settings menu fix * fixes * Cloud Trial and Banners * revert * initial commit * Added website onboarding APIs * moved ai onboarding controller to auth module * ee banners * fix --------- Co-authored-by: Rohan Lahori <64496391+[email protected]> Co-authored-by: gsmithun4 <[email protected]> * Bugfixes/minor UI fixes-CLoud (#13203) * Bugfixes/UI bugs platform 1 (#13205) * cleanup * Audit logs fix * gitignore changes * postgrest configs removed * removed unused import * improvements * fix * improved startup logs * Platform cypress fix (#13192) * Cloud Blocker bugfixes (#13160) * fix * minor email fixes * settings menu fix * fixes * Bugfixes/whitelabelling apis (#13180) * white-labelling apis * removed consoles logs * reverts * fixes for white-labelling * fixes * Cypress fix * reverted breadcrumb changes (#13194) * cypress fix * title fix * fixes for getting public sso configurations --------- Co-authored-by: Rohan Lahori <64496391+[email protected]> Co-authored-by: gsmithun4 <[email protected]> * deployment fix * added interfaces and permissions * Bugfixes/lts 3.6 branch 1 platform (#13238) * fix * Licensing Banners Fixes Cloud and EE (#13241) * design: Adds license buttons to header * Refactor header actions * Cloud Blocker bugfixes (#13160) * fix * minor email fixes * settings menu fix * fixes * subscription page * fix banners --------- Co-authored-by: Nithin David Thomas <1277421+[email protected]> Co-authored-by: Rohan Lahori <64496391+[email protected]> * fix for public apps * fix * CE Instance Signup bug (#13254) * CE Instance Signup bug * improvement * fix * Add WEBSITE_SIGNUP_URL to deployment environment variables * Add WEBSITE_SIGNUP_URL to environment variables for deployment * Super admin banner fix (#13262) * Git Sync Fixes (#13249) * git-sync module changes * git sync fixes * added app resource guard * git-sync fixes * removed require feature * fix * review comment changes * ypress fix * App logo fix inside app builder * fix for subpath cache * fix (#13274) * platform-cypress-fix (#13271) * git sync fixes (#13277) * fix * Add data-cy for new components (#13289) --------- Co-authored-by: Rohan Lahori <64496391+[email protected]> Co-authored-by: Rudhra Deep Biswas <98055396+[email protected]> Co-authored-by: Ajith KV <[email protected]> Co-authored-by: Nithin David Thomas <1277421+[email protected]> Co-authored-by: rohanlahori <[email protected]> Co-authored-by: Adish M <[email protected]> Co-authored-by: Rudra deep Biswas <[email protected]>
2025-07-09 17:06:41 +00:00
// cy.get('[data-cy="viewer-page-logo"]').click();
cy.go("back");
cy.wait(8000);
};
export const switchVersionAndVerify = (currentVersion, newVersion) => {
Feature/draft versioning support (#14284) * added app_versions fields * added data migration for backward compatibility * added ce specific logic * fixed ce migration (need to dev-test) * moved to data migration * migration changes * added endpoint to create draft version * backend changes * added draft to app_import scenario * added version description * minor changes (needs improvement) * fixed breaking dropdown in editor * updated submodule commits * revert package.json * revert ui not used changes * submodule changes * reverting non used files * ui changes * ui changes * ui changes * ui changes * ui changes * copywriting changes * ui changes * ui changes * edit version modal changes * ui integration changes * added button solid and removed unused css * removed commented code from create version modal * updated button size to use large * ui changes * draft version modal changes * added sub-module commits to main * draft version endpoint changes * ui changes for draft version modal * fix breaking ui * ui changes for banner * minor ui changes * remove scss changes from themes file * removed unused components (cleanup) * removed unused components (pr cleanup) * draft version changes * create version modal changes * canvas banner fixes * comment creation logic * refactor: version dropdown * update endpoint changes * fix: promote logic * update submodule * fix: released version and create version modal * fix draft version creation * minor ui changes * minor backend fixes * tooltip changes * added all components in same folder * added minor comments * import fixes * refactor files * fix: overlay issues * fix: on version creation * fix ce bugs * bug fixes * bug fixes * bug fixes * bug fixes * base merge * feat: draft versioning support with UI enhancements and backend adjustments - Updated AppCanvas to conditionally render AppCanvasBanner based on edit mode. - Enhanced CreateDraftVersionModal to handle version selection and creation logic. - Modified CreateVersionModal to streamline version creation process and handle commits. - Improved ReleaseConfirmation to include development versions in release context. - Refactored CreateDraftButton and VersionDropdownItem for better UI consistency and dark mode support. - Updated VersionManagerDropdown to manage draft versions and improve version selection logic. - Enhanced version switcher and promote/release buttons with dark mode styling. - Adjusted server-side features and constants to support new draft versioning capabilities. - Updated styles across components for better visual consistency and responsiveness. * minor fixes * rebase * merge base * update submodule * Add data-cy attribute for draft version components * Update cypress test cases for draft version feature * Update failing test cases * Update draft version test cases * Skip older flow * migration changes * migration fixes * Update the failed test cases * removed multiple api calls * fix: version set on draft creation * fixes * fix: version update on save version * fixes * name fix * fix version lock banner styling * bump version to 3.20.50-lts across all components --------- Co-authored-by: Vijaykant Yadav <[email protected]> Co-authored-by: ajith-k-v <[email protected]> Co-authored-by: gsmithun4 <[email protected]>
2025-12-05 16:43:00 +00:00
cy.waitForElement(versionSwitcherSelectors.versionName);
cy.get(versionSwitcherSelectors.versionName).should("be.visible").click();
cy.get(versionModalSelector.versionName(newVersion)).click();
2025-11-19 16:46:48 +00:00
cy.wait(1000);
//Note: add assertion to verify version switched
2025-11-12 20:07:42 +00:00
//cy.wait('@appDs')
};
export const openPreviewSettings = () => {
cy.get(commonSelectors.previewSettings).should("be.visible").click();
2025-11-19 16:46:48 +00:00
cy.wait(1000);
// Note: add alias wait for version and env load
};