Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
b09340c
test(apex,lwc): migrate snippet e2e to Playwright - W-22016558
CristiCanizales Apr 14, 2026
f3acf16
Merge branch 'develop' into cristi/snippets-e2e
CristiCanizales Apr 16, 2026
d6f6720
fix: snippets work on Anonymous Apex files
daphne-sfdc Apr 16, 2026
ffaee24
feat: add snippetsE2E.yml workflow
daphne-sfdc Apr 16, 2026
a281a2f
Rename environment variable for Playwright version
CristiCanizales Apr 16, 2026
f46a23d
chore: y ahora
CristiCanizales Apr 17, 2026
bf484b2
Merge branch 'develop' into cristi/snippets-e2e
CristiCanizales Apr 17, 2026
8622d5c
Merge branch 'cristi/snippets-e2e' of github.com:forcedotcom/salesfor…
CristiCanizales Apr 17, 2026
df88079
Merge branch 'develop' into cristi/snippets-e2e
daphne-sfdc Apr 17, 2026
13dbf76
fix: ignore no default org is set error in apex snippets test
daphne-sfdc Apr 17, 2026
741afa4
fix: ignore another error regarding no default org
daphne-sfdc Apr 17, 2026
9e19c57
chore: remove outdated comment
daphne-sfdc Apr 17, 2026
ae5f9c3
Merge branch 'develop' into cristi/snippets-e2e
daphne-sfdc Apr 17, 2026
1a7aca7
fix: apex snippets actually can't run on web
daphne-sfdc Apr 17, 2026
06e5505
chore: completely remove apex snippets web job from snippetsE2E.yml
daphne-sfdc Apr 17, 2026
8f5ba00
chore: casing and plural
daphne-sfdc Apr 17, 2026
4420143
chore: unwire web test from apex package.json
daphne-sfdc Apr 17, 2026
ac59166
chore: remove unneeded playwright.config.web.ts in apex
daphne-sfdc Apr 17, 2026
73bba0e
chore: one more plural
daphne-sfdc Apr 17, 2026
5027411
chore: remove no longer present oas directory from apex tsconfig.json
daphne-sfdc Apr 17, 2026
c13c49c
fix(apex): remove Apex snippets from old Apex extension (#7220)
daphne-sfdc Apr 20, 2026
1c3fe77
chore: remove services dependency for salesforcedx-vscode-apex
daphne-sfdc Apr 20, 2026
4fa7cff
Merge branch 'develop' into cristi/snippets-e2e
daphne-sfdc Apr 20, 2026
44317ed
ci: update workflows
CristiCanizales Apr 20, 2026
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
6 changes: 6 additions & 0 deletions .github/workflows/playwrightE2EFullSuite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,9 @@ jobs:
secrets: inherit
with:
vscode_version: ${{ inputs.vscode_version }}

snippets:
uses: ./.github/workflows/snippetsE2E.yml
secrets: inherit
with:
vscode_version: ${{ inputs.vscode_version }}
216 changes: 216 additions & 0 deletions .github/workflows/snippetsE2E.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
name: Snippets E2E (Playwright)

on:
workflow_dispatch:
inputs:
vscode_version:
description: 'VS Code version for desktop E2E (e.g. 1.116.0). Empty uses repo variable PLAYWRIGHT_VSCODE_VERSION.'
required: false
type: string
default: ''
workflow_call:
inputs:
vscode_version:
description: 'VS Code version for desktop E2E (e.g. 1.116.0). Empty uses repo variable PLAYWRIGHT_VSCODE_VERSION.'
required: false
type: string
default: ''
push:
branches-ignore: [main, develop]
paths-ignore:
- '.claude/**'
- '.cursor/**'
- 'contributing/**'
- 'CONTRIBUTING.md'
- 'docs/**'
- '**/README*'
- 'SECURITY*'
- 'CODE_OF_CONDUCT*'
- 'CHANGELOG*'
- '**/CHANGELOG*'

concurrency:
group: ci-${{ github.ref }}-snippetsE2E
cancel-in-progress: true

jobs:
e2e-web:
runs-on: ubuntu-latest
timeout-minutes: 60
strategy:
matrix:
package: [salesforcedx-vscode-lwc]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'

- uses: google/wireit@setup-github-actions-caching/v2

- name: Install dependencies
uses: salesforcecli/github-workflows/.github/actions/npmInstallWithRetries@main

# Try E2E tests first. When wireit cache hits, it skips the command and exits 0—we never need Playwright.
# When cache misses, tests fail on missing chromium. E2E_NO_RETRIES=1 disables Playwright retries in config
# so failures are fast (env var doesn't affect wireit cache key since it's not part of the npm command).
- name: Try E2E tests
id: try-run
continue-on-error: true
timeout-minutes: 5
env:
CI: 1
E2E_NO_RETRIES: 1
run: |
npm run test:web -w ${{ matrix.package }} -- --reporter=html

- name: Install Playwright browsers and OS deps
if: steps.try-run.outcome == 'failure'
uses: salesforcecli/github-workflows/.github/actions/retry@main
with:
max_attempts: 3
command: npx playwright install chromium --with-deps
retry_wait_seconds: 60

- name: Run E2E tests (parallel)
if: steps.try-run.outcome == 'failure'
id: parallel-run
continue-on-error: true
env:
CI: 1
run: |
npm run test:web -w ${{ matrix.package }} -- --reporter=html

- name: Retry failed tests (sequential)
if: steps.try-run.outcome == 'failure' && steps.parallel-run.outcome == 'failure'
env:
CI: 1
PLAYWRIGHT_WORKERS: 1
run: |
npm run test:web -w ${{ matrix.package }} -- --last-failed --reporter=html

- name: Copy span files to test-results
if: always()
shell: bash
run: |
mkdir -p packages/${{ matrix.package }}/test-results/spans
cp -r ~/.sf/vscode-spans/. packages/${{ matrix.package }}/test-results/spans/ 2>/dev/null || true

- name: Upload Playwright HTML report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.package }}-web
path: packages/${{ matrix.package }}/playwright-report
if-no-files-found: ignore

