Skip to content

Commit

Permalink
chore: Replacing ted api call for resources (#36472)
Browse files Browse the repository at this point in the history
## Description
Remove third party url. 

Fixes `https://github.com/appsmithorg/appsmith/issues/36535`

## Automation

/ok-to-test tags="@tag.All"

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!TIP]
> 🟢 🟢 🟢 All cypress tests have passed! 🎉 🎉 🎉
> Workflow run:
<https://github.com/appsmithorg/appsmith/actions/runs/11031926377>
> Commit: bf5f295
> <a
href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=11031926377&attempt=1"
target="_blank">Cypress dashboard</a>.
> Tags: `@tag.All`
> Spec:
> <hr>Wed, 25 Sep 2024 12:37:04 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [x] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

## Summary by CodeRabbit

- **New Features**
- Updated various image and URL references in test configurations to
point to local resources instead of external links, improving
consistency and performance during testing.

- **Bug Fixes**
- Corrected image source URLs in multiple test files to ensure proper
loading of images in the application.

- **Chores**
- Replaced outdated URLs with local Docker host URLs across numerous
test files and configurations.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
  • Loading branch information
sagar-qa007 authored Sep 25, 2024
1 parent 2f2f5a6 commit 73169d1
Show file tree
Hide file tree
Showing 79 changed files with 260 additions and 252 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ describe("UI to Code", { tags: ["@tag.JS"] }, () => {
agHelper.GetNClick(propPane._navigateToType("URL"));
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Enter URL"),
"https://google.com",
"https://www.appsmith.com",
);
agHelper.GetNClick(propPane._actionSelectorPopupClose);
propPane.ValidateJSFieldValue(
"onClick",
`{{showAlert('Hello!', '');navigateTo('https://google.com', {}, 'SAME_WINDOW');}}`,
`{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');}}`,
);

// Add third action
Expand All @@ -80,7 +80,7 @@ describe("UI to Code", { tags: ["@tag.JS"] }, () => {
// Validate the code
propPane.ValidateJSFieldValue(
"onClick",
`{{showAlert('Hello!', '');navigateTo('https://google.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`,
`{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`,
);

// Delete the third action
Expand All @@ -97,7 +97,7 @@ describe("UI to Code", { tags: ["@tag.JS"] }, () => {
// Assert the code for the remaining actions
propPane.ValidateJSFieldValue(
"onClick",
`{{showAlert('Hello!', '');navigateTo('https://google.com', {}, 'SAME_WINDOW');copyToClipboard('text to copy');}}`,
`{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');copyToClipboard('text to copy');}}`,
);

// Delete the first action
Expand All @@ -113,7 +113,7 @@ describe("UI to Code", { tags: ["@tag.JS"] }, () => {
// Assert the code for the remaining actions
propPane.ValidateJSFieldValue(
"onClick",
`{{navigateTo('https://google.com', {}, 'SAME_WINDOW');copyToClipboard('text to copy');}}`,
`{{navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');copyToClipboard('text to copy');}}`,
);
});

Expand All @@ -132,13 +132,13 @@ describe("UI to Code", { tags: ["@tag.JS"] }, () => {
agHelper.GetNClick(propPane._navigateToType("URL"));
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Enter URL"),
"https://google.com",
"https://www.appsmith.com",
);
agHelper.GetNClick(propPane._actionSelectorPopupClose);

propPane.ValidateJSFieldValue(
"onClick",
`{{showAlert('Hello!', '');navigateTo('https://google.com', {}, 'SAME_WINDOW');}}`,
`{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');}}`,
);

// Add third action
Expand All @@ -165,7 +165,7 @@ describe("UI to Code", { tags: ["@tag.JS"] }, () => {

propPane.ValidateJSFieldValue(
"onClick",
`{{showAlert('Hello!', '');navigateTo('https://google.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`,
`{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`,
);

// Delete the third action
Expand Down Expand Up @@ -197,7 +197,7 @@ describe("UI to Code", { tags: ["@tag.JS"] }, () => {

propPane.ValidateJSFieldValue(
"onClick",
`{{showAlert('Hello!', '');navigateTo('https://google.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`,
`{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`,
);
});

Expand All @@ -216,13 +216,13 @@ describe("UI to Code", { tags: ["@tag.JS"] }, () => {
agHelper.GetNClick(propPane._navigateToType("URL"));
agHelper.TypeText(
propPane._actionSelectorFieldByLabel("Enter URL"),
"https://google.com",
"https://www.appsmith.com",
);
agHelper.GetNClick(propPane._actionSelectorPopupClose);

propPane.ValidateJSFieldValue(
"onClick",
`{{showAlert('Hello!', '');navigateTo('https://google.com', {}, 'SAME_WINDOW');}}`,
`{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');}}`,
);

// Add third action
Expand All @@ -249,7 +249,7 @@ describe("UI to Code", { tags: ["@tag.JS"] }, () => {

propPane.ValidateJSFieldValue(
"onClick",
`{{showAlert('Hello!', '');navigateTo('https://google.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`,
`{{showAlert('Hello!', '');navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');storeValue('secret-key', 'secret-value');copyToClipboard('text to copy');}}`,
);

// Delete the third action
Expand Down Expand Up @@ -286,7 +286,7 @@ describe("UI to Code", { tags: ["@tag.JS"] }, () => {

propPane.ValidateJSFieldValue(
"onClick",
`{{navigateTo('https://google.com', {}, 'SAME_WINDOW');copyToClipboard('text to copy');}}`,
`{{navigateTo('https://www.appsmith.com', {}, 'SAME_WINDOW');copyToClipboard('text to copy');}}`,
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ describe("Validate basic Promises", { tags: ["@tag.Binding"] }, () => {
deployMode.NavigateBacktoEditor();
agHelper.AddDsl("promisesBtnImgDsl", locators._buttonByText("Submit"));
apiPage.CreateAndFillApi(
"https://picsum.photos/200/300",
"http://host.docker.internal:4200/453-200x300.jpg",
"RandomImy",
30000,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ describe(
propPane.MoveToTab("Content");

[1, 2, 3, 4, 5].forEach(() => {
apiPage.CreateAndFillApi("http://www.example.com");
apiPage.CreateAndFillApi("https://www.appsmith.com/");
});

EditorNavigation.SelectEntityByName("Table1", EntityType.Widget);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ const setterMethodsToTest = [
property: "url",
widget: WIDGET.AUDIO,
actionBinding:
"{{Audio1.setURL('https://www.youtube.com/watch?v=JGwWNGJdvx8')}}",
"{{Audio1.setURL('http://host.docker.internal:4200/bird.mp4')}}",
valueBinding: "{{Audio1.url}}",
expectedValue: "https://www.youtube.com/watch?v=JGwWNGJdvx8",
expectedValue: "http://host.docker.internal:4200/bird.mp4",
},
{
name: "setPlaying",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ppt =
const pngImage =
"https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRb8umIiCU_K6ac-xS-ni4y6SP7XAd8C7Ms3Q&usqp=CAU";
const jpgImage =
"https://img.frentityExplorerpik.com/frentityExplorer-photo/beautiful-scenery-summit-mount-everest-covered-with-snow-white-clouds_181624-21317.jpg?w=1380&t=st=1691154236~exp=1691154836~hmac=35ce7f92dd16711c69509a0edbb23cedb34e49f960f560c77174994b6d5705a0";
"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";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ describe(
{ tags: ["@tag.Widget", "@tag.Image"] },
function () {
const image = (src: string) => 'img[src="' + src + '"]';
const jpgImg = "https://jpeg.org/images/jpegsystems-home.jpg";
const jpgImg =
"https://community.appsmith.com/sites/default/files/styles/small_thumbnail/public/2024-03/aws-logo.jpg?itok=yG4bpfFs";
const gifImg =
"https://mir-s3-cdn-cf.behance.net/project_modules/max_1200/5eeea355389655.59822ff824b72.gif";
const svgImg = "https://assets.codepen.io/3/kiwi.svg";
const webpImg = "https://www.gstatic.com/webp/gallery/4.sm.webp";
const pngImg = "https://assets.appsmith.com/widgets/default.png";
"https://www.appsmith.com/_next/image?url=https%3A%2F%2Fimages.ctfassets.net%2Flpvian6u6i39%2F5dIHs6B4O8JrcziD01Tzpr%2F080ac2887506afab72a160b897364607%2Fimage-11.gif&w=1080&q=75";
const svgImg = "https://community.appsmith.com/appsmith-community-logo.svg";
const webpImg =
"https://www.appsmith.com/assets/images/animations/widgets/img_0.webp";
const pngImg =
"https://community.appsmith.com/sites/default/files/styles/16_9_card/public/septembercoding-min%20%281%29.png?itok=unYUZ0zm";

before(() => {
entityExplorer.DragDropWidgetNVerify(draggableWidgets.IMAGE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ describe(
"Image widget - Rotation & Download",
{ tags: ["@tag.Widget", "@tag.Image"] },
function () {
const jpgImg = "https://jpeg.org/images/jpegsystems-home.jpg";
const jpgImg =
"https://community.appsmith.com/sites/default/files/styles/small_thumbnail/public/2024-03/aws-logo.jpg?itok=yG4bpfFs";
before(() => {
entityExplorer.DragDropWidgetNVerify(draggableWidgets.IMAGE);
propPane.UpdatePropertyFieldValue("Image", jpgImg);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe(
.invoke("attr", "src")
.should(
"contain",
"https://res.cloudinary.com/drako999/image/upload/v1589196259/default.png",
"http://host.docker.internal:4200/clouddefaultImage.png",
);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ const data = [
{
id: "001",
name: "Blue",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
same: "1",
},
{
id: "002",
name: "Green",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
same: "01",
},
{
id: "003",
name: "Red",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
same: 1,
},
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ const simpleListData1 = [
{
id: "001",
name: "Blue",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
},
{
id: "002",
name: "Green",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
},
{
id: "003",
name: "Red",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
},
];

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ describe(
`{{[{
id: "001",
name: "Blue",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
},
{
id: "002",
name: "Green",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
},
{
id: "003",
name: "Red",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
}]}}`,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@ const data = [
{
id: "001",
name: "Blue",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
},
{
id: "002",
name: "Green",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
},
{
id: "003",
name: "Red",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
},
{
id: "004",
name: "Yellow",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
},
{
id: "005",
name: "Orange",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
},
{
id: "006",
name: "Indigo",
img: "https://assets.appsmith.com/widgets/default.png",
img: "http://host.docker.internal:4200/clouddefaultImage.png",
},
];

Expand Down Expand Up @@ -105,7 +105,7 @@ describe(
const data = JSON.parse(val.text());
const triggeredItemView = {
Image1: {
image: "https://assets.appsmith.com/widgets/default.png",
image: "http://host.docker.internal:4200/clouddefaultImage.png",
isVisible: true,
},
Text1: {
Expand Down Expand Up @@ -137,7 +137,7 @@ describe(
const data = JSON.parse(val.text());
const SelectedRow = {
Image1: {
image: "https://assets.appsmith.com/widgets/default.png",
image: "http://host.docker.internal:4200/clouddefaultImage.png",
isVisible: true,
},
Text1: {
Expand Down Expand Up @@ -198,7 +198,7 @@ describe(
const data = JSON.parse(val.text());
const triggeredItemView = {
Image1: {
image: "https://assets.appsmith.com/widgets/default.png",
image: "http://host.docker.internal:4200/clouddefaultImage.png",
isVisible: true,
},
Text1: {
Expand Down Expand Up @@ -230,7 +230,7 @@ describe(
const data = JSON.parse(val.text());
const selectedItemView = {
Image1: {
image: "https://assets.appsmith.com/widgets/default.png",
image: "http://host.docker.internal:4200/clouddefaultImage.png",
isVisible: true,
},
Text1: {
Expand Down Expand Up @@ -313,7 +313,7 @@ describe(
const data = JSON.parse(val.text());
const triggeredItemView = {
Image1: {
image: "https://assets.appsmith.com/widgets/default.png",
image: "http://host.docker.internal:4200/clouddefaultImage.png",
isVisible: true,
},
Text1: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ describe(

it("3. Column Detail - Edit column name and validate test for computed value based on column type selected (image, button , url)", function () {
// Changing Column data type from "Date" to "Image"
const imageVal =
"https://images.pexels.com/photos/736230/pexels-photo-736230.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500";
const imageVal = "http://host.docker.internal:4200/453-200x300.jpg";

cy.changeColumnType("Image", false);
// "Moement "date" to "Image"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,8 +195,7 @@ describe(
});

// Changing Column data type from "Date" to "Image"
const imageVal =
"https://images.pexels.com/photos/736230/pexels-photo-736230.jpeg?auto=compress&cs=tinysrgb&dpr=1&w=500";
const imageVal = "http://host.docker.internal:4200/453-200x300.jpg";

cy.changeColumnType("Image");
// "Moement "date" to "Image"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ describe(
propPane.ToggleJSMode("onOptionChange", true);
propPane.UpdatePropertyFieldValue(
"onOptionChange",
`{{download('https://assets.codepen.io/3/kiwi.svg', 'kiwi.svg', 'image/svg+xml').then(() => {
`{{download('http://host.docker.internal:4200/kiwi.svg', 'kiwi.svg', 'image/svg+xml').then(() => {
showAlert('Download Success', '');
});}}`,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ describe(
//Check for Non-video url
propPane.TypeTextIntoField(
"URL",
"https://www.pexels.com/photo/closeup-photo-of-brown-brick-wall-1227511/",
"http://host.docker.internal:4200/453-200x300.jpg/",
);
deployMode.DeployApp(locators._widgetInDeployed(draggableWidgets.VIDEO));
agHelper.GetElement(widgetLocators.video).then(($video) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ describe(
"Block Action Execution when no field is present",
{ tags: ["@tag.Datasource"] },
() => {
const url = "https://www.google.com";
const url = "https://www.appsmith.com/";
it("1. Ensure API Run button is disabled when no url is present", () => {
apiPage.CreateApi("FirstAPI", "GET");
apiPage.AssertRunButtonDisability(true);
Expand Down
Loading

0 comments on commit 73169d1

Please sign in to comment.