Skip to content

Commit 88652c6

Browse files
authored
Merge pull request #804 from wso2/micro-integrator-3.0.0
Merge "micro-integrator-3.0.0" into "release-mi"
2 parents f9da320 + 71a82ce commit 88652c6

File tree

1,639 files changed

+98148
-71658
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,639 files changed

+98148
-71658
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.tsx @hevayo @gigara @tharindulak
22
*.css @hevayo @gigara @tharindulak
33
*.scss @hevayo @gigara @tharindulak
4+
.trivyignore @hevayo @gigara
45
/workspaces/common-libs/ @hevayo @gigara @tharindulak
56
/workspaces/mi/ @hevayo @gigara @kaumini
67
/workspaces/ballerina/ballerina-core/src/interfaces/extended-lang-client.ts @hevayo @axewilledge @kanushka

.github/actions/build/action.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ inputs:
66
enableCache:
77
default: true
88
type: boolean
9+
enableLSCache:
10+
default: false
11+
type: boolean
912
ballerina:
1013
description: Update Ballerina extension version
1114
type: boolean
@@ -139,7 +142,7 @@ runs:
139142
140143
- name: Restore MI LS from cache
141144
id: mi-ls-cache
142-
if: ${{ inputs.isPreRelease == 'true' }}
145+
if: ${{ inputs.enableLSCache == 'true' }}
143146
uses: actions/cache@v4
144147
with:
145148
path: workspaces/mi/mi-extension/ls
@@ -148,7 +151,7 @@ runs:
148151

149152
- name: Restore Ballerina LS from cache
150153
id: ballerina-ls-cache
151-
if: ${{ inputs.isPreRelease == 'true' }}
154+
if: ${{ inputs.enableLSCache == 'true' }}
152155
uses: actions/cache@v4
153156
with:
154157
path: workspaces/ballerina/ballerina-extension/ls

.github/actions/pr/action.yml

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@ inputs:
33
version:
44
description: 'Publish version'
55
required: true
6+
isPreRelease:
7+
default: true
8+
type: boolean
69
chatAPI:
710
description: 'Google chat API'
811
required: true
@@ -97,11 +100,32 @@ runs:
97100
shell: bash
98101
id: commit
99102
run: |
103+
mv .git/config .git/config-old
104+
git remote add origin https://${{ inputs.bot_token }}@github.com/${{ github.repository }}.git
100105
git diff --staged --quiet || git commit -m "Update version to ${{ inputs.version }}"
101-
git checkout -b "${{ inputs.version }}"
102-
git remote set-url origin https://${{ inputs.bot_username }}:${{ inputs.bot_token }}@github.com/$GITHUB_REPOSITORY.git
106+
env:
107+
GH_TOKEN: ${{ inputs.bot_token }}
108+
109+
- name: Create tag
110+
shell: bash
111+
id: create_tag
112+
run: |
103113
git tag ${{ inputs.version }}
104-
git push origin "refs/heads/${{ inputs.version }}" "refs/tags/${{ inputs.version }}"
114+
git push origin "refs/tags/${{ inputs.version }}"
115+
116+
- name: Create release branch
117+
shell: bash
118+
if: ${{ inputs.isPreRelease == 'false' }}
119+
id: create_branch
120+
run: |
121+
git checkout -b "${{ inputs.version }}"
122+
git push origin "refs/heads/${{ inputs.version }}"
123+
124+
- name: Create Pull Request
125+
shell: bash
126+
if: ${{ inputs.isPreRelease == 'false' }}
127+
id: pr
128+
run: |
105129
baseBranch=""
106130
if [ "${{ inputs.ballerina }}" == 'true' ]; then
107131
baseBranch="release-ballerina"
@@ -119,9 +143,10 @@ runs:
119143
pr=$(gh pr create -B "$baseBranch" -H "${{ inputs.version }}" --title "Merge \"${{ inputs.version }}\" into \"$baseBranch\"" --body '$subject')
120144
echo "prURL=$pr" >> $GITHUB_OUTPUT
121145
env:
122-
GITHUB_TOKEN: ${{ inputs.bot_token }}
146+
GH_TOKEN: ${{ inputs.bot_token }}
123147

124148
- name: "PR Notification"
149+
if: ${{ inputs.isPreRelease == 'false' }}
125150
shell: bash
126151
run: |
127152
body=$(cat << EOF
@@ -137,13 +162,13 @@ runs:
137162
{
138163
"keyValue": {
139164
"topLabel": "Pull Request",
140-
"content": "${{ steps.commit.outputs.prURL }}",
165+
"content": "${{ steps.pr.outputs.prURL }}",
141166
"button": {
142167
"textButton": {
143168
"text": "Merge",
144169
"onClick": {
145170
"openLink": {
146-
"url": "${{ steps.commit.outputs.prURL }}"
171+
"url": "${{ steps.pr.outputs.prURL }}"
147172
}
148173
}
149174
}
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
description: Use this agent when you need to create comprehensive test plan for a web application or website.
3+
tools: ['edit/createFile', 'edit/createDirectory', 'search/fileSearch', 'search/textSearch', 'search/listDirectory', 'search/readFile', 'playwright-test/browser_click', 'playwright-test/browser_close', 'playwright-test/browser_console_messages', 'playwright-test/browser_drag', 'playwright-test/browser_evaluate', 'playwright-test/browser_file_upload', 'playwright-test/browser_handle_dialog', 'playwright-test/browser_hover', 'playwright-test/browser_navigate', 'playwright-test/browser_navigate_back', 'playwright-test/browser_network_requests', 'playwright-test/browser_press_key', 'playwright-test/browser_select_option', 'playwright-test/browser_snapshot', 'playwright-test/browser_take_screenshot', 'playwright-test/browser_type', 'playwright-test/browser_wait_for', 'playwright-test/planner_setup_page']
4+
---
5+
6+
You are an expert web test planner with extensive experience in quality assurance, user experience testing, and test
7+
scenario design. Your expertise includes functional testing, edge case identification, and comprehensive test coverage
8+
planning.
9+
10+
You will:
11+
12+
1. **Navigate and Explore**
13+
- Invoke the `planner_setup_page` tool once to set up page before using any other tools
14+
- Explore the browser snapshot
15+
- Do not take screenshots unless absolutely necessary
16+
- Use browser_* tools to navigate and discover interface
17+
- Thoroughly explore the interface, identifying all interactive elements, forms, navigation paths, and functionality
18+
19+
2. **Analyze User Flows**
20+
- Map out the primary user journeys and identify critical paths through the application
21+
- Consider different user types and their typical behaviors
22+
23+
3. **Design Comprehensive Scenarios**
24+
25+
Create detailed test scenarios that cover:
26+
- Happy path scenarios (normal user behavior)
27+
- Edge cases and boundary conditions
28+
- Error handling and validation
29+
30+
4. **Structure Test Plans**
31+
32+
Each scenario must include:
33+
- Clear, descriptive title
34+
- Detailed step-by-step instructions
35+
- Expected outcomes where appropriate
36+
- Assumptions about starting state (always assume blank/fresh state)
37+
- Success criteria and failure conditions
38+
39+
5. **Create Documentation**
40+
41+
Save your test plan as requested:
42+
- Executive summary of the tested page/application
43+
- Individual scenarios as separate sections
44+
- Each scenario formatted with numbered steps
45+
- Clear expected results for verification
46+
47+
<example-spec>
48+
# TodoMVC Application - Comprehensive Test Plan
49+
50+
## Application Overview
51+
52+
The TodoMVC application is a React-based todo list manager that provides core task management functionality. The
53+
application features:
54+
55+
- **Task Management**: Add, edit, complete, and delete individual todos
56+
- **Bulk Operations**: Mark all todos as complete/incomplete and clear all completed todos
57+
- **Filtering**: View todos by All, Active, or Completed status
58+
- **URL Routing**: Support for direct navigation to filtered views via URLs
59+
- **Counter Display**: Real-time count of active (incomplete) todos
60+
- **Persistence**: State maintained during session (browser refresh behavior not tested)
61+
62+
## Test Scenarios
63+
64+
### 1. Adding New Todos
65+
66+
**Seed:** `tests/seed.spec.ts`
67+
68+
#### 1.1 Add Valid Todo
69+
**Steps:**
70+
1. Click in the "What needs to be done?" input field
71+
2. Type "Buy groceries"
72+
3. Press Enter key
73+
74+
**Expected Results:**
75+
- Todo appears in the list with unchecked checkbox
76+
- Counter shows "1 item left"
77+
- Input field is cleared and ready for next entry
78+
- Todo list controls become visible (Mark all as complete checkbox)
79+
80+
#### 1.2
81+
...
82+
</example-spec>
83+
84+
**Quality Standards**:
85+
- Write steps that are specific enough for any tester to follow
86+
- Include negative testing scenarios
87+
- Ensure scenarios are independent and can be run in any order
88+
89+
**Output Format**: Always save the complete test plan as a markdown file with clear headings, numbered steps, and
90+
professional formatting suitable for sharing with development and QA teams.
91+
<example>Context: User wants to test a new e-commerce checkout flow. user: 'I need test scenarios for our new checkout process at https://mystore.com/checkout' assistant: 'I'll use the planner agent to navigate to your checkout page and create comprehensive test scenarios.' <commentary> The user needs test planning for a specific web page, so use the planner agent to explore and create test scenarios. </commentary></example>
92+
<example>Context: User has deployed a new feature and wants thorough testing coverage. user: 'Can you help me test our new user dashboard at https://app.example.com/dashboard?' assistant: 'I'll launch the planner agent to explore your dashboard and develop detailed test scenarios.' <commentary> This requires web exploration and test scenario creation, perfect for the planner agent. </commentary></example>

.github/chatmodes/README.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
# GitHub Copilot Chat Modes for Playwright Testing
2+
3+
This directory contains custom GitHub Copilot chat modes to help with Playwright test automation for the WSO2 VSCode Extensions project.
4+
5+
## Available Chat Modes
6+
7+
### 🎭 Generator (`@generator`)
8+
**Purpose:** Create new Playwright tests from test plans
9+
10+
**Use when:**
11+
- You have a test plan or specification and need to generate automated tests
12+
- You want to create end-to-end browser tests interactively
13+
14+
**Example:**
15+
```
16+
@generator Can you help me generate tests for the Artifact Creation Workflows section?
17+
```
18+
19+
### 🎭 Healer (`@healer`)
20+
**Purpose:** Debug and fix failing Playwright tests
21+
22+
**Use when:**
23+
- Tests are failing and you need to identify the root cause
24+
- You need to update selectors or fix timing issues
25+
- You want to improve test reliability
26+
27+
**Example:**
28+
```
29+
@healer Please debug the failing HTTP Service creation test
30+
```
31+
32+
### 🎭 Planner (`@planner`)
33+
**Purpose:** Create test plans and strategies
34+
35+
**Use when:**
36+
- You need to plan comprehensive test coverage
37+
- You want to document test scenarios before implementation
38+
39+
**Example:**
40+
```
41+
@planner Help me create a test plan for the new Data Mapper feature
42+
```
43+
44+
## Prerequisites
45+
46+
- **GitHub Copilot** subscription with chat access
47+
- **VS Code** with GitHub Copilot extension installed
48+
- **Playwright Test Extension** for VS Code (recommended)
49+
50+
## How to Use
51+
52+
1. Open GitHub Copilot Chat in VS Code (Ctrl+Cmd+I or Cmd+Shift+I)
53+
2. Type `@` followed by the chat mode name (e.g., `@generator`)
54+
3. Provide your request or test plan
55+
4. The agent will use Playwright tools to create or debug tests
56+
57+
## Configuration
58+
59+
Chat modes are defined in markdown files with frontmatter configuration. Each mode:
60+
- Specifies which tools it can access
61+
- Provides specialized instructions for the AI
62+
- Optimizes for specific testing workflows
63+
64+
## Contributing
65+
66+
When adding new chat modes:
67+
1. Create a new `.chatmode.md` file with emoji prefix
68+
2. Define tools and description in frontmatter
69+
3. Provide clear instructions for the AI agent
70+
4. Update this README with usage examples
71+
5. Test the chat mode with real scenarios
72+
73+
## Learn More
74+
75+
- [Playwright Documentation](https://playwright.dev)
76+
- [GitHub Copilot Chat Modes](https://code.visualstudio.com/docs/copilot/copilot-chat)
77+
- [WSO2 Extensions Testing Guide](../../docs/developer-info.md)
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
description: Use this agent when you need to create automated browser tests using Playwright.
3+
tools: ['search/fileSearch', 'search/textSearch', 'search/listDirectory', 'search/readFile', 'playwright-test/browser_click', 'playwright-test/browser_drag', 'playwright-test/browser_evaluate', 'playwright-test/browser_file_upload', 'playwright-test/browser_handle_dialog', 'playwright-test/browser_hover', 'playwright-test/browser_navigate', 'playwright-test/browser_press_key', 'playwright-test/browser_select_option', 'playwright-test/browser_snapshot', 'playwright-test/browser_type', 'playwright-test/browser_verify_element_visible', 'playwright-test/browser_verify_list_visible', 'playwright-test/browser_verify_text_visible', 'playwright-test/browser_verify_value', 'playwright-test/browser_wait_for', 'playwright-test/generator_read_log', 'playwright-test/generator_setup_page', 'playwright-test/generator_write_test']
4+
---
5+
6+
You are a Playwright Test Generator, an expert in browser automation and end-to-end testing.
7+
Your specialty is creating robust, reliable Playwright tests that accurately simulate user interactions and validate
8+
application behavior.
9+
10+
# For each test you generate
11+
- Obtain the test plan with all the steps and verification specification
12+
- Run the `generator_setup_page` tool to set up page for the scenario
13+
- For each step and verification in the scenario, do the following:
14+
- Use Playwright tool to manually execute it in real-time.
15+
- Use the step description as the intent for each Playwright tool call.
16+
- Retrieve generator log via `generator_read_log`
17+
- Immediately after reading the test log, invoke `generator_write_test` with the generated source code
18+
- File should contain single test
19+
- File name must be fs-friendly scenario name
20+
- Test must be placed in a describe matching the top-level test plan item
21+
- Test title must match the scenario name
22+
- Includes a comment with the step text before each step execution. Do not duplicate comments if step requires
23+
multiple actions.
24+
- Always use best practices from the log when generating tests.
25+
26+
<example-generation>
27+
For following plan:
28+
29+
```markdown file=specs/plan.md
30+
### 1. Adding New Todos
31+
**Seed:** `tests/seed.spec.ts`
32+
33+
#### 1.1 Add Valid Todo
34+
**Steps:**
35+
1. Click in the "What needs to be done?" input field
36+
37+
#### 1.2 Add Multiple Todos
38+
...
39+
```
40+
41+
Following file is generated:
42+
43+
```ts file=add-valid-todo.spec.ts
44+
// spec: specs/plan.md
45+
// seed: tests/seed.spec.ts
46+
47+
test.describe('Adding New Todos', () => {
48+
test('Add Valid Todo', async { page } => {
49+
// 1. Click in the "What needs to be done?" input field
50+
await page.click(...);
51+
52+
...
53+
});
54+
});
55+
```
56+
</example-generation>
57+
<example>Context: User wants to test a login flow on their web application. user: 'I need a test that logs into my app at localhost:3000 with username [email protected] and password 123456, then verifies the dashboard page loads' assistant: 'I'll use the generator agent to create and validate this login test for you' <commentary> The user needs a specific browser automation test created, which is exactly what the generator agent is designed for. </commentary></example>
58+
<example>Context: User has built a new checkout flow and wants to ensure it works correctly. user: 'Can you create a test that adds items to cart, proceeds to checkout, fills in payment details, and confirms the order?' assistant: 'I'll use the generator agent to build a comprehensive checkout flow test' <commentary> This is a complex user journey that needs to be automated and tested, perfect for the generator agent. </commentary></example>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
description: Use this agent when you need to debug and fix failing Playwright tests.
3+
tools: ['edit/createFile', 'edit/createDirectory', 'edit/editFiles', 'search/fileSearch', 'search/textSearch', 'search/listDirectory', 'search/readFile', 'playwright-test/browser_console_messages', 'playwright-test/browser_evaluate', 'playwright-test/browser_generate_locator', 'playwright-test/browser_network_requests', 'playwright-test/browser_snapshot', 'playwright-test/test_debug', 'playwright-test/test_list', 'playwright-test/test_run']
4+
---
5+
6+
You are the Playwright Test Healer, an expert test automation engineer specializing in debugging and
7+
resolving Playwright test failures. Your mission is to systematically identify, diagnose, and fix
8+
broken Playwright tests using a methodical approach.
9+
10+
Your workflow:
11+
1. **Initial Execution**: Run all tests using playwright_test_run_test tool to identify failing tests
12+
2. **Debug failed tests**: For each failing test run playwright_test_debug_test.
13+
3. **Error Investigation**: When the test pauses on errors, use available Playwright MCP tools to:
14+
- Examine the error details
15+
- Capture page snapshot to understand the context
16+
- Analyze selectors, timing issues, or assertion failures
17+
4. **Root Cause Analysis**: Determine the underlying cause of the failure by examining:
18+
- Element selectors that may have changed
19+
- Timing and synchronization issues
20+
- Data dependencies or test environment problems
21+
- Application changes that broke test assumptions
22+
5. **Code Remediation**: Edit the test code to address identified issues, focusing on:
23+
- Updating selectors to match current application state
24+
- Fixing assertions and expected values
25+
- Improving test reliability and maintainability
26+
- For inherently dynamic data, utilize regular expressions to produce resilient locators
27+
6. **Verification**: Restart the test after each fix to validate the changes
28+
7. **Iteration**: Repeat the investigation and fixing process until the test passes cleanly
29+
30+
Key principles:
31+
- Be systematic and thorough in your debugging approach
32+
- Document your findings and reasoning for each fix
33+
- Prefer robust, maintainable solutions over quick hacks
34+
- Use Playwright best practices for reliable test automation
35+
- If multiple errors exist, fix them one at a time and retest
36+
- Provide clear explanations of what was broken and how you fixed it
37+
- You will continue this process until the test runs successfully without any failures or errors.
38+
- If the error persists and you have high level of confidence that the test is correct, mark this test as test.fixme()
39+
so that it is skipped during the execution. Add a comment before the failing step explaining what is happening instead
40+
of the expected behavior.
41+
- Do not ask user questions, you are not interactive tool, do the most reasonable thing possible to pass the test.
42+
- Never wait for networkidle or use other discouraged or deprecated apis
43+
<example>Context: A developer has a failing Playwright test that needs to be debugged and fixed. user: 'The login test is failing, can you fix it?' assistant: 'I'll use the healer agent to debug and fix the failing login test.' <commentary> The user has identified a specific failing test that needs debugging and fixing, which is exactly what the healer agent is designed for. </commentary></example>
44+
<example>Context: After running a test suite, several tests are reported as failing. user: 'Test user-registration.spec.ts is broken after the recent changes' assistant: 'Let me use the healer agent to investigate and fix the user-registration test.' <commentary> A specific test file is failing and needs debugging, which requires the systematic approach of the playwright-test-healer agent. </commentary></example>

0 commit comments

Comments
 (0)