- name: Upload Playwright Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-test-results-${{ matrix.package }}-web
path: packages/${{ matrix.package }}/test-results
if-no-files-found: ignore

e2e-desktop:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
env:
VSCODE_DESKTOP: 1
PLAYWRIGHT_VSCODE_VERSION: ${{ github.event_name != 'push' && inputs.vscode_version != '' && inputs.vscode_version || vars.PLAYWRIGHT_VSCODE_VERSION }}
strategy:
matrix:
os: [macos-latest, windows-latest]
package: [salesforcedx-vscode-lwc]
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Log desktop VS Code version
shell: bash
run: echo "::notice::VS Code version=${PLAYWRIGHT_VSCODE_VERSION}"

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'

- uses: google/wireit@setup-github-actions-caching/v2

- name: Install dependencies
uses: salesforcecli/github-workflows/.github/actions/npmInstallWithRetries@main

# Try E2E tests first. When wireit cache hits, it skips the command and exits 0—we never need Playwright.
# When cache misses, tests fail on missing chromium. E2E_NO_RETRIES=1 disables Playwright retries in config
# so failures are fast (env var doesn't affect wireit cache key since it's not part of the npm command).
- name: Try E2E tests
id: try-run
continue-on-error: true
timeout-minutes: 5
env:
CI: 1
VSCODE_DESKTOP: 1
E2E_NO_RETRIES: 1
run: |
npm run test:desktop -w ${{ matrix.package }} -- --reporter=html

- name: Install Playwright browsers and OS deps
if: steps.try-run.outcome == 'failure'
uses: salesforcecli/github-workflows/.github/actions/retry@main
with:
max_attempts: 3
command: npx playwright install chromium --with-deps
retry_wait_seconds: 60

- name: Run E2E tests (parallel)
if: steps.try-run.outcome == 'failure'
id: parallel-run
continue-on-error: true
env:
CI: 1
VSCODE_DESKTOP: 1
run: |
npm run test:desktop -w ${{ matrix.package }} -- --reporter=html

- name: Retry failed tests (sequential)
if: steps.try-run.outcome == 'failure' && steps.parallel-run.outcome == 'failure'
env:
CI: 1
VSCODE_DESKTOP: 1
PLAYWRIGHT_WORKERS: 1
run: |
npm run test:desktop -w ${{ matrix.package }} -- --last-failed --reporter=html

- name: Copy span files to test-results
if: always()
shell: bash
run: |
mkdir -p packages/${{ matrix.package }}/test-results/spans
cp -r ~/.sf/vscode-spans/. packages/${{ matrix.package }}/test-results/spans/ 2>/dev/null || true

- name: Upload Playwright HTML report
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-report-${{ matrix.package }}-desktop-${{ matrix.os }}
path: packages/${{ matrix.package }}/playwright-report
if-no-files-found: ignore

- name: Upload Playwright Test Results
if: always()
uses: actions/upload-artifact@v4
with:
name: playwright-test-results-${{ matrix.package }}-desktop-${{ matrix.os }}
path: packages/${{ matrix.package }}/test-results
if-no-files-found: ignore
8 changes: 1 addition & 7 deletions .github/workflows/triggerE2EForCommit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,7 @@ jobs:
# core-sobjects-definitions: removed (sObjectsDefinitions.e2e.ts deleted)
# core-org-browser: removed (orgBrowser.e2e.ts deleted; new org browser has Playwright tests)

core-snippets:
uses: ./.github/workflows/runE2ETest.yml
secrets: inherit
with:
testToRun: 'snippets.e2e.js'
vscodeVersion: ${{ inputs.vscodeVersion || vars.MAX_REDHAT_VSCODE_VERSION || 'latest' }}
runId: ${{ inputs.runId }}
# core-snippets: migrated to Playwright — packages/salesforcedx-vscode-lwc (test:web / test:desktop)

