mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-23 08:58:26 +00:00
Merge branch 'main' into release/marketplace-sprint-11
This commit is contained in:
commit
f3cf8959a3
20 changed files with 289 additions and 262 deletions
35
.github/workflows/render-preview-deploy.yml
vendored
35
.github/workflows/render-preview-deploy.yml
vendored
|
|
@ -170,7 +170,7 @@ jobs:
|
|||
"serviceDetails": {
|
||||
"disk": {
|
||||
"name": "tooljet-ce-pr-${{ env.PR_NUMBER }}-postgresql",
|
||||
"mountPath": "/data",
|
||||
"mountPath": "/var/lib/postgresql/13/main",
|
||||
"sizeGB": 10
|
||||
},
|
||||
"env": "docker",
|
||||
|
|
@ -393,6 +393,39 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
|
||||
- name: Sync repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Check if Forked Repository
|
||||
id: check_repo
|
||||
run: |
|
||||
if [[ "${{ github.event.pull_request.head.repo.fork }}" == "true" ]]; then
|
||||
echo "is_fork=true" >> $GITHUB_ENV
|
||||
echo "FORKED_OWNER=${{ github.event.pull_request.head.repo.owner.login }}" >> $GITHUB_ENV
|
||||
else
|
||||
echo "is_fork=false" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Set Repository URL
|
||||
run: |
|
||||
if [[ "$is_fork" == "true" ]]; then
|
||||
echo "REPO_URL=https://github.com/${FORKED_OWNER}/ToolJet" >> $GITHUB_ENV
|
||||
else
|
||||
echo "REPO_URL=https://github.com/ToolJet/ToolJet" >> $GITHUB_ENV
|
||||
fi
|
||||
|
||||
- name: Fetch and Checkout Forked Branch
|
||||
if: env.is_fork == 'true'
|
||||
run: |
|
||||
git fetch origin pull/${{ github.event.number }}/head:${{ env.BRANCH_NAME }}
|
||||
git checkout ${{ env.BRANCH_NAME }}
|
||||
|
||||
- name: Checkout Default Branch
|
||||
if: env.is_fork == 'false'
|
||||
uses: actions/checkout@v3
|
||||
|
||||
|
||||
- name: Creating deployment for Enterprise Edition
|
||||
id: create-ee-deployment
|
||||
run: |
|
||||
|
|
|
|||
|
|
@ -39,11 +39,11 @@ module.exports = defineConfig({
|
|||
chromeWebSecurity: false,
|
||||
trashAssetsBeforeRuns: true,
|
||||
e2e: {
|
||||
setupNodeEvents(on, config) {
|
||||
setupNodeEvents (on, config) {
|
||||
config.baseUrl = environment.baseUrl;
|
||||
|
||||
on("task", {
|
||||
readPdf(pathToPdf) {
|
||||
readPdf (pathToPdf) {
|
||||
return new Promise((resolve) => {
|
||||
const pdfPath = path.resolve(pathToPdf);
|
||||
let dataBuffer = fs.readFileSync(pdfPath);
|
||||
|
|
@ -55,7 +55,7 @@ module.exports = defineConfig({
|
|||
});
|
||||
|
||||
on("task", {
|
||||
readXlsx(filePath) {
|
||||
readXlsx (filePath) {
|
||||
return new Promise((resolve, reject) => {
|
||||
try {
|
||||
let dataBuffer = fs.readFileSync(filePath);
|
||||
|
|
@ -69,7 +69,7 @@ module.exports = defineConfig({
|
|||
});
|
||||
|
||||
on("task", {
|
||||
deleteFolder(folderName) {
|
||||
deleteFolder (folderName) {
|
||||
return new Promise((resolve, reject) => {
|
||||
rmdir(folderName, { maxRetries: 10, recursive: true }, (err) => {
|
||||
if (err) {
|
||||
|
|
@ -83,7 +83,7 @@ module.exports = defineConfig({
|
|||
});
|
||||
|
||||
on("task", {
|
||||
dbConnection({ dbconfig, sql }) {
|
||||
dbConnection ({ dbconfig, sql }) {
|
||||
const client = new pg.Pool(dbconfig);
|
||||
return client.query(sql);
|
||||
},
|
||||
|
|
@ -97,9 +97,9 @@ module.exports = defineConfig({
|
|||
baseUrl: environment.baseUrl,
|
||||
configFile: environment.configFile,
|
||||
specPattern: [
|
||||
"cypress/e2e/happyPath/platform/ceTestcases/userFlow/firstUserOnboarding.cy.js",
|
||||
"cypress/e2e/happyPath/platform/commonTestcases/workspace/dashboard.cy.js",
|
||||
"cypress/e2e/happyPath/platform/ceTestcases/!(userFlow)/**/*.cy.js",
|
||||
"cypress/e2e/happyPath/platform/firstUser/firstUserOnboarding.cy.js",
|
||||
"cypress/e2e/happyPath/platform/ceTestcases/apps/appSlug.cy.js",
|
||||
"cypress/e2e/happyPath/platform/ceTestcases/**/!(*appSlug).cy.js",
|
||||
"cypress/e2e/happyPath/platform/commonTestcases/**/*.cy.js",
|
||||
],
|
||||
numTestsKeptInMemory: 1,
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import { passwordInputText } from "Texts/passwordInput";
|
|||
import { importSelectors } from "Selectors/exportImport";
|
||||
import { importText } from "Texts/exportImport";
|
||||
import { onboardingSelectors } from "Selectors/onboarding";
|
||||
import { selectAppCardOption } from "Support/utils/common";
|
||||
|
||||
const API_ENDPOINT =
|
||||
Cypress.env("environment") === "Community"
|
||||
|
|
@ -160,12 +161,10 @@ Cypress.Commands.add(
|
|||
|
||||
Cypress.Commands.add("deleteApp", (appName) => {
|
||||
cy.intercept("DELETE", "/api/apps/*").as("appDeleted");
|
||||
cy.get(commonSelectors.appCard(appName))
|
||||
.realHover()
|
||||
.find(commonSelectors.appCardOptionsButton)
|
||||
.realHover()
|
||||
.click();
|
||||
cy.get(commonSelectors.deleteAppOption).click();
|
||||
selectAppCardOption(
|
||||
appName,
|
||||
commonSelectors.appCardOptions(commonText.deleteAppOption)
|
||||
);
|
||||
cy.get(commonSelectors.buttonSelector(commonText.modalYesButton)).click();
|
||||
cy.verifyToastMessage(
|
||||
commonSelectors.toastMessage,
|
||||
|
|
@ -227,9 +226,9 @@ Cypress.Commands.add(
|
|||
.invoke("text")
|
||||
.then((text) => {
|
||||
cy.wrap(subject).realType(createBackspaceText(text)),
|
||||
{
|
||||
delay: 0,
|
||||
};
|
||||
{
|
||||
delay: 0,
|
||||
};
|
||||
});
|
||||
}
|
||||
);
|
||||
|
|
@ -398,39 +397,38 @@ Cypress.Commands.add("getPosition", (componentName) => {
|
|||
});
|
||||
|
||||
Cypress.Commands.add("defaultWorkspaceLogin", () => {
|
||||
cy.apiLogin();
|
||||
cy.task("dbConnection", {
|
||||
dbconfig: Cypress.env("app_db"),
|
||||
sql: `
|
||||
SELECT id FROM organizations WHERE name = 'My workspace';`,
|
||||
}).then((resp) => {
|
||||
const workspaceId = resp.rows[0].id;
|
||||
|
||||
// cy.intercept("GET", API_ENDPOINT).as("library_apps");
|
||||
cy.visit("/my-workspace");
|
||||
cy.wait(2000);
|
||||
cy.get(commonSelectors.homePageLogo, { timeout: 10000 });
|
||||
// cy.wait("@library_apps");
|
||||
cy.apiLogin(
|
||||
"dev@tooljet.io",
|
||||
"password",
|
||||
workspaceId,
|
||||
"/my-workspace"
|
||||
).then(() => {
|
||||
cy.visit("/");
|
||||
cy.wait(2000);
|
||||
cy.get(commonSelectors.homePageLogo, { timeout: 10000 });
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Cypress.Commands.add(
|
||||
"visitSlug",
|
||||
({
|
||||
actualUrl,
|
||||
errorUrls = [
|
||||
`${Cypress.config("baseUrl")}/error/unknown`,
|
||||
`${Cypress.config("baseUrl")}/error/restricted`,
|
||||
],
|
||||
}) => {
|
||||
if (!actualUrl) {
|
||||
throw new Error("actualUrl is required for visitSlug command.");
|
||||
Cypress.Commands.add("visitSlug", ({ actualUrl }) => {
|
||||
cy.visit(actualUrl);
|
||||
cy.wait(1000);
|
||||
|
||||
cy.url().then((currentUrl) => {
|
||||
if (currentUrl !== actualUrl) {
|
||||
cy.visit(actualUrl);
|
||||
cy.wait(1000);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
cy.visit(actualUrl);
|
||||
|
||||
cy.url().then((url) => {
|
||||
if (errorUrls.includes(url)) {
|
||||
cy.log(`Navigation resulted in error URL: ${url}. Retrying...`);
|
||||
cy.visit(actualUrl);
|
||||
cy.wait(1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
Cypress.Commands.add("releaseApp", () => {
|
||||
if (Cypress.env("environment") !== "Community") {
|
||||
|
|
@ -551,7 +549,7 @@ Cypress.Commands.add("installMarketplacePlugin", (pluginName) => {
|
|||
}
|
||||
});
|
||||
|
||||
function installPlugin(pluginName) {
|
||||
function installPlugin (pluginName) {
|
||||
cy.get('[data-cy="-list-item"]').eq(1).click();
|
||||
cy.wait(1000);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,11 +8,7 @@ export const editVersionText = {
|
|||
|
||||
export const deleteVersionText = {
|
||||
deleteModalText: (text) => {
|
||||
// return `Are you sure you want to delete this version - ${cyParamName(
|
||||
// text
|
||||
// )}?`;
|
||||
|
||||
return `Deleting a version will permanently remove it from all environments.Are you sure you want to delete this version - ${cyParamName(
|
||||
return `Are you sure you want to delete this version - ${cyParamName(
|
||||
text
|
||||
)}?`;
|
||||
},
|
||||
|
|
|
|||
|
|
@ -46,9 +46,7 @@ describe("App Export", () => {
|
|||
});
|
||||
|
||||
it("Verify the elements of export dialog box", () => {
|
||||
cy.window({ log: false }).then((win) => {
|
||||
win.localStorage.setItem("walkthroughCompleted", "true");
|
||||
});
|
||||
cy.skipWalkthrough()
|
||||
|
||||
cy.apiLogin();
|
||||
cy.visit(`${data.workspaceSlug}`);
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ describe("App Import Functionality", () => {
|
|||
cy.apiLogin();
|
||||
cy.apiCreateWorkspace(data.workspaceName, data.workspaceSlug);
|
||||
cy.apiLogout();
|
||||
cy.skipWalkthrough()
|
||||
});
|
||||
|
||||
it("should verify app import functionality", () => {
|
||||
|
|
@ -100,12 +101,13 @@ describe("App Import Functionality", () => {
|
|||
.and("have.text", importText.appImportedToastMessage);
|
||||
|
||||
// Verify imported app
|
||||
cy.get(".driver-close-btn").click();
|
||||
cy.get(commonSelectors.toastCloseButton).click();
|
||||
cy.wait(500);
|
||||
cy.get(commonSelectors.appNameInput).verifyVisibleElement(
|
||||
"contain.value",
|
||||
"three-versions"
|
||||
);
|
||||
cy.get(appVersionSelectors.currentVersionField("v3")).should("be.visible");
|
||||
|
||||
// Configure app
|
||||
cy.skipEditorPopover();
|
||||
|
|
|
|||
|
|
@ -27,17 +27,21 @@ describe("App Slug", () => {
|
|||
});
|
||||
|
||||
it("Verify app slug cases in global settings", () => {
|
||||
cy.apiLogin();
|
||||
const workspaceId = Cypress.env("workspaceId");
|
||||
const appId = Cypress.env("appId");
|
||||
const appUrl = `${host}/${Cypress.env("workspaceId")}/apps/${Cypress.env("appId")}/`;
|
||||
|
||||
cy.visit("/my-workspace");
|
||||
cy.wait(1000);
|
||||
cy.apiLogin();
|
||||
cy.skipWalkthrough();
|
||||
|
||||
cy.window({ log: false }).then((win) => {
|
||||
win.localStorage.setItem("walkthroughCompleted", "true");
|
||||
cy.visit(appUrl);
|
||||
cy.url().then((url) => {
|
||||
if (url !== appUrl) {
|
||||
cy.visit(appUrl);
|
||||
}
|
||||
});
|
||||
cy.visit(`/${Cypress.env("workspaceId")}/apps/${Cypress.env("appId")}/`);
|
||||
cy.url().should("eq", appUrl);
|
||||
|
||||
cy.wait(1000);
|
||||
|
||||
cy.get(commonSelectors.leftSideBarSettingsButton).click();
|
||||
|
|
|
|||
|
|
@ -78,11 +78,11 @@ describe("Private and Public apps", {
|
|||
|
||||
// Test private access
|
||||
logout();
|
||||
cy.get(onboardingSelectors.signInButton, { timeout: 20000 }).should("be.visible");
|
||||
|
||||
cy.visitSlug({
|
||||
actualUrl: `${Cypress.config("baseUrl")}/applications/${data.slug}`,
|
||||
});
|
||||
|
||||
cy.get(onboardingSelectors.signInButton, { timeout: 20000 }).should("be.visible");
|
||||
cy.wait(2000);
|
||||
cy.appUILogin();
|
||||
|
|
@ -116,6 +116,9 @@ describe("Private and Public apps", {
|
|||
|
||||
inviteUserToWorkspace(data.firstName, data.email);
|
||||
logout();
|
||||
cy.visit("/");
|
||||
cy.wait(2000);
|
||||
cy.get(onboardingSelectors.signInButton, { timeout: 20000 }).should("be.visible");
|
||||
|
||||
// Test private access
|
||||
cy.visitSlug({
|
||||
|
|
@ -141,6 +144,8 @@ describe("Private and Public apps", {
|
|||
cy.wait(1000);
|
||||
cy.apiMakeAppPublic();
|
||||
logout();
|
||||
cy.wait(1000);
|
||||
cy.get(onboardingSelectors.signInButton, { timeout: 20000 }).should("be.visible");
|
||||
|
||||
cy.visitSlug({
|
||||
actualUrl: `${Cypress.config("baseUrl")}/applications/${data.slug}`,
|
||||
|
|
@ -177,6 +182,9 @@ describe("Private and Public apps", {
|
|||
cy.apiMakeAppPublic();
|
||||
logout();
|
||||
|
||||
cy.wait(1000);
|
||||
cy.get(onboardingSelectors.signInButton, { timeout: 20000 }).should("be.visible");
|
||||
|
||||
cy.visitSlug({
|
||||
actualUrl: `${Cypress.config("baseUrl")}/applications/${data.slug}`,
|
||||
});
|
||||
|
|
@ -229,6 +237,8 @@ describe("Private and Public apps", {
|
|||
|
||||
cy.get('[data-cy="viewer-page-logo"]').click();
|
||||
logout();
|
||||
cy.wait(1000);
|
||||
cy.get(onboardingSelectors.signInButton, { timeout: 20000 }).should("be.visible");
|
||||
|
||||
// Setup new workspace and app
|
||||
cy.defaultWorkspaceLogin();
|
||||
|
|
@ -123,7 +123,7 @@ describe("App Version", () => {
|
|||
releasedVersionAndVerify("v2");
|
||||
});
|
||||
|
||||
it.only("should verify version management with components and queries", () => {
|
||||
it("should verify version management with components and queries", () => {
|
||||
// Initial setup with component and datasource
|
||||
cy.apiAddComponentToApp(
|
||||
data.appName,
|
||||
|
|
@ -44,6 +44,164 @@ describe("dashboard", () => {
|
|||
cy.visit(`${data.workspaceSlug}`);
|
||||
});
|
||||
|
||||
// it("Should verify app card elements and app card operations", () => {
|
||||
// const customLayout = {
|
||||
// desktop: { top: 100, left: 20 },
|
||||
// mobile: { width: 8, height: 50 },
|
||||
// };
|
||||
|
||||
// cy.apiCreateApp(data.appName);
|
||||
// cy.visit(`${data.workspaceSlug}`);
|
||||
|
||||
// cy.wait(2000);
|
||||
// cy.get(commonSelectors.appCreationDetails).should("be.visible");
|
||||
// cy.get(commonSelectors.appCard(data.appName)).should("be.visible");
|
||||
// cy.get(commonSelectors.appTitle(data.appName)).verifyVisibleElement(
|
||||
// "have.text",
|
||||
// data.appName
|
||||
// );
|
||||
|
||||
// viewAppCardOptions(data.appName);
|
||||
// cy.get(
|
||||
// commonSelectors.appCardOptions(commonText.changeIconOption)
|
||||
// ).verifyVisibleElement("have.text", commonText.changeIconOption);
|
||||
// cy.get(
|
||||
// commonSelectors.appCardOptions(commonText.addToFolderOption)
|
||||
// ).verifyVisibleElement("have.text", commonText.addToFolderOption);
|
||||
// cy.get(
|
||||
// commonSelectors.appCardOptions(commonText.cloneAppOption)
|
||||
// ).verifyVisibleElement("have.text", commonText.cloneAppOption);
|
||||
// cy.get(
|
||||
// commonSelectors.appCardOptions(commonText.exportAppOption)
|
||||
// ).verifyVisibleElement("have.text", commonText.exportAppOption);
|
||||
// cy.get(
|
||||
// commonSelectors.appCardOptions(commonText.deleteAppOption)
|
||||
// ).verifyVisibleElement("have.text", commonText.deleteAppOption);
|
||||
|
||||
// modifyAndVerifyAppCardIcon(data.appName);
|
||||
// createFolder(data.folderName);
|
||||
|
||||
// viewAppCardOptions(data.appName);
|
||||
// cy.get(
|
||||
// commonSelectors.appCardOptions(commonText.addToFolderOption)
|
||||
// ).click();
|
||||
// verifyModal(
|
||||
// dashboardText.addToFolderTitle,
|
||||
// dashboardText.addToFolderButton,
|
||||
// dashboardSelector.selectFolder
|
||||
// );
|
||||
// cy.get(dashboardSelector.moveAppText).verifyVisibleElement(
|
||||
// "have.text",
|
||||
// dashboardText.moveAppText(data.appName)
|
||||
// );
|
||||
|
||||
// cy.get(dashboardSelector.selectFolder).click();
|
||||
// cy.get(commonSelectors.folderList).contains(data.folderName).click();
|
||||
// cy.get(dashboardSelector.addToFolderButton).click();
|
||||
// cy.verifyToastMessage(
|
||||
// commonSelectors.toastMessage,
|
||||
// commonText.AddedToFolderToast,
|
||||
// false
|
||||
// );
|
||||
|
||||
// cy.get(dashboardSelector.folderName(data.folderName)).verifyVisibleElement(
|
||||
// "have.text",
|
||||
// dashboardText.folderName(`${data.folderName} (1)`)
|
||||
// );
|
||||
|
||||
// cy.get(dashboardSelector.folderName(data.folderName)).click();
|
||||
// cy.get(commonSelectors.appCard(data.appName))
|
||||
// .contains(data.appName)
|
||||
// .should("be.visible");
|
||||
|
||||
// viewAppCardOptions(data.appName);
|
||||
|
||||
// cy.get(commonSelectors.appCardOptions(commonText.removeFromFolderOption))
|
||||
// .verifyVisibleElement("have.text", commonText.removeFromFolderOption)
|
||||
// .click();
|
||||
// verifyConfirmationModal(commonText.appRemovedFromFolderMessage);
|
||||
|
||||
// cancelModal(commonText.cancelButton);
|
||||
|
||||
// viewAppCardOptions(data.appName);
|
||||
// cy.get(
|
||||
// commonSelectors.appCardOptions(commonText.removeFromFolderOption)
|
||||
// ).click();
|
||||
// cy.get(commonSelectors.buttonSelector(commonText.modalYesButton)).click();
|
||||
// cy.verifyToastMessage(
|
||||
// commonSelectors.toastMessage,
|
||||
// commonText.appRemovedFromFolderTaost,
|
||||
// false
|
||||
// );
|
||||
// cy.get(commonSelectors.modalComponent).should("not.exist");
|
||||
// cy.get(commonSelectors.empytyFolderImage).should("be.visible");
|
||||
// cy.get(commonSelectors.emptyFolderText).verifyVisibleElement(
|
||||
// "have.text",
|
||||
// commonText.emptyFolderText
|
||||
// );
|
||||
// cy.get(commonSelectors.allApplicationsLink).click();
|
||||
// deleteFolder(data.folderName);
|
||||
|
||||
// cy.get(commonSelectors.allApplicationsLink).click();
|
||||
|
||||
// cy.wait(1000);
|
||||
// viewAppCardOptions(data.appName);
|
||||
// cy.wait(2000);
|
||||
// cy.get(commonSelectors.appCardOptions(commonText.exportAppOption)).click();
|
||||
// cy.get(commonSelectors.exportAllButton).click();
|
||||
|
||||
// cy.exec("ls ./cypress/downloads/").then((result) => {
|
||||
// const downloadedAppExportFileName = result.stdout.split("\n")[0];
|
||||
// expect(downloadedAppExportFileName).to.contain.string("app");
|
||||
// });
|
||||
|
||||
// viewAppCardOptions(data.appName);
|
||||
// cy.get(commonSelectors.appCardOptions(commonText.cloneAppOption)).click();
|
||||
// cy.get('[data-cy="clone-app"]').click();
|
||||
// cy.get(".go3958317564")
|
||||
// .should("be.visible")
|
||||
// .and("have.text", dashboardText.appClonedToast);
|
||||
// cy.wait(3000);
|
||||
|
||||
// cy.renameApp(data.cloneAppName);
|
||||
// cy.apiAddComponentToApp(data.cloneAppName, "button", 25, 25);
|
||||
// cy.backToApps();
|
||||
// cy.wait("@appLibrary");
|
||||
// cy.wait(1000);
|
||||
|
||||
// cy.get(commonSelectors.appCard(data.cloneAppName)).should("be.visible");
|
||||
|
||||
// cy.wait(1000);
|
||||
|
||||
// viewAppCardOptions(data.cloneAppName);
|
||||
// cy.get(commonSelectors.deleteAppOption).click();
|
||||
// cy.get(commonSelectors.modalMessage).verifyVisibleElement(
|
||||
// "have.text",
|
||||
// commonText.deleteAppModalMessage(data.cloneAppName)
|
||||
// );
|
||||
// cy.get(
|
||||
// commonSelectors.buttonSelector(commonText.cancelButton)
|
||||
// ).verifyVisibleElement("have.text", commonText.cancelButton);
|
||||
// cy.get(
|
||||
// commonSelectors.buttonSelector(commonText.modalYesButton)
|
||||
// ).verifyVisibleElement("have.text", commonText.modalYesButton);
|
||||
// cancelModal(commonText.cancelButton);
|
||||
|
||||
// viewAppCardOptions(data.cloneAppName);
|
||||
// cy.get(commonSelectors.deleteAppOption).click();
|
||||
// cy.get(commonSelectors.buttonSelector(commonText.modalYesButton)).click();
|
||||
// cy.verifyToastMessage(
|
||||
// commonSelectors.toastMessage,
|
||||
// commonText.appDeletedToast,
|
||||
// false
|
||||
// );
|
||||
// verifyAppDelete(data.cloneAppName);
|
||||
// cy.wait("@appLibrary");
|
||||
|
||||
// cy.deleteApp(data.appName);
|
||||
// verifyAppDelete(data.appName);
|
||||
// });
|
||||
|
||||
it("should verify the elements on empty dashboard", () => {
|
||||
cy.intercept("GET", "/api/metadata", {
|
||||
body: {
|
||||
|
|
@ -171,181 +329,6 @@ describe("dashboard", () => {
|
|||
verifyTooltip(dashboardSelector.modeToggle, "Mode");
|
||||
});
|
||||
|
||||
it.skip("Should verify app card elements and app card operations", () => {
|
||||
const customLayout = {
|
||||
desktop: { top: 100, left: 20 },
|
||||
mobile: { width: 8, height: 50 },
|
||||
};
|
||||
|
||||
cy.apiCreateApp(data.appName);
|
||||
cy.openApp();
|
||||
cy.apiAddComponentToApp(data.appName, "text1", customLayout);
|
||||
|
||||
cy.backToApps();
|
||||
|
||||
cy.wait(500);
|
||||
cy.get(commonSelectors.appCard(data.appName))
|
||||
.parent()
|
||||
.within(() => {
|
||||
cy.get(commonSelectors.appCard(data.appName)).should("be.visible");
|
||||
cy.get(commonSelectors.appTitle(data.appName)).verifyVisibleElement(
|
||||
"have.text",
|
||||
data.appName
|
||||
);
|
||||
cy.get(commonSelectors.appCreationDetails).should("be.visible");
|
||||
|
||||
//Add the edited details
|
||||
});
|
||||
|
||||
viewAppCardOptions(data.appName);
|
||||
cy.get(
|
||||
commonSelectors.appCardOptions(commonText.changeIconOption)
|
||||
).verifyVisibleElement("have.text", commonText.changeIconOption);
|
||||
cy.get(
|
||||
commonSelectors.appCardOptions(commonText.addToFolderOption)
|
||||
).verifyVisibleElement("have.text", commonText.addToFolderOption);
|
||||
cy.get(
|
||||
commonSelectors.appCardOptions(commonText.cloneAppOption)
|
||||
).verifyVisibleElement("have.text", commonText.cloneAppOption);
|
||||
cy.get(
|
||||
commonSelectors.appCardOptions(commonText.exportAppOption)
|
||||
).verifyVisibleElement("have.text", commonText.exportAppOption);
|
||||
cy.get(
|
||||
commonSelectors.appCardOptions(commonText.deleteAppOption)
|
||||
).verifyVisibleElement("have.text", commonText.deleteAppOption);
|
||||
|
||||
modifyAndVerifyAppCardIcon(data.appName);
|
||||
createFolder(data.folderName);
|
||||
|
||||
viewAppCardOptions(data.appName);
|
||||
cy.get(
|
||||
commonSelectors.appCardOptions(commonText.addToFolderOption)
|
||||
).click();
|
||||
verifyModal(
|
||||
dashboardText.addToFolderTitle,
|
||||
dashboardText.addToFolderButton,
|
||||
dashboardSelector.selectFolder
|
||||
);
|
||||
cy.get(dashboardSelector.moveAppText).verifyVisibleElement(
|
||||
"have.text",
|
||||
dashboardText.moveAppText(data.appName)
|
||||
);
|
||||
|
||||
cy.get(dashboardSelector.selectFolder).click();
|
||||
cy.get(commonSelectors.folderList).contains(data.folderName).click();
|
||||
cy.get(dashboardSelector.addToFolderButton).click();
|
||||
cy.verifyToastMessage(
|
||||
commonSelectors.toastMessage,
|
||||
commonText.AddedToFolderToast
|
||||
);
|
||||
|
||||
cy.get(dashboardSelector.folderName(data.folderName)).verifyVisibleElement(
|
||||
"have.text",
|
||||
dashboardText.folderName(`${data.folderName} (1)`)
|
||||
);
|
||||
|
||||
cy.get(dashboardSelector.folderName(data.folderName)).click();
|
||||
cy.get(commonSelectors.appCard(data.appName))
|
||||
.contains(data.appName)
|
||||
.should("be.visible");
|
||||
|
||||
cy.wait(2000);
|
||||
viewAppCardOptions(data.appName);
|
||||
|
||||
cy.get(commonSelectors.appCardOptions(commonText.removeFromFolderOption))
|
||||
.verifyVisibleElement("have.text", commonText.removeFromFolderOption)
|
||||
.click();
|
||||
verifyConfirmationModal(commonText.appRemovedFromFolderMessage);
|
||||
|
||||
cancelModal(commonText.cancelButton);
|
||||
|
||||
cy.wait(3000);
|
||||
viewAppCardOptions(data.appName);
|
||||
cy.get(
|
||||
commonSelectors.appCardOptions(commonText.removeFromFolderOption)
|
||||
).click();
|
||||
cy.get(commonSelectors.buttonSelector(commonText.modalYesButton)).click();
|
||||
cy.verifyToastMessage(
|
||||
commonSelectors.toastMessage,
|
||||
commonText.appRemovedFromFolderTaost
|
||||
);
|
||||
cy.get(commonSelectors.modalComponent).should("not.exist");
|
||||
cy.get(commonSelectors.empytyFolderImage).should("be.visible");
|
||||
cy.get(commonSelectors.emptyFolderText).verifyVisibleElement(
|
||||
"have.text",
|
||||
commonText.emptyFolderText
|
||||
);
|
||||
cy.get(commonSelectors.allApplicationsLink).click();
|
||||
deleteFolder(data.folderName);
|
||||
|
||||
cy.get(commonSelectors.allApplicationsLink).click();
|
||||
|
||||
cy.wait(3000);
|
||||
viewAppCardOptions(data.appName);
|
||||
cy.get(commonSelectors.appCardOptions(commonText.cloneAppOption)).click();
|
||||
cy.get('[data-cy="clone-app"]').click();
|
||||
cy.get(".go3958317564")
|
||||
.should("be.visible")
|
||||
.and("have.text", dashboardText.appClonedToast);
|
||||
cy.wait(3000);
|
||||
cy.renameApp(data.cloneAppName);
|
||||
cy.apiAddComponentToApp(data.cloneAppName, "button", 25, 25);
|
||||
cy.backToApps();
|
||||
cy.wait("@appLibrary");
|
||||
cy.wait(1000);
|
||||
cy.reloadAppForTheElement(data.cloneAppName);
|
||||
|
||||
cy.get(commonSelectors.appCard(data.cloneAppName)).should("be.visible");
|
||||
|
||||
cy.get(commonSelectors.globalDataSourceIcon).click();
|
||||
cy.get(commonSelectors.dashboardIcon).click();
|
||||
cy.wait(3000);
|
||||
cy.reloadAppForTheElement(data.cloneAppName);
|
||||
viewAppCardOptions(data.cloneAppName);
|
||||
cy.get(commonSelectors.appCardOptions(commonText.exportAppOption)).click();
|
||||
cy.get(commonSelectors.exportAllButton).click();
|
||||
|
||||
cy.exec("ls ./cypress/downloads/").then((result) => {
|
||||
const downloadedAppExportFileName = result.stdout.split("\n")[0];
|
||||
expect(downloadedAppExportFileName).to.contain.string("app");
|
||||
});
|
||||
|
||||
cy.wait(3000);
|
||||
cy.reloadAppForTheElement(data.cloneAppName);
|
||||
viewAppCardOptions(data.cloneAppName);
|
||||
cy.get(commonSelectors.deleteAppOption).click();
|
||||
cy.get(commonSelectors.modalMessage).verifyVisibleElement(
|
||||
"have.text",
|
||||
commonText.deleteAppModalMessage(data.cloneAppName)
|
||||
);
|
||||
cy.get(
|
||||
commonSelectors.buttonSelector(commonText.cancelButton)
|
||||
).verifyVisibleElement("have.text", commonText.cancelButton);
|
||||
cy.get(
|
||||
commonSelectors.buttonSelector(commonText.modalYesButton)
|
||||
).verifyVisibleElement("have.text", commonText.modalYesButton);
|
||||
cancelModal(commonText.cancelButton);
|
||||
|
||||
cy.wait(3000);
|
||||
cy.reloadAppForTheElement(data.cloneAppName);
|
||||
viewAppCardOptions(data.cloneAppName);
|
||||
cy.get(commonSelectors.deleteAppOption).click();
|
||||
cy.get(commonSelectors.buttonSelector(commonText.modalYesButton)).click();
|
||||
cy.verifyToastMessage(
|
||||
commonSelectors.toastMessage,
|
||||
commonText.appDeletedToast
|
||||
);
|
||||
verifyAppDelete(data.cloneAppName);
|
||||
cy.wait("@appLibrary");
|
||||
|
||||
cy.deleteApp(data.appName);
|
||||
cy.verifyToastMessage(
|
||||
commonSelectors.toastMessage,
|
||||
commonText.appDeletedToast
|
||||
);
|
||||
verifyAppDelete(data.appName);
|
||||
});
|
||||
|
||||
it("Should verify the app CRUD operation", () => {
|
||||
const customLayout = {
|
||||
desktop: { top: 100, left: 20 },
|
||||
|
|
@ -369,10 +352,7 @@ describe("dashboard", () => {
|
|||
cy.wait("@appLibrary");
|
||||
|
||||
cy.deleteApp(data.appName);
|
||||
cy.verifyToastMessage(
|
||||
commonSelectors.toastMessage,
|
||||
commonText.appDeletedToast
|
||||
);
|
||||
|
||||
verifyAppDelete(data.appName);
|
||||
});
|
||||
|
||||
|
|
@ -493,10 +473,7 @@ describe("dashboard", () => {
|
|||
|
||||
cy.get(commonSelectors.allApplicationsLink).click();
|
||||
cy.deleteApp(data.appName);
|
||||
cy.verifyToastMessage(
|
||||
commonSelectors.toastMessage,
|
||||
commonText.appDeletedToast
|
||||
);
|
||||
|
||||
verifyAppDelete(data.appName);
|
||||
logout();
|
||||
});
|
||||
|
|
@ -204,10 +204,7 @@ describe("Manage Groups", () => {
|
|||
|
||||
cy.wait(2500);
|
||||
cy.deleteApp(data.appName);
|
||||
cy.verifyToastMessage(
|
||||
commonSelectors.toastMessage,
|
||||
commonText.appDeletedToast
|
||||
);
|
||||
|
||||
|
||||
// Folder operations
|
||||
createFolder(data.folderName);
|
||||
|
|
@ -101,11 +101,14 @@ export const navigateToAppEditor = (appName) => {
|
|||
|
||||
export const viewAppCardOptions = (appName) => {
|
||||
cy.wait(1000);
|
||||
cy.reloadAppForTheElement(appName);
|
||||
cy.get(commonSelectors.appCard(appName))
|
||||
.realHover()
|
||||
.find(commonSelectors.appCardOptionsButton)
|
||||
.realHover()
|
||||
cy.contains("div", appName)
|
||||
.parent()
|
||||
.within(() => {
|
||||
cy.get(commonSelectors.appCardOptionsButton).invoke("click");
|
||||
cy.get(commonSelectors.appCardOptionsButton).click();
|
||||
});
|
||||
};
|
||||
|
||||
|
|
@ -185,8 +188,9 @@ export const searchUser = (email) => {
|
|||
};
|
||||
|
||||
export const selectAppCardOption = (appName, appCardOption) => {
|
||||
cy.wait(1000);
|
||||
viewAppCardOptions(appName);
|
||||
cy.get(appCardOption).should("be.visible").click({ force: true });
|
||||
cy.get(appCardOption).should("be.visible").click();
|
||||
};
|
||||
|
||||
export const navigateToDatabase = () => {
|
||||
|
|
|
|||
|
|
@ -239,7 +239,8 @@ export const createRestAPIQuery = (
|
|||
key = "",
|
||||
value = "",
|
||||
url = "",
|
||||
run = true
|
||||
run = true,
|
||||
kind = "restapi"
|
||||
) => {
|
||||
cy.getCookie("tj_auth_token").then((cookie) => {
|
||||
const headers = {
|
||||
|
|
@ -247,7 +248,6 @@ export const createRestAPIQuery = (
|
|||
Cookie: `tj_auth_token=${cookie.value}`,
|
||||
};
|
||||
|
||||
cy.log(Cypress.env("appId"));
|
||||
cy.request({
|
||||
method: "GET",
|
||||
url: `${Cypress.env("server_host")}/api/apps/${Cypress.env("appId")}`,
|
||||
|
|
@ -255,13 +255,13 @@ export const createRestAPIQuery = (
|
|||
}).then((response) => {
|
||||
const editingVersionId = response.body.editing_version.id;
|
||||
|
||||
const data_source_id = Cypress.env(`${dsName}-id`);
|
||||
const data_source_id = Cypress.env(kind);
|
||||
|
||||
const requestBody = {
|
||||
app_id: Cypress.env("appId"),
|
||||
app_version_id: editingVersionId,
|
||||
name: queryName,
|
||||
kind: "restapi",
|
||||
kind: kind,
|
||||
options: {
|
||||
method: "get",
|
||||
url: url,
|
||||
|
|
|
|||
|
|
@ -115,8 +115,8 @@ export const verifyDuplicateVersion = (newVersion = [], version) => {
|
|||
cy.get(appVersionSelectors.createNewVersionButton).click();
|
||||
cy.verifyToastMessage(
|
||||
commonSelectors.toastMessage,
|
||||
// appVersionText.versionNameAlreadyExists
|
||||
"Already exists!"
|
||||
appVersionText.versionNameAlreadyExists
|
||||
// "Already exists!"
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -80,13 +80,21 @@ RUN wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-k
|
|||
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list
|
||||
RUN apt update && apt -y install postgresql-13 postgresql-client-13 supervisor
|
||||
|
||||
# Explicitly create PG main directory with correct ownership
|
||||
RUN mkdir -p /var/lib/postgresql/13/main && \
|
||||
chown -R postgres:postgres /var/lib/postgresql
|
||||
|
||||
RUN mkdir -p /var/log/supervisor /var/run/postgresql && \
|
||||
chown -R postgres:postgres /var/run/postgresql /var/log/supervisor
|
||||
|
||||
# Explicitly create PG main directory with correct ownerships
|
||||
RUN mkdir -p /var/lib/postgresql/13/main && \
|
||||
# Remove existing data and create directory with proper ownership
|
||||
RUN rm -rf /var/lib/postgresql/13/main && \
|
||||
mkdir -p /var/lib/postgresql/13/main && \
|
||||
chown -R postgres:postgres /var/lib/postgresql
|
||||
|
||||
# Initialize PostgreSQL
|
||||
RUN su - postgres -c "/usr/lib/postgresql/13/bin/initdb -D /var/lib/postgresql/13/main"
|
||||
|
||||
# Configure Supervisor to manage PostgREST, ToolJet, and Redis
|
||||
RUN echo "[supervisord] \n" \
|
||||
"nodaemon=true \n" \
|
||||
|
|
|
|||
Loading…
Reference in a new issue