Skip to content

Commit

Permalink
Merge branch 'release' of github.com:appsmithorg/appsmith into chore/…
Browse files Browse the repository at this point in the history
…create-appsmith-pg-db
  • Loading branch information
abhvsn committed Oct 7, 2024
2 parents d6d34c3 + 95010fd commit e384076
Show file tree
Hide file tree
Showing 87 changed files with 2,550 additions and 278 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/test-build-docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -499,3 +499,32 @@ jobs:
--header 'Authorization: Bearer ${{ secrets.SLACK_APPSMITH_ALERTS_TOKEN }}' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw "$body"
notify-slack-for-pg:
needs: ci-test-result
runs-on: ubuntu-latest

if: ( failure() && github.ref == 'refs/heads/pg' )

steps:
- name: Notify failure on workflow run and on Slack
run: |
set -o errexit
set -o nounset
set -o xtrace
run_url='${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/attempts/${{ github.run_attempt }}'
slack_message="🚨 TBP workflow failed in <$run_url|${{ vars.EDITION }} attempt ${{ github.run_attempt }} (run ${{ github.run_id }})>."
# This is the ChannelId of the proj-postgres-sync channel.
body="$(jq -nc \
--arg channel C07JMLWEXDJ \
--arg text "$slack_message" \
'$ARGS.named'
)"
curl -v https://slack.com/api/chat.postMessage \
--fail-with-body \
--header 'Authorization: Bearer ${{ secrets.SLACK_APPSMITH_ALERTS_TOKEN }}' \
--header 'Content-Type: application/json; charset=utf-8' \
--data-raw "$body"
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ function testPreloadMetadata(viewOrEditMode) {
(link) => (window.CDN_URL ?? "/") + link,
);