# 📦 Deploy & Retrieve — now covered by core Playwright tests (manifestBuilder, deployAndRetrieve, metadataDeployRetrieve, pushAndPull)

Expand Down
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,7 @@ export default [
'packages/salesforcedx-vscode-org-browser/playwright*.ts',
'packages/salesforcedx-vscode-metadata/playwright*.ts',
'packages/salesforcedx-vscode-apex-log/playwright*.ts',
'packages/salesforcedx-vscode-lwc/playwright*.ts',
'packages/salesforcedx-vscode-core/test/playwright/**/*.ts',
'packages/salesforcedx-vscode-core/playwright*.ts',
'packages/salesforcedx-vscode-org/test/playwright/**/*.ts',
Expand Down
13 changes: 12 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,20 @@ export const createDesktopTest = (options: CreateDesktopTestOptions) => {
'files.simpleDialog.enable': true, // Use VS Code's simple dialog instead of native OS dialog (visible in Electron)
'settingsSync.enabled': false, // Prevent Settings Sync from overwriting test settings
'salesforcedx-vscode-salesforcedx.enableFileTraces': true,
'github.gitAuthentication': false, // Prevent GitHub auth prompts/popups during tests
// Avoid GitHub/Git prompts opening the system browser during local E2E (oauth, autofetch, etc.)
'github.gitAuthentication': false,
'git.terminalAuthentication': false,
'git.autofetch': false,
'git.openRepositoryInParentFolders': 'never',
// Suppress Copilot/Chat setup dialogs that trigger GitHub OAuth on startup
'chat.commandCenter.enabled': false,
'chat.setupFromDialog': false,
'workbench.startupEditor': 'none',
'workbench.enableExperiments': false,
'extensions.autoCheckUpdates': false,
'extensions.autoUpdate': false,
'telemetry.telemetryLevel': 'off',
'update.mode': 'none',
'chat.disableAIFeatures': true, // Disable Copilot/AI features to prevent secondary sidebar opening
...userSettings
};
Expand All @@ -119,11 +132,23 @@ export const createDesktopTest = (options: CreateDesktopTestOptions) => {
.map(dir => path.resolve(packageRoot, '..', dir))
].map(p => `--extensionDevelopmentPath=${p}`);

// Explicitly disable built-in GitHub/Copilot/Chat extensions that can trigger
// the GitHub OAuth browser tab on startup. `--disable-extensions` only disables
// user-installed extensions; built-ins must be disabled individually.
const disabledBuiltins = [
'vscode.github',
'vscode.github-authentication',
'GitHub.vscode-pull-request-github',
'GitHub.copilot',
'GitHub.copilot-chat'
].map(id => `--disable-extension=${id}`);

const launchArgs = [
`--user-data-dir=${userDataDir}`,
`--extensions-dir=${extensionsDir}`,
...extensionArgs,
...(disableOtherExtensions ? ['--disable-extensions'] : []),
...disabledBuiltins,
'--disable-workspace-trust',
'--no-sandbox',
workspaceDir
Expand Down
2 changes: 2 additions & 0 deletions packages/playwright-vscode-ext/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export {
assertWelcomeTabExists,
waitForQuickInputFirstOption,
closeWelcomeTabs,
dismissSignInWalkthroughDialog,
closeSettingsTab,
waitForWorkspaceReady,
typingSpeed,
Expand All @@ -31,6 +32,7 @@ export {
createApexClass,
deployCurrentSourceToOrg,
openFileByName,
openFileFromExplorerTree,
editAndSaveOpenFile as editOpenFile,
setupMinimalOrgAndAuth,
createAndDeployApexTestClass
Expand Down
10 changes: 9 additions & 1 deletion packages/playwright-vscode-ext/src/pages/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
*/

import { expect, Page } from '@playwright/test';
import { dismissAllQuickInputWidgets, waitForQuickInputFirstOption } from '../utils/helpers';
import {
dismissAllQuickInputWidgets,
dismissSignInWalkthroughDialog,
waitForQuickInputFirstOption
} from '../utils/helpers';
import { QUICK_INPUT_WIDGET, QUICK_INPUT_LIST_ROW } from '../utils/locators';

export const openCommandPalette = async (page: Page): Promise<void> => {
Expand All @@ -15,6 +19,10 @@ export const openCommandPalette = async (page: Page): Promise<void> => {
// Dismiss any existing quick input widgets
await dismissAllQuickInputWidgets(page);

// VS Code 1.116.0+ may show a modal "Welcome to VS Code - Sign In" walkthrough that blocks all
// keyboard input including F1. Dismiss it here so palette callers don't each have to.
await dismissSignInWalkthroughDialog(page);

// Wrap the entire open sequence in retry logic
await expect(async () => {
// Bring page to front to ensure VS Code window is active (critical on Windows)
Expand Down
Loading
Loading