Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ export enum Protocol {
MESSAGE_BROKER = "MESSAGE_BROKER",
GRAPHQL = "GRAPHQL",
FTP = "FTP",
SMB = "SMB",
CDC = "CDC"
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { DevantScopes } from "@wso2/wso2-platform-core";

const INTEGRATION_API_MODULES = ["http", "graphql", "tcp"];
const EVENT_INTEGRATION_MODULES = ["kafka", "rabbitmq", "salesforce", "trigger.github", "mqtt", "asb"];
const FILE_INTEGRATION_MODULES = ["ftp", "file"];
const FILE_INTEGRATION_MODULES = ["ftp", "smb", "file"];
const AI_AGENT_MODULE = "ai";

export function findDevantScopeByModule(moduleName: string): DevantScopes | undefined {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { SCOPE } from "../state-machine-types";

const INTEGRATION_API_MODULES = ["http", "graphql", "tcp"];
const EVENT_INTEGRATION_MODULES = ["kafka", "rabbitmq", "salesforce", "trigger.github", "mqtt", "asb"];
const FILE_INTEGRATION_MODULES = ["ftp", "file"];
const FILE_INTEGRATION_MODULES = ["ftp", "smb", "file"];
Comment thread
coderabbitai[bot] marked this conversation as resolved.
const AI_AGENT_MODULE = "ai";

export function findScopeByModule(moduleName: string): SCOPE {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/**
* Copyright (c) 2026, WSO2 LLC. (https://www.wso2.com)
*
* WSO2 LLC. licenses this file to you under the Apache License,
* Version 2.0 (the "License"); you may not use this file except
* in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import { expect, test } from '@playwright/test';
import { addArtifact, initTest, page } from '../utils/helpers';
import { Form, switchToIFrame } from '@wso2/playwright-vscode-tester';
import { ProjectExplorer } from '../utils/pages';
import { DEFAULT_PROJECT_NAME } from '../utils/helpers/setup';

export default function createTests() {
const listenerName = 'smbListener';
test.describe('SMB Integration Tests', {
tag: '@group1',
}, async () => {
test.describe.configure({ mode: 'serial' });
initTest();
test('Create SMB Integration', async ({ }, testInfo) => {
Comment thread
coderabbitai[bot] marked this conversation as resolved.
const testAttempt = testInfo.retry + 1;
console.log('Creating a new service in test attempt: ', testAttempt);
await addArtifact('SMB Integration', 'trigger-smb');
const artifactWebView = await switchToIFrame('WSO2 Integrator: BI', page.page);
if (!artifactWebView) {
throw new Error('WSO2 Integrator: BI webview not found');
}
const form = new Form(page.page, 'WSO2 Integrator: BI', artifactWebView);
await form.switchToFormView(false, artifactWebView);
await form.submit('Create');

const projectExplorer = new ProjectExplorer(page.page);
await projectExplorer.findItem([DEFAULT_PROJECT_NAME, `SMB Integration`], true);

const context = artifactWebView.locator(`text=${listenerName}`);
await context.waitFor();
});

test('Editing SMB Service', async ({ }, testInfo) => {
const testAttempt = testInfo.retry + 1;
console.log('Editing a service in test attempt: ', testAttempt);
const artifactWebView = await switchToIFrame('WSO2 Integrator: BI', page.page);
if (!artifactWebView) {
throw new Error('WSO2 Integrator: BI webview not found');
}

const editBtn = artifactWebView.locator('vscode-button[title="Edit Service"]');
await editBtn.waitFor();
await editBtn.click({ force: true });

const form = new Form(page.page, 'WSO2 Integrator: BI', artifactWebView);
await form.switchToFormView(false, artifactWebView);

await form.fill({
values: {
'host': {
type: 'cmEditor',
value: `127.0.0.6`,
additionalProps: { clickLabel: true, switchMode: 'primary-mode', window: global.window }
}
}
});

await form.submit('Save Changes');

const saveChangesBtn = artifactWebView.locator('#save-changes-btn vscode-button[appearance="primary"]');
await saveChangesBtn.waitFor({ state: 'visible' });
await expect(saveChangesBtn).toHaveClass(/disabled/, { timeout: 5000 });
await expect(saveChangesBtn).toHaveText('Save Changes');
Comment thread
coderabbitai[bot] marked this conversation as resolved.

const backBtn = artifactWebView.locator('[data-testid="back-button"]');
await backBtn.waitFor();
await backBtn.click();

await editBtn.waitFor();

const context = artifactWebView.locator(`text=${listenerName}`);
await context.waitFor();
});

test('Delete SMB Integration', async ({ }, testInfo) => {
const testAttempt = testInfo.retry + 1;
console.log('Deleting SMB integration in test attempt: ', testAttempt);

const artifactWebView = await switchToIFrame('WSO2 Integrator: BI', page.page);
if (!artifactWebView) {
throw new Error('WSO2 Integrator: BI webview not found');
}
const projectExplorer = new ProjectExplorer(page.page);
const serviceTreeItem = await projectExplorer.findItem([DEFAULT_PROJECT_NAME, `SMB Integration`], true);
await serviceTreeItem.click({ button: 'right' });
const deleteButton = page.page.getByRole('button', { name: 'Delete' }).first();
await deleteButton.waitFor({ timeout: 5000 });
await deleteButton.click();
await expect(serviceTreeItem).not.toBeVisible({ timeout: 10000 });
});
});
}
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ import twillioIntegration from './event-integration/twillio.spec';
import githubIntegration from './event-integration/github.spec';

import ftpIntegration from './file-integration/ftp.spec';
import smbIntegration from './file-integration/smb.spec';
import directoryIntegration from './file-integration/directory.spec';

import functionArtifact from './other-artifacts/function.spec';
Expand Down Expand Up @@ -127,6 +128,7 @@ test.describe(githubIntegration);

// <----File Integration Test---->
test.describe(ftpIntegration);
test.describe(smbIntegration);
test.describe(directoryIntegration);

// <----Other Artifacts Test---->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,8 @@ function getCustomEntryNodeIcon(type: string) {
return "bi-asb";
case "ftp":
return "bi-ftp";
case "smb":
return "bi-smb";
case "file":
return "bi-file";
case "mcp":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,8 @@ export function getCustomFileIntegrationIcon(type: string) {
switch (type) {
case "ftp":
return <Icon name="bi-ftp" />;
case "smb":
return <Icon name="bi-smb" />;
case "file":
return <Icon name="bi-file" />;
default:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const EVENT_INTEGRATION_MODULES = [
];
const FILE_INTEGRATION_MODULES = [
"ftp",
"smb",
"file"
];
const AI_AGENT_MODULE = "ai";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface ParametersProps {
onEditClick?: (param: ParameterModel) => void;
showPayload: boolean;
typeLabel?: string;
streamEnabled?: boolean;
}

const ParamLabelContainer = styled.div`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,9 @@ export function FileIntegrationForm(props: FileIntegrationFormProps) {
const [serviceModel, setServiceModel] = useState<ServiceModel>(model);
const [functionModel, setFunctionModel] = useState<FunctionModel | null>(props.functionModel || null);

const protocol = model.moduleName === 'smb' ? Protocol.SMB : Protocol.FTP;
const payloadContext = {
protocol: Protocol.FTP,
protocol,
filterType: functionModel?.name?.metadata?.label || "",
} as GeneralPayloadContext;

Expand Down
Loading