diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 0881d2528d..8e235532cf 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -11,6 +11,7 @@ on: branches: - master - develop + workflow_dispatch: env: BRANCH: ${{ github.event.pull_request.head.ref }} diff --git a/.github/workflows/release-develop.yml b/.github/workflows/release-develop.yml index 87e4f0988a..7ee02ccdd1 100644 --- a/.github/workflows/release-develop.yml +++ b/.github/workflows/release-develop.yml @@ -14,6 +14,7 @@ on: - 'yarn.lock' - 'package.json' - 'yarn.lock' + workflow_dispatch: env: POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }} @@ -26,6 +27,11 @@ jobs: runs-on: ubuntu-latest steps: + - name: Fail if branch is not develop + if: github.ref != 'refs/heads/develop' + run: | + echo "Ref is not develop, you must run this job from develop." + exit 1 - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3fe81dbcd1..359ad4467b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -14,6 +14,7 @@ on: - 'yarn.lock' - 'package.json' - 'yarn.lock' + workflow_dispatch: env: POSTHOG_TOKEN: ${{ secrets.POSTHOG_TOKEN }} @@ -27,6 +28,11 @@ jobs: runs-on: ubuntu-latest steps: + - name: Fail if branch is not master + if: github.ref != 'refs/heads/master' + run: | + echo "Ref is not master, you must run this job from master." + exit 1 - uses: actions/checkout@v2 - uses: actions/setup-node@v1 with: diff --git a/lerna.json b/lerna.json index c9aeb85fbc..aad3485095 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "1.0.130-alpha.0", + "version": "1.0.130-alpha.3", "npmClient": "yarn", "packages": [ "packages/*" diff --git a/packages/backend-core/package.json b/packages/backend-core/package.json index 370f529ed7..96d12dbd13 100644 --- a/packages/backend-core/package.json +++ b/packages/backend-core/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/backend-core", - "version": "1.0.130-alpha.0", + "version": "1.0.130-alpha.3", "description": "Budibase backend core libraries used in server and worker", "main": "src/index.js", "author": "Budibase", diff --git a/packages/bbui/package.json b/packages/bbui/package.json index 162b75f86b..4e71266659 100644 --- a/packages/bbui/package.json +++ b/packages/bbui/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/bbui", "description": "A UI solution used in the different Budibase projects.", - "version": "1.0.130-alpha.0", + "version": "1.0.130-alpha.3", "license": "MPL-2.0", "svelte": "src/index.js", "module": "dist/bbui.es.js", @@ -38,7 +38,7 @@ ], "dependencies": { "@adobe/spectrum-css-workflow-icons": "^1.2.1", - "@budibase/string-templates": "^1.0.130-alpha.0", + "@budibase/string-templates": "^1.0.130-alpha.3", "@spectrum-css/actionbutton": "^1.0.1", "@spectrum-css/actiongroup": "^1.0.1", "@spectrum-css/avatar": "^3.0.2", diff --git a/packages/builder/cypress/integration/templates/HR/hrTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/HR/hrTemplateDetails.spec.js new file mode 100644 index 0000000000..9a00645ced --- /dev/null +++ b/packages/builder/cypress/integration/templates/HR/hrTemplateDetails.spec.js @@ -0,0 +1,62 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify HR Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter HR Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="HR"]').click() + }) + }) + + it("should verify the details option for HR templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + + if (templateNameText == "Job Application Tracker") { + // Template name should include 'applicant-tracking-system' + cy.get('a') + .should('have.attr', 'href').and('contain', 'applicant-tracking-system') + } + else if (templateNameText == "Job Portal App") { + // Template name should include 'job-portal' + const templateNameSplit = templateNameParsed.split('-app')[0] + cy.get('a') + .should('have.attr', 'href').and('contain', templateNameSplit) + } + else { + cy.get('a') + .should('have.attr', 'href').and('contain', templateNameParsed) + } + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/IT/ITTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/IT/ITTemplateDetails.spec.js new file mode 100644 index 0000000000..baebeef60a --- /dev/null +++ b/packages/builder/cypress/integration/templates/IT/ITTemplateDetails.spec.js @@ -0,0 +1,66 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify IT Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter IT Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="IT"]').click() + }) + }) + + it("should verify the details option for IT templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + + if (templateNameText == "Hashicorp Scorecard Template") { + const templateNameSplit = templateNameParsed.split('-template')[0] + cy.get('a') + .should('have.attr', 'href').and('contain', templateNameSplit) + } + else if (templateNameText == "IT Ticketing System") { + const templateNameSplit = templateNameParsed.split('it-')[1] + cy.get('a') + .should('have.attr', 'href').and('contain', templateNameSplit) + } + else if (templateNameText == "IT Incident Report Form") { + const templateNameSplit = templateNameParsed.split('-form')[0] + cy.get('a') + .should('have.attr', 'href').and('contain', templateNameSplit) + } + else { + cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) + } + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/adminPanels/adminPanelsTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/adminPanels/adminPanelsTemplateDetails.spec.js new file mode 100644 index 0000000000..8c76a01126 --- /dev/null +++ b/packages/builder/cypress/integration/templates/adminPanels/adminPanelsTemplateDetails.spec.js @@ -0,0 +1,48 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Admin Panel Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter Admin Panels Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Admin Panels"]').click() + }) + }) + + it("should verify the details option for Admin Panels templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/approvalApps/approvalAppsTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/approvalApps/approvalAppsTemplateDetails.spec.js new file mode 100644 index 0000000000..8fa0d61390 --- /dev/null +++ b/packages/builder/cypress/integration/templates/approvalApps/approvalAppsTemplateDetails.spec.js @@ -0,0 +1,57 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Aproval Apps Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter Approval Apps Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Approval Apps"]').click() + }) + }) + + it("should verify the details option for Approval Apps templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + + if (templateNameText == "Content Approval System") { + // Template name should include 'content-approval' + const templateNameSplit = templateNameParsed.split('-system')[0] + cy.get('a') + .should('have.attr', 'href').and('contain', templateNameSplit) + } + else { + cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) + } + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/businessApps/businessAppsTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/businessApps/businessAppsTemplateDetails.spec.js new file mode 100644 index 0000000000..643c854168 --- /dev/null +++ b/packages/builder/cypress/integration/templates/businessApps/businessAppsTemplateDetails.spec.js @@ -0,0 +1,57 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Business Apps Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter Business Apps Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Business Apps"]').click() + }) + }) + + it("should verify the details option for Business Apps templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + + if (templateNameText == "Employee Check-in/Check-Out Template") { + // Remove / from template name + const templateNameReplace = templateNameParsed.replace(/\//g, "-") + cy.get('a') + .should('have.attr', 'href').and('contain', templateNameReplace) + } + else { + cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) + } + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/directories/directoriesTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/directories/directoriesTemplateDetails.spec.js new file mode 100644 index 0000000000..d763dab9e7 --- /dev/null +++ b/packages/builder/cypress/integration/templates/directories/directoriesTemplateDetails.spec.js @@ -0,0 +1,50 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Directories Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter Directories Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Directories"]').click() + }) + }) + + it("should verify the details option for Directories templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + const templateNameSplit = templateNameParsed.split('-template')[0] + cy.get('a') + .should('have.attr', 'href').and('contain', templateNameSplit) + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/forms/formsTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/forms/formsTemplateDetails.spec.js new file mode 100644 index 0000000000..a8cb30da85 --- /dev/null +++ b/packages/builder/cypress/integration/templates/forms/formsTemplateDetails.spec.js @@ -0,0 +1,48 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Forms Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter Forms Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Forms"]').click() + }) + }) + + it("should verify the details option for Forms templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/healthcare/healthcareTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/healthcare/healthcareTemplateDetails.spec.js new file mode 100644 index 0000000000..02b8c7694e --- /dev/null +++ b/packages/builder/cypress/integration/templates/healthcare/healthcareTemplateDetails.spec.js @@ -0,0 +1,49 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Healthcare Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter Healthcare Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Healthcare"]').click() + }) + }) + + it("should verify the details option for Healthcare templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + + cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/legal/legalTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/legal/legalTemplateDetails.spec.js new file mode 100644 index 0000000000..16715bb5d6 --- /dev/null +++ b/packages/builder/cypress/integration/templates/legal/legalTemplateDetails.spec.js @@ -0,0 +1,48 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Legal Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter Legal Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Legal"]').click() + }) + }) + + it("should verify the details option for Legal templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/logistics/logisticsTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/logistics/logisticsTemplateDetails.spec.js new file mode 100644 index 0000000000..a56cc80a67 --- /dev/null +++ b/packages/builder/cypress/integration/templates/logistics/logisticsTemplateDetails.spec.js @@ -0,0 +1,48 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Logistics Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter Logistics Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Logistics"]').click() + }) + }) + + it("should verify the details option for Logistics templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/manufacturing/manufacturingTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/manufacturing/manufacturingTemplateDetails.spec.js new file mode 100644 index 0000000000..b2809d78ee --- /dev/null +++ b/packages/builder/cypress/integration/templates/manufacturing/manufacturingTemplateDetails.spec.js @@ -0,0 +1,48 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Manufacturing Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter Manufacturing Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Manufacturing"]').click() + }) + }) + + it("should verify the details option for Manufacturing templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/marketing/marketingTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/marketing/marketingTemplateDetails.spec.js new file mode 100644 index 0000000000..2c8840f321 --- /dev/null +++ b/packages/builder/cypress/integration/templates/marketing/marketingTemplateDetails.spec.js @@ -0,0 +1,57 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Marketing Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter Marketing Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Marketing"]').click() + }) + }) + + it("should verify the details option for Marketing templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + + if (templateNameText == "Lead Generation Form") { + // Multi-step lead form + // Template name includes 'multi-step-lead-form' + cy.get('a') + .should('have.attr', 'href').and('contain', 'multi-step-lead-form') + } + else { + cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) + } + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/operations/operationsTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/operations/operationsTemplateDetails.spec.js new file mode 100644 index 0000000000..2665de9e81 --- /dev/null +++ b/packages/builder/cypress/integration/templates/operations/operationsTemplateDetails.spec.js @@ -0,0 +1,48 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Operations Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter Operations Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Operations"]').click() + }) + }) + + it("should verify the details option for Operations templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/portals/portalsTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/portals/portalsTemplateDetails.spec.js new file mode 100644 index 0000000000..5e26948180 --- /dev/null +++ b/packages/builder/cypress/integration/templates/portals/portalsTemplateDetails.spec.js @@ -0,0 +1,77 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Portals Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + }) + + it("should verify the details option for Portal templates", () => { + // Filter Portal Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Portal"]').click() + }) + + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + cy.get('a') + .should('have.attr', 'href').and('contain', templateNameParsed) + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) + + it("should verify the details option for Portals templates", () => { + // Filter Portals Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Portals"]').click() + }) + + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + cy.get('a') + .should('have.attr', 'href').and('contain', templateNameParsed) + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/integration/templates/professionalServices/professionalServicesTemplateDetails.spec.js b/packages/builder/cypress/integration/templates/professionalServices/professionalServicesTemplateDetails.spec.js new file mode 100644 index 0000000000..e8ed18a19c --- /dev/null +++ b/packages/builder/cypress/integration/templates/professionalServices/professionalServicesTemplateDetails.spec.js @@ -0,0 +1,48 @@ +import filterTests from "../../../support/filterTests" + +filterTests(["all"], () => { + context("Verify Professional Services Template Details", () => { + + before(() => { + cy.login() + + // Template navigation + cy.request(`${Cypress.config().baseUrl}/api/applications?status=all`) + .its("body") + .then(val => { + if (val.length > 0) { + cy.get(".spectrum-Button").contains("Templates").click({force: true}) + } + }) + + // Filter Professional Services Templates + cy.get(".template-category-filters").within(() => { + cy.get('[data-cy="Professional Services"]').click() + }) + }) + + it("should verify the details option for Professional Services templates", () => { + cy.get(".template-grid").find(".template-card").its('length') + .then(len => { + // Verify template name is within details link + for (let i = 0; i < len; i++) { + cy.get(".template-card").eq(i).within(() => { + const templateName = cy.get(".template-thumbnail-text") + templateName.invoke('text') + .then(templateNameText => { + const templateNameParsed = templateNameText.toLowerCase().replace(/\s+/g, '-') + cy.get('a').should('have.attr', 'href').and('contain', templateNameParsed) + }) + // Verify correct status from Details link - 200 + cy.get('a') + .then(link => { + cy.request(link.prop('href')) + .its('status') + .should('eq', 200) + }) + }) + } + }) + }) +}) +}) diff --git a/packages/builder/cypress/support/commands.js b/packages/builder/cypress/support/commands.js index 6c2cac5b31..969486364a 100644 --- a/packages/builder/cypress/support/commands.js +++ b/packages/builder/cypress/support/commands.js @@ -77,27 +77,23 @@ Cypress.Commands.add("deleteApp", name => { if (val.length > 0) { if (Cypress.env("TEST_ENV")) { cy.searchForApplication(name) - cy.get(".appTable").within(() => { - cy.get(".spectrum-Icon").eq(1).click() - }) - } else { - const appId = val.reduce((acc, app) => { - if (name === app.name) { - acc = app.appId - } - return acc - }, "") - - if (appId == "") { - return - } - - const appIdParsed = appId.split("_").pop() - const actionEleId = `[data-cy=row_actions_${appIdParsed}]` - cy.get(actionEleId).within(() => { - cy.get(".spectrum-Icon").eq(0).click() - }) } + const appId = val.reduce((acc, app) => { + if (name === app.name) { + acc = app.appId + } + return acc + }, "") + + if (appId == "") { + return + } + + const appIdParsed = appId.split("_").pop() + const actionEleId = `[data-cy=row_actions_${appIdParsed}]` + cy.get(actionEleId).within(() => { + cy.get(".spectrum-Icon").eq(0).click() + }) cy.get(".spectrum-Menu").then($menu => { if ($menu.text().includes("Unpublish")) { diff --git a/packages/builder/package.json b/packages/builder/package.json index 71a6d85bda..569f0ed508 100644 --- a/packages/builder/package.json +++ b/packages/builder/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/builder", - "version": "1.0.130-alpha.0", + "version": "1.0.130-alpha.3", "license": "GPL-3.0", "private": true, "scripts": { @@ -65,10 +65,10 @@ } }, "dependencies": { - "@budibase/bbui": "^1.0.130-alpha.0", - "@budibase/client": "^1.0.130-alpha.0", - "@budibase/frontend-core": "^1.0.130-alpha.0", - "@budibase/string-templates": "^1.0.130-alpha.0", + "@budibase/bbui": "^1.0.130-alpha.3", + "@budibase/client": "^1.0.130-alpha.3", + "@budibase/frontend-core": "^1.0.130-alpha.3", + "@budibase/string-templates": "^1.0.130-alpha.3", "@sentry/browser": "5.19.1", "@spectrum-css/page": "^3.0.1", "@spectrum-css/vars": "^3.0.1", diff --git a/packages/cli/package.json b/packages/cli/package.json index c9653d6a7e..ebdd7677fa 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/cli", - "version": "1.0.130-alpha.0", + "version": "1.0.130-alpha.3", "description": "Budibase CLI, for developers, self hosting and migrations.", "main": "src/index.js", "bin": { diff --git a/packages/client/package.json b/packages/client/package.json index 06a0b3f6c4..c72fdbe660 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/client", - "version": "1.0.130-alpha.0", + "version": "1.0.130-alpha.3", "license": "MPL-2.0", "module": "dist/budibase-client.js", "main": "dist/budibase-client.js", @@ -19,9 +19,9 @@ "dev:builder": "rollup -cw" }, "dependencies": { - "@budibase/bbui": "^1.0.130-alpha.0", - "@budibase/frontend-core": "^1.0.130-alpha.0", - "@budibase/string-templates": "^1.0.130-alpha.0", + "@budibase/bbui": "^1.0.130-alpha.3", + "@budibase/frontend-core": "^1.0.130-alpha.3", + "@budibase/string-templates": "^1.0.130-alpha.3", "@spectrum-css/button": "^3.0.3", "@spectrum-css/card": "^3.0.3", "@spectrum-css/divider": "^1.0.3", diff --git a/packages/frontend-core/package.json b/packages/frontend-core/package.json index dc172cbabd..f054e93ca1 100644 --- a/packages/frontend-core/package.json +++ b/packages/frontend-core/package.json @@ -1,12 +1,12 @@ { "name": "@budibase/frontend-core", - "version": "1.0.130-alpha.0", + "version": "1.0.130-alpha.3", "description": "Budibase frontend core libraries used in builder and client", "author": "Budibase", "license": "MPL-2.0", "svelte": "src/index.js", "dependencies": { - "@budibase/bbui": "^1.0.130-alpha.0", + "@budibase/bbui": "^1.0.130-alpha.3", "lodash": "^4.17.21", "svelte": "^3.46.2" } diff --git a/packages/server/package.json b/packages/server/package.json index beee8b436b..bad7f1a97e 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/server", "email": "hi@budibase.com", - "version": "1.0.130-alpha.0", + "version": "1.0.130-alpha.3", "description": "Budibase Web Server", "main": "src/index.ts", "repository": { @@ -68,10 +68,10 @@ "license": "GPL-3.0", "dependencies": { "@apidevtools/swagger-parser": "^10.0.3", - "@budibase/backend-core": "^1.0.130-alpha.0", - "@budibase/client": "^1.0.130-alpha.0", - "@budibase/pro": "1.0.130-alpha.0", - "@budibase/string-templates": "^1.0.130-alpha.0", + "@budibase/backend-core": "^1.0.130-alpha.3", + "@budibase/client": "^1.0.130-alpha.3", + "@budibase/pro": "1.0.130-alpha.3", + "@budibase/string-templates": "^1.0.130-alpha.3", "@bull-board/api": "^3.7.0", "@bull-board/koa": "^3.7.0", "@elastic/elasticsearch": "7.10.0", diff --git a/packages/server/yarn.lock b/packages/server/yarn.lock index 552e983961..5f506a5b34 100644 --- a/packages/server/yarn.lock +++ b/packages/server/yarn.lock @@ -1014,10 +1014,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.130-alpha.0": - version "1.0.130-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.130-alpha.0.tgz#f6da46473f52d3e513a5eb7f352ae3bde6e61b78" - integrity sha512-DPuqEN8/OHFWPpUcfofjQ33lijsAKGDKc0DEF0QgLJOp2kMtBJa80tGjzTxccCZaFkCC2P5p+8kkMxKZQ6vYdA== +"@budibase/backend-core@1.0.130-alpha.3": + version "1.0.130-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.130-alpha.3.tgz#1e51fb22fc9e6a6db1b588f6111bcf372047797c" + integrity sha512-R9RCmZPoJR+vFRiW5XYBWzImMdhsIRPGI7MJHmigb1/TMB1bKaPDFvjnU5rDQ5Qv6NZ1E81FGmMWvDYOzouV5w== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -1091,12 +1091,12 @@ svelte-flatpickr "^3.2.3" svelte-portal "^1.0.0" -"@budibase/pro@1.0.130-alpha.0": - version "1.0.130-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.130-alpha.0.tgz#ddae5dc39992d7f1c4f021d1e4f5effff687a183" - integrity sha512-R8DvPQ6hpLChOSp0BONwrCHOgYrYDO4r2tF8KzEg4uycZ+jbaKQJs2lZ8wdkCbXGjAHIcRNt+4RKUfa9r2epJw== +"@budibase/pro@1.0.130-alpha.3": + version "1.0.130-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.130-alpha.3.tgz#3311901846b761aa8e57980f8bd1baf36c9d9eb9" + integrity sha512-3QydQ0PGOrC8ho6cvaBFf/xm50+ygFYyy2P0fNj860+khid66lrrr5AGSozqtFCPGCz4vWn0J1irjDBhYSUHlw== dependencies: - "@budibase/backend-core" "1.0.130-alpha.0" + "@budibase/backend-core" "1.0.130-alpha.3" node-fetch "^2.6.1" "@budibase/standard-components@^0.9.139": diff --git a/packages/string-templates/package.json b/packages/string-templates/package.json index a2a1f05c6d..dc38fed2ad 100644 --- a/packages/string-templates/package.json +++ b/packages/string-templates/package.json @@ -1,6 +1,6 @@ { "name": "@budibase/string-templates", - "version": "1.0.130-alpha.0", + "version": "1.0.130-alpha.3", "description": "Handlebars wrapper for Budibase templating.", "main": "src/index.cjs", "module": "dist/bundle.mjs", diff --git a/packages/worker/package.json b/packages/worker/package.json index 7ac3a44e0c..e5b8ab97a1 100644 --- a/packages/worker/package.json +++ b/packages/worker/package.json @@ -1,7 +1,7 @@ { "name": "@budibase/worker", "email": "hi@budibase.com", - "version": "1.0.130-alpha.0", + "version": "1.0.130-alpha.3", "description": "Budibase background service", "main": "src/index.ts", "repository": { @@ -31,9 +31,9 @@ "author": "Budibase", "license": "GPL-3.0", "dependencies": { - "@budibase/backend-core": "^1.0.130-alpha.0", - "@budibase/pro": "1.0.130-alpha.0", - "@budibase/string-templates": "^1.0.130-alpha.0", + "@budibase/backend-core": "^1.0.130-alpha.3", + "@budibase/pro": "1.0.130-alpha.3", + "@budibase/string-templates": "^1.0.130-alpha.3", "@koa/router": "^8.0.0", "@sentry/node": "6.17.7", "@techpass/passport-openidconnect": "^0.3.0", diff --git a/packages/worker/yarn.lock b/packages/worker/yarn.lock index 57b402d43b..fc9b6ac529 100644 --- a/packages/worker/yarn.lock +++ b/packages/worker/yarn.lock @@ -293,10 +293,10 @@ resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39" integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== -"@budibase/backend-core@1.0.130-alpha.0": - version "1.0.130-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.130-alpha.0.tgz#f6da46473f52d3e513a5eb7f352ae3bde6e61b78" - integrity sha512-DPuqEN8/OHFWPpUcfofjQ33lijsAKGDKc0DEF0QgLJOp2kMtBJa80tGjzTxccCZaFkCC2P5p+8kkMxKZQ6vYdA== +"@budibase/backend-core@1.0.130-alpha.3": + version "1.0.130-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/backend-core/-/backend-core-1.0.130-alpha.3.tgz#1e51fb22fc9e6a6db1b588f6111bcf372047797c" + integrity sha512-R9RCmZPoJR+vFRiW5XYBWzImMdhsIRPGI7MJHmigb1/TMB1bKaPDFvjnU5rDQ5Qv6NZ1E81FGmMWvDYOzouV5w== dependencies: "@techpass/passport-openidconnect" "^0.3.0" aws-sdk "^2.901.0" @@ -321,12 +321,12 @@ uuid "^8.3.2" zlib "^1.0.5" -"@budibase/pro@1.0.130-alpha.0": - version "1.0.130-alpha.0" - resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.130-alpha.0.tgz#ddae5dc39992d7f1c4f021d1e4f5effff687a183" - integrity sha512-R8DvPQ6hpLChOSp0BONwrCHOgYrYDO4r2tF8KzEg4uycZ+jbaKQJs2lZ8wdkCbXGjAHIcRNt+4RKUfa9r2epJw== +"@budibase/pro@1.0.130-alpha.3": + version "1.0.130-alpha.3" + resolved "https://registry.yarnpkg.com/@budibase/pro/-/pro-1.0.130-alpha.3.tgz#3311901846b761aa8e57980f8bd1baf36c9d9eb9" + integrity sha512-3QydQ0PGOrC8ho6cvaBFf/xm50+ygFYyy2P0fNj860+khid66lrrr5AGSozqtFCPGCz4vWn0J1irjDBhYSUHlw== dependencies: - "@budibase/backend-core" "1.0.130-alpha.0" + "@budibase/backend-core" "1.0.130-alpha.3" node-fetch "^2.6.1" "@cspotcode/source-map-consumer@0.8.0":