const requestsToCompare = unique(
const allRequestsDuringPageLoad = unique(
jsRequests.filter(
(link) =>
// Exclude link bundle requests. We don’t really care about being precise
// with their preloading, as icons aren’t critical for the first paint
!link.includes("-icons."),
),
);
const linksToCompare = unique(
const preloadLinks = unique(
links.filter(
(link) =>
// Exclude link bundle preloads. We don’t really care about being precise
Expand All @@ -132,16 +132,11 @@ function testPreloadMetadata(viewOrEditMode) {
),
);

const actuallyLoadedFiles = `[${
requestsToCompare.length
} items] ${requestsToCompare.sort().join(", ")}`;
const preloadedFiles = `[${linksToCompare.length} items] ${linksToCompare
.sort()
.join(", ")}`;

// Comparing strings instead of deep-equalling arrays because this is the only way
// to see which chunks are actually missing: https://github.com/cypress-io/cypress/issues/4084
cy.wrap(actuallyLoadedFiles).should("equal", preloadedFiles);
// check if req
const isSubset = preloadLinks.every((item) =>
allRequestsDuringPageLoad.includes(item),
);
expect(isSubset).to.be.true;
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ import EditorNavigation, {
} from "../../../../../support/Pages/EditorNavigation";

const ppt =
"https://ssz.sgp1.digitaloceanspaces.com/3ZEO2582C29EA0KKK2/ppt-on-population-pptxafa26c44-208f-46a3-89cc-8a5c020b6863.pptx";
const pngImage =
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRb8umIiCU_K6ac-xS-ni4y6SP7XAd8C7Ms3Q&usqp=CAU";
"http://host.docker.internal:4200/ppt-on-population-pptxafa26c44-208f-46a3-89cc-8a5c020b6863.pptx";
const pngImage = "https://www.appsmith.com/favicon.png";
const jpgImage =
"https://community.appsmith.com/sites/default/files/styles/small_thumbnail/public/2024-03/aws-logo.jpg?itok=yG4bpfFs";
const pdf =
"https://www.learningcontainer.com/wp-content/uploads/2019/09/sample-pdf-file.pdf";
const pdf = "http://host.docker.internal:4200/sample-pdf-file.pdf";

describe(
"DocumentViewer Widget Functionality",
Expand Down Expand Up @@ -212,10 +210,7 @@ describe(
agHelper.AssertElementExist(
locators._widgetInDeployed("documentviewerwidget"),
);
agHelper.AssertContains(
"Current file type is not supported",
"not.exist",
);
agHelper.AssertContains("Current file type is not supported");
deployMode.NavigateBacktoEditor();
//Should not show an jpg image file"
EditorNavigation.SelectEntityByName("DocumentViewer1", EntityType.Widget);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ describe(
{ tags: ["@tag.Widget", "@tag.Modal"] },
function () {
const image = (src: string) => 'img[src="' + src + '"]';
const jpgImg = "https://jpeg.org/images/jpegsystems-home.jpg";
const gifImg =
"https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/5eeea355389655.59822ff824b72.gif";
const jpgImg =
"https://community.appsmith.com/sites/default/files/styles/small_thumbnail/public/2024-03/aws-logo.jpg";
const gifImg = "https://docs.appsmith.com/img/multi-update-sql.gif";

it("1. Modal widget functionality", () => {
entityExplorer.DragDropWidgetNVerify(draggableWidgets.BUTTON);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,31 @@ describe(
_.deployMode.DeployApp();

//_.table.SelectTableRow(1)

_.table.ReadTableRowColumnData(0, 0).then(($cellData) => {
expect($cellData).to.eq("1376499.jpg");
expect($cellData).contains("cube-logo_S50__hLNq.jpeg");
});

_.table.ReadTableRowColumnData(1, 0).then(($cellData) => {
expect($cellData).to.eq("https://wallpaperaccess.com/full/1688623.jpg");
expect($cellData).to.eq(
"https://docs.appsmith.com/img/Appsmith-Login-Screen-Shows-SAML.jpg",
);
});

_.table.ReadTableRowColumnData(2, 0).then(($cellData) => {
expect($cellData).to.eq("2117775.jpg");
expect($cellData).contains("zapier-logo_odZ9wZQ3vY.jpeg");
});

_.table.ReadTableRowColumnData(3, 0).then(($cellData) => {
expect($cellData).to.eq("https://wallpaperaccess.com/full/812632.jpg");
expect($cellData).to.eq(
"https://docs.appsmith.com/img/replyto-logo_6yaZHFIeU.jpeg",
);
});

_.table.AssertURLColumnNavigation(
0,
0,
"https://wallpaperaccess.com/full/1376499.jpg",
"https://docs.appsmith.com/img/cube-logo_S50__hLNq.jpeg",
);
// _.table.AssertURLColumnNavigation(
// 3,
// 0,
// "https://wallpaperaccess.com/full/812632.jpg",
// );

_.deployMode.NavigateBacktoEditor();
});
Expand All @@ -73,31 +71,30 @@ describe(
_.deployMode.DeployApp();

_.table.ReadTableRowColumnData(0, 0).then(($cellData) => {
expect($cellData).to.eq("1376499.jpg");
expect($cellData).contains("cube-logo_S50__hLNq.jpeg");
});

_.table.ReadTableRowColumnData(1, 0).then(($cellData) => {
expect($cellData).to.eq("https://wallpaperaccess.com/full/1688623.jpg");
expect($cellData).to.eq(
"https://docs.appsmith.com/img/Appsmith-Login-Screen-Shows-SAML.jpg",
);
});

_.table.ReadTableRowColumnData(2, 0).then(($cellData) => {
expect($cellData).to.eq("2117775.jpg");
expect($cellData).contains("zapier-logo_odZ9wZQ3vY.jpeg");
});

_.table.ReadTableRowColumnData(3, 0).then(($cellData) => {
expect($cellData).to.eq("https://wallpaperaccess.com/full/812632.jpg");
expect($cellData).to.eq(
"https://docs.appsmith.com/img/replyto-logo_6yaZHFIeU.jpeg",
);
});

_.table.AssertURLColumnNavigation(
1,
0,
"https://wallpaperaccess.com/full/1688623.jpg",
"https://docs.appsmith.com/img/Appsmith-Login-Screen-Shows-SAML.jpg",
);
// _.table.AssertURLColumnNavigation(
// 2,
// 0,
// "https://wallpaperaccess.com/full/2117775.jpg",
// );

_.deployMode.NavigateBacktoEditor();
});
Expand All @@ -114,31 +111,30 @@ describe(
_.deployMode.DeployApp();

_.table.ReadTableRowColumnData(0, 0).then(($cellData) => {
expect($cellData).to.eq("1376499.jpg");
expect($cellData).contains("cube-logo_S50__hLNq.jpeg");
});

_.table.ReadTableRowColumnData(1, 0).then(($cellData) => {
expect($cellData).to.eq("https://wallpaperaccess.com/full/1688623.jpg");
expect($cellData).to.eq(
"https://docs.appsmith.com/img/Appsmith-Login-Screen-Shows-SAML.jpg",
);
});

_.table.ReadTableRowColumnData(2, 0).then(($cellData) => {
expect($cellData).to.eq("2117775.jpg");
expect($cellData).contains("zapier-logo_odZ9wZQ3vY.jpeg");
});

_.table.ReadTableRowColumnData(3, 0).then(($cellData) => {
expect($cellData).to.eq("https://wallpaperaccess.com/full/812632.jpg");
expect($cellData).to.eq(
"https://docs.appsmith.com/img/replyto-logo_6yaZHFIeU.jpeg",
);
});

_.table.AssertURLColumnNavigation(
0,
0,
"https://wallpaperaccess.com/full/1376499.jpg",
"https://docs.appsmith.com/img/cube-logo_S50__hLNq.jpeg",
);
// _.table.AssertURLColumnNavigation(
// 3,
// 0,
// "https://wallpaperaccess.com/full/812632.jpg",
// );

_.deployMode.NavigateBacktoEditor();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const TABLE_DATA_2 = `[
"name": "Barty Crouch",
"status": "APPROVED",
"gender": "",
"avatar": "https://robohash.org/sednecessitatibuset.png?size=100x100&set=set1",
"avatar": "http://host.docker.internal:4200/clouddefaultImage.png",
"email": "barty.crouch@gmail.com",
"address": "St Petersberg #911 4th main",
"createdAt": "2020-03-16T18:00:05.000Z",
Expand All @@ -73,7 +73,7 @@ const TABLE_DATA_2 = `[
"name": "Jenelle Kibbys",
"status": "APPROVED",
"gender": "Female",
"avatar": "https://robohash.org/quiaasperiorespariatur.bmp?size=100x100&set=set1",
"avatar": "http://host.docker.internal:4200/453-200x300.jpg",
"email": "jkibby1@hp.com",
"address": "85 Tennessee Plaza",
"createdAt": "2019-10-04T03:22:23.000Z",
Expand All @@ -84,7 +84,7 @@ const TABLE_DATA_2 = `[
"name": "Demetre",
"status": "APPROVED",
"gender": "Male",
"avatar": "https://robohash.org/iustooptiocum.jpg?size=100x100&set=set1",
"avatar": "http://host.docker.internal:4200/clouddefaultImage.png",
"email": "aaaa@bbb.com",
"address": "262 Saint Paul Park",
"createdAt": "2020-05-01T17:30:50.000Z",
Expand All @@ -95,7 +95,7 @@ const TABLE_DATA_2 = `[
"name": "Tobin Shellibeer",
"status": "APPROVED",
"gender": "Male",
"avatar": "https://robohash.org/odioeumdolores.png?size=100x100&set=set1",
"avatar": "http://host.docker.internal:4200/453-200x300.jpg",
"email": "tshellibeer9@ihg.com",
"address": "4 Ridgeway Lane",
"createdAt": "2019-11-27T06:09:41.000Z",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ describe(
agHelper.AssertElementExist(homePage._appEditIcon);
agHelper.GetNClick(homePage._appEditIcon, 0, true);
agHelper.AssertElementAbsence(locators._loading);
assertHelper.AssertNetworkStatus("@getConsolidatedData", 200, true);
agHelper.GetNClick(inviteModal.locators._shareButton, 0, true);
agHelper.GetNClick(homePage._sharePublicToggle, 0, true);
agHelper.GetNClick(locators._dialogCloseButton, 0, true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ describe(
"Ensure XSS vulnerability are handled",
{ tags: ["@tag.Datasource"] },
() => {
const test_rest_api_url1 = "https://jsonplaceholder.typicode.com/users";
const test_rest_api_url1 =
"http://host.docker.internal:5001/v1/mock-api?records=20";

it("1. Ensures xss scripts are not executed when an API is run.", () => {
apiPage.CreateApi("FirstAPI");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import {
agHelper,
apiPage,
dataManager,
entityExplorer,
jsEditor,
propPane,
Expand Down Expand Up @@ -76,18 +78,25 @@ describe("Tests fetch calls", { tags: ["@tag.JS"] }, () => {
});

it("3. Tests if fetch works with store value", function () {
apiPage.CreateAndFillApi(
dataManager.dsValues[dataManager.defaultEnviorment].mockGenderAge +
`{{this.params.person}}`,
"Gender_Age",
);
apiPage.RunAPI();
entityExplorer.DragDropWidgetNVerify("buttonwidget", 500, 200);
EditorNavigation.SelectEntityByName("Button1", EntityType.Widget);
propPane.TypeTextIntoField("Label", "getUserID");
propPane.TypeTextIntoField("Label", "getUserName");
propPane.EnterJSContext(
"onClick",
`{{fetch('https://jsonplaceholder.typicode.com/todos/1')
.then(res => res.json())
.then(json => storeValue('userId', json.userId))
.then(() => showAlert("UserId: " + appsmith.store.userId))}}`,
`{{(async function(){
const gender = await Gender_Age.run({ person: "sagar" });
storeValue("Gender", gender);
showAlert("Your name is " + appsmith.store.Gender.name);
})()}}`,
);
agHelper.Sleep(2000);
agHelper.ClickButton("getUserID");
agHelper.AssertContains("UserId: 1", "exist");

agHelper.ClickButton("getUserName");
agHelper.AssertContains("Your name is sagar", "exist");
});
});
Loading

0 comments on commit e384076

Please sign in to comment.