Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
39db706
chore: update cursor rules for UI testing guidelines [IDE-1347]
bastiandoetsch Jul 30, 2025
7143403
docs: add comprehensive UI testing implementation plan [IDE-1347]
bastiandoetsch Jul 30, 2025
1008188
test: add enhanced UI testing utilities [IDE-1347]
bastiandoetsch Jul 30, 2025
f6f4eba
test: add SnykUITestBase class for UI tests [IDE-1347]
bastiandoetsch Jul 30, 2025
5db32df
test: add test data builders for UI tests [IDE-1347]
bastiandoetsch Jul 30, 2025
ee73f4b
build: add runUiTests task for UI integration tests [IDE-1347]
bastiandoetsch Jul 30, 2025
d8a4941
test: add SnykAuthPanel UI test example [IDE-1347]
bastiandoetsch Jul 30, 2025
df5c115
test: add SnykToolWindow UI tests [IDE-1347]
bastiandoetsch Jul 30, 2025
d520fe9
fix: add JVM arguments for UI tests to handle Java module restriction…
bastiandoetsch Jul 30, 2025
2513ee4
refactor: simplify UI tests to avoid platform initialization issues […
bastiandoetsch Jul 30, 2025
8fe3cae
feat: add Remote-Robot framework for true E2E UI testing [IDE-1347]
bastiandoetsch Jul 30, 2025
f1da4b6
feat: create comprehensive E2E UI test examples and documentation [ID…
bastiandoetsch Jul 30, 2025
f527e80
fix: upgrade commons-lang3 to fix high severity vulnerability [IDE-1347]
bastiandoetsch Jul 30, 2025
2a92835
feat: add CI/CD workflows and OSS-specific E2E tests [IDE-1347]
bastiandoetsch Jul 30, 2025
8d37adb
fix: resolve compilation errors in E2E tests [IDE-1347]
bastiandoetsch Jul 30, 2025
7ffa187
docs: add UI testing implementation summary [IDE-1347]
bastiandoetsch Jul 30, 2025
cbd1c63
docs: add covered test scenarios to UI testing README [IDE-1347]
bastiandoetsch Jul 30, 2025
0c7991b
feat: implement missing UI tests [IDE-1347]
bastiandoetsch Jul 30, 2025
5b89938
docs: update UI testing README with newly implemented tests [IDE-1347]
bastiandoetsch Jul 30, 2025
cfe87ed
refactor: standardize test reporter action across workflows [IDE-1347]
bastiandoetsch Jul 30, 2025
b260d37
fix: resolve UI test compilation errors [IDE-1347]
bastiandoetsch Jul 30, 2025
c6cfc92
fix: final E2E test compilation fixes [IDE-1347]
bastiandoetsch Jul 30, 2025
f86f41c
fix: update UI test to match actual auth panel content [IDE-1347]
bastiandoetsch Jul 30, 2025
b38b590
fix: update github actions
bastiandoetsch Jul 30, 2025
c88b6cc
fix: resolve UI test issues for CI/CD [IDE-1347]
bastiandoetsch Jul 30, 2025
69a735e
fix: create workaround for UI test SettingsController issue [IDE-1347]
bastiandoetsch Jul 30, 2025
a95789d
fix: update E2E test script to use correct gradle task [IDE-1347]
bastiandoetsch Jul 30, 2025
8e375f5
fix: add required splitMode property to runIdeForUiTests task [IDE-1347]
bastiandoetsch Jul 30, 2025
79db021
docs: add E2E test status documentation [IDE-1347]
bastiandoetsch Jul 30, 2025
d49ec6b
fix: remove unresolved RunIdeBase reference [IDE-1347]
bastiandoetsch Jul 30, 2025
85435d9
docs: add E2E setup verification script [IDE-1347]
bastiandoetsch Jul 30, 2025
4891892
fix: properly configure runIdeForUiTests task registration [IDE-1347]
bastiandoetsch Jul 30, 2025
4e8fbea
fix: configure runIdeForUiTests with proper plugin loading [IDE-1347]
bastiandoetsch Jul 30, 2025
5f44ddc
fix: manually install robot-server plugin in sandbox [IDE-1347]
bastiandoetsch Jul 30, 2025
4f59689
fix: use IntelliJ Platform Testing Extension for robot-server [IDE-1347]
bastiandoetsch Jul 30, 2025
96adc8a
fix: correct E2E test include pattern [IDE-1347]
bastiandoetsch Jul 30, 2025
4025e81
feat: add mode support to UI test script [IDE-1347]
bastiandoetsch Jul 30, 2025
3a4e3ed
fix: improve E2E test task configuration [IDE-1347]
bastiandoetsch Jul 30, 2025
c8c2edc
fix: add project opening step to E2E tests [IDE-1347]
bastiandoetsch Jul 30, 2025
618aa58
fix: update E2E tests to use correct button text [IDE-1347]
bastiandoetsch Jul 30, 2025
0965802
fix: improve E2E test button finding logic [IDE-1347]
bastiandoetsch Jul 30, 2025
a44fbbe
fix: use XPath with accessiblename attribute for button finding [IDE-…
bastiandoetsch Jul 30, 2025
c10d9ac
fix: resolve duplicate variable names in E2E tests [IDE-1347]
bastiandoetsch Jul 30, 2025
a06ef6b
fix: handle multiple elements with same accessible name in E2E tests …
bastiandoetsch Jul 30, 2025
524e24b
fix: add window focus before clicking buttons in E2E tests [IDE-1347]
bastiandoetsch Jul 30, 2025
e58e4c0
fix: improve E2E test VCS dialog interaction [IDE-1347]
bastiandoetsch Jul 30, 2025
5a7fc57
refactor: extract common E2E test logic to base class [IDE-1347]
bastiandoetsch Jul 30, 2025
72c6180
fix: remove duplicate KeyEvent import in SnykIacScanE2ETest [IDE-1347]
bastiandoetsch Jul 30, 2025
41a7ced
fix: improve E2E text field input handling [IDE-1347]
bastiandoetsch Jul 30, 2025
f966f57
chore: remove debug E2E test file [IDE-1347]
bastiandoetsch Jul 30, 2025
8036cc2
fix: improve E2E text field detection and input [IDE-1347]
bastiandoetsch Jul 30, 2025
013dc08
chore: remove temporary test script [IDE-1347]
bastiandoetsch Jul 30, 2025
dcfdd5b
fix: prevent Clone button click before fields are filled [IDE-1347]
bastiandoetsch Jul 30, 2025
255cb7d
feat: add multiple approaches for E2E text field input [IDE-1347]
bastiandoetsch Jul 30, 2025
d00b9e0
fix: correct keyboard navigation for clone dialog [IDE-1347]
bastiandoetsch Jul 30, 2025
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
49 changes: 49 additions & 0 deletions .cursorrules
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
** general **
- always be concise, direct and don't try to appease me.
- DOUBLE CHECK THAT YOUR CHANGES ARE REALLY NEEDED. ALWAYS STICK TO THE GIVEN GOAL, NOT MORE.
- I repeat: don't optimize, don't refactor if not needed.
- Adhere to the rules, fix linting & test issues that are newly introduced.
- the `issueID` is usually specified in the current branch in the format `XXX-XXXX`.
- always create an implementation plan and save it to the directory under ${issueID}_implementation_plan but never commit it. take it as a reference for each step and how to proceed. Get confirmation that the plan is ok.
- Maintain existing code patterns and conventions
- always commit the .cursorrules when they have changed
- add the implementation plan to jira and update it while progressing using the jira mcp tools

** how to implement **
- don't comment what is done, instead comment why something is done if the code is not clear
- always write and update test cases. iterate until they pass.
- please check the build.gradle.kts, gradle.properties and settings.gradle.kts for build manager targets
- use existing mocks, don't write new ones.
- if you use mocks, use mockk to generate them.
- always run the tests after editing.
- always use the linter, fix newly created linting issues
- don't change code that does not need to be changed. only do the minimum changes.
- this is not a library. if files are not used or needed anymore, delete them instead of deprecating them.
- if a tool call fails, analyze why it failed and correct your approach. don't prompt the user for help.
- if you don't know something, read the code instead of assuming it.
- commenting out code to fix errors is not a solution. instead, fix the error.
- don't do shortcuts
- always produce production-ready code
- example code that does not fully implement functionality is not allowed

** security **
- determine the absolute path of the project directory. you can do that e.g. by executing pwd on the shell within the directory.
- always use snyk for sca and code scanning. scan with both tools. you need to pass the absolute path of the directory we are scanning.
- run snyk code tests after each edit. pass the absolute path of the project directory as a parameter
- run snyk sca tests after updating go.mod and pass the absolute path of the project directory as a parameter.
- run snyk sca and code test before committing. if not test data, fix issues before committing.

** fixing issues **
- fix security issues if they are fixable. take the snyk scan results and the test results as input
- don't fix test data

** committing **
- do atomic commits
- when asked to commit, always use conventional commit messages (Conventional Commit Style (Subject + Body)). be descriptive in the body. if you find a JIRA issue (XXX-XXXX) in the branch name, use it as a postfix to the subject line in the format [XXX-XXXX]
- consider all commits in the current branch when committing, to have the context of the current changes.
when asked to push, always use 'git push --set-upstream origin $(git_current_branch)' with git_current_branch being the current branch we are on
- never force push
- never push without asking
- regularly fetch main branch and offer to merge it into git_current_branch
- after pushing offer to create a PR on github. analyze the changes by comparing the current branch ($(git_current_branch)) with origin/main, and craft a PR description and title.
use the github pr template in this repository
1 change: 1 addition & 0 deletions .dccache

Large diffs are not rendered by default.

102 changes: 102 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: E2E Tests

on:
workflow_dispatch:
schedule:
# Run nightly at 2 AM UTC
- cron: '0 2 * * *'

jobs:
e2e-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: "OSS Scan"
test: "SnykOssScanE2ETest"
- name: "Code Security"
test: "SnykCodeSecurityE2ETest"
- name: "IaC Scan"
test: "SnykIacScanE2ETest"
- name: "Authentication"
test: "SnykAuthE2ETest"
- name: "Project Trust"
test: "SnykProjectTrustE2ETest"
- name: "Workflow"
test: "SnykWorkflowE2ETest"

steps:
- uses: actions/checkout@v4

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Download Robot Server Plugin
run: |
mkdir -p build
curl -L "https://plugins.jetbrains.com/plugin/download?rel=true&updateId=465614" -o build/robot-server-plugin.zip

- name: Set up virtual display
run: |
sudo apt-get update
sudo apt-get install -y xvfb
export DISPLAY=:99.0
Xvfb :99 -screen 0 1920x1080x24 > /dev/null 2>&1 &

- name: Build Plugin
run: ./gradlew buildPlugin

- name: Start IDE with Robot Server
env:
DISPLAY: :99.0
run: |
./gradlew runIdeForUiTests &
IDE_PID=$!
echo "IDE_PID=$IDE_PID" >> $GITHUB_ENV

# Wait for IDE to start and robot server to be ready
echo "Waiting for IDE to start..."
for i in {1..60}; do
if curl -s http://localhost:8082 > /dev/null; then
echo "Robot Server is ready!"
break
fi
echo "Waiting for Robot Server... (attempt $i/60)"
sleep 2
done

- name: Run E2E Test - ${{ matrix.name }}
env:
DISPLAY: :99.0
run: ./gradlew test --tests "*${{ matrix.test }}" --info

- name: Stop IDE
if: always()
run: |
if [ ! -z "$IDE_PID" ]; then
kill $IDE_PID || true
fi

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v3
with:
name: e2e-test-results-${{ matrix.test }}
path: |
build/reports/tests/
build/test-results/

- name: Test Report
uses: dorny/test-reporter@v1
if: always()
with:
name: E2E Tests - ${{ matrix.name }}
path: build/test-results/test/*.xml
reporter: java-junit
66 changes: 66 additions & 0 deletions .github/workflows/ui-tests-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: UI Tests - PR

on:
pull_request:
paths:
- 'src/main/kotlin/io/snyk/plugin/ui/**'
- 'src/test/kotlin/io/snyk/plugin/ui/**'
- 'build.gradle.kts'
- '.github/workflows/ui-tests-pr.yml'

jobs:
ui-component-tests:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Setup virtual display
run: |
export DISPLAY=:99
Xvfb :99 -screen 0 1920x1080x24 > /dev/null 2>&1 &
echo "DISPLAY=:99" >> $GITHUB_ENV

- name: Build Plugin
run: ./gradlew buildPlugin --info

- name: Run Component UI Tests
run: ./gradlew runUiTests --tests "*UITest" --info

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: ui-test-results
path: |
build/reports/tests/
build/test-results/

- name: Generate test report
if: always()
uses: dorny/test-reporter@v1
with:
name: 'UI Component Test Results'
path: 'build/test-results/**/*.xml'
reporter: java-junit
fail-on-error: false
137 changes: 137 additions & 0 deletions .github/workflows/ui-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
name: UI Tests

on:
pull_request:
types: [opened, synchronize, reopened]
push:
branches:
- main
workflow_dispatch:

jobs:
ui-tests:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
display: ':99'
- os: macos-latest
display: ':1'
- os: windows-latest
display: ':0'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: wrapper

- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-

- name: Setup display (Linux)
if: runner.os == 'Linux'
run: |
export DISPLAY=${{ matrix.display }}
Xvfb ${{ matrix.display }} -screen 0 1920x1080x24 > /dev/null 2>&1 &

- name: Download Robot Server Plugin
run: |
mkdir -p build
curl -L "https://plugins.jetbrains.com/plugin/download?rel=true&updateId=465614" \
-o "build/robot-server-plugin.zip"

- name: Build Plugin
run: ./gradlew buildPlugin

- name: Run Component UI Tests
run: ./gradlew runUiTests --tests "*UITest" --info
env:
DISPLAY: ${{ matrix.display }}

- name: Run E2E UI Tests (Optional)
if: matrix.os == 'ubuntu-latest' # Run E2E tests only on Linux for now
run: |
# Start IDE with robot server in background
./gradlew runIde \
-Drobot-server.port=8082 \
-Dide.mac.message.dialogs.as.sheets=false \
-Djb.privacy.policy.text="<!--999.999-->" \
-Djb.consents.confirmation.enabled=false \
-Didea.trust.all.projects=true \
-Dide.show.tips.on.startup.default.value=false \
-PrunIdeWithPlugins="build/robot-server-plugin.zip" &

IDE_PID=$!

# Wait for IDE to start
echo "Waiting for IDE to start..."
sleep 60

# Check if robot server is accessible
max_attempts=30
attempt=0
while [ $attempt -lt $max_attempts ]; do
if curl -s "http://localhost:8082" > /dev/null; then
echo "Robot Server is ready!"
break
fi
echo "Waiting for Robot Server... (attempt $((attempt + 1))/$max_attempts)"
sleep 5
attempt=$((attempt + 1))
done

if [ $attempt -eq $max_attempts ]; then
echo "Robot Server failed to start!"
kill $IDE_PID 2>/dev/null || true
exit 1
fi

# Run E2E tests
./gradlew test --tests "*E2ETest" --info || E2E_RESULT=$?

# Stop IDE
kill $IDE_PID 2>/dev/null || true

# Exit with E2E test result
exit ${E2E_RESULT:-0}
env:
DISPLAY: ${{ matrix.display }}
continue-on-error: true # E2E tests are optional for now

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: test-results-${{ matrix.os }}
path: |
build/reports/tests/
build/test-results/

- name: Generate test report
if: always()
uses: dorny/test-reporter@v1
with:
name: 'UI Test Results - ${{ matrix.os }}'
path: 'build/test-results/**/*.xml'
reporter: java-junit
fail-on-error: false
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"java.configuration.updateBuildConfiguration": "automatic"
}
Loading
Loading