Skip to content

Commit 48bea07

Browse files
committed
replaincg 2 slashes
1 parent 634c7bc commit 48bea07

5 files changed

Lines changed: 23 additions & 3 deletions

File tree

src/AngWorkspace/projects/blockly-swagger/src/lib/BlocklyReturnSwagger.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,9 @@ export class BlocklyReturnSwagger {
610610

611611
code +='};\n';
612612
// console.log("basepath",self.basePath);
613+
if(self.basePath.length>0 && self.basePath.endsWith("/") && key.startsWith("/")){
614+
key=key.substring(1);
615+
}
613616
var partUrl= self.basePath + key;
614617
if(partUrl.startsWith("//")){
615618
partUrl=partUrl.replace("//","/");

src/blockly10/src/BlocklyReusable/BlocklyReturnSwagger.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,11 @@ export default class BlocklyReturnSwagger {
726726

727727
code +='};\n';
728728
// console.log("basepath",self.basePath);
729+
if(self.basePath.length>0 && self.basePath.endsWith("/") && key.startsWith("/")){
730+
key=key.substring(1);
731+
}
729732
var partUrl= self.basePath + key;
733+
console.log("all data",self.basePath, key, partUrl);
730734
if(partUrl.startsWith("//")){
731735
partUrl=partUrl.replace("//","/");
732736
}
@@ -735,7 +739,14 @@ export default class BlocklyReturnSwagger {
735739
if(rootSite.length>0 && partUrl.startsWith(rootSite)){
736740
code +='\n rootSite="";//the root site is in url;\n';
737741
}
742+
743+
if(partUrl.startsWith("/") && rootSite.endsWith("/")){
744+
partUrl=partUrl.substring(1);
745+
}
746+
console.log('final url', rootSite, partUrl);
747+
738748
code += 'var strUrl =rootSite +"'+ partUrl + '";\n';
749+
739750
var paramsQuery = parameters.filter((it:any) => it.in === "query");
740751
if(paramsQuery.length>0){
741752
code += 'strUrl+="?";\n;';

src/blocklyTest/tests/examplesBlockly/configUrl.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ export const testConfig = {
4545
{ name: 'identme', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/identme' },
4646
{ name: 'ipify', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/ipify' },
4747
{ name: 'ipaddy', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/ipaddy' },
48-
{ name: 'objects', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/objects' }
48+
{ name: 'objects', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/objects' },
49+
{ name: 'wait', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/wait' },
4950
],
5051
errorUrls: [
5152
{ name: 'Try Catch Error', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/chucktry' },
@@ -66,7 +67,7 @@ export const testConfig = {
6667
{ name: 'reduce', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/reduce' },
6768
{ name: 'weatherChart', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/weatherChart' },
6869
{ name: 'chart', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/chart' },
69-
{ name: 'wait', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/wait' },
70+
7071
{ name: 'NetCoreBlockly_DemoImage', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/NetCoreBlockly_DemoImage' },
7172
{ name: 'NetCoreBlockly_ConvertCSV', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/NetCoreBlockly_ConvertCSV' },
7273
{ name: 'NetCoreBlockly_SaveCSV', url: 'http://localhost:3000/BlocklyAutomation/automation/loadexample/NetCoreBlockly_SaveCSV' },

src/blocklyTest/tests/examplesBlockly/successful-execution.spec.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { test, expect } from '@playwright/test';
1010
test.describe('API Tests', () => {
1111
testConfig.successUrls.forEach(({ name, url }) => {
1212
test(`${name} - Success Flow`, async ({ page }) => {
13-
13+
test.setTimeout(60_000);
1414
// 1. Navigate to Chuck Norris API example and verify page loads successfully
1515
await page.goto(url);
1616
await expect(page.getByText('Visual API')).toBeVisible();
@@ -25,6 +25,8 @@ test.describe('API Tests', () => {
2525
// 4. Click Execute button and verify successful API call with Chuck Norris joke output and no errors
2626
await page.getByRole('button', { name: 'Execute!' }).click();
2727

28+
await new Promise(f => setTimeout(f, 25 * 1000));
29+
2830
// Verify output contains expected debug messages and Chuck Norris joke
2931
await expect(page.getByText('debug mode:start running code !')).toBeVisible();
3032
await expect(page.getByText('finish running code!')).toBeVisible();

src/react_new_app/my-app/src/BlocklyReusable/BlocklyReturnSwagger.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,9 @@ export default class BlocklyReturnSwagger {
721721

722722
code +='};\n';
723723
// console.log("basepath",self.basePath);
724+
if(self.basePath.length>0 && self.basePath.endsWith("/") && key.startsWith("/")){
725+
key=key.substring(1);
726+
}
724727
var partUrl= self.basePath + key;
725728
if(partUrl.startsWith("//")){
726729
partUrl=partUrl.replace("//","/");

0 commit comments

Comments
 (0)