Skip to content

Commit e24b9e0

Browse files
Merge remote-tracking branch 'upstream/releaseCandidate' into feat/popup-header-clickable
# Conflicts: # CHANGES.md # addon/popup.css
2 parents edc7601 + c32bc41 commit e24b9e0

73 files changed

Lines changed: 11385 additions & 4348 deletions

Some content is hidden

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

.circleci/config.yml

Lines changed: 0 additions & 10 deletions
This file was deleted.

.github/workflows/e2e.yml

Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
name: Playwright Tests
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches: [ releaseCandidate, beta, main ]
7+
push:
8+
branches: [ releaseCandidate, beta, main ]
9+
10+
jobs:
11+
# Fork PRs: run tests with mocks (no access to secrets)
12+
test-mocked:
13+
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork == true
14+
timeout-minutes: 60
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v6
18+
19+
- name: Setup Node.js
20+
uses: actions/setup-node@v6
21+
with:
22+
node-version: '24'
23+
cache: 'npm'
24+
25+
- name: Restore node_modules cache
26+
id: cache-npm
27+
uses: actions/cache@v5
28+
with:
29+
path: ~/.npm
30+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
31+
restore-keys: |
32+
${{ runner.os }}-build-${{ env.cache-name }}-
33+
${{ runner.os }}-build-
34+
${{ runner.os }}-
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
- name: Install Playwright Browsers
40+
run: npx playwright install chromium
41+
42+
- name: Run Playwright tests (mocked)
43+
run: |
44+
echo "::notice::🧪 Tests running in MOCKED mode (API calls intercepted, no real Salesforce org)"
45+
npm run test:e2e:mock
46+
47+
- uses: actions/upload-artifact@v4
48+
if: always()
49+
with:
50+
name: playwright-report-mocked
51+
path: playwright-report/
52+
retention-days: 30
53+
54+
# Repo PRs + manual dispatch + post-merge push: run tests against real org
55+
test-real-org:
56+
if: >-
57+
github.event_name == 'workflow_dispatch'
58+
|| github.event_name == 'push'
59+
|| (github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork != true)
60+
timeout-minutes: 60
61+
runs-on: ubuntu-latest
62+
steps:
63+
- uses: actions/checkout@v6
64+
65+
- name: Setup Node.js
66+
uses: actions/setup-node@v6
67+
with:
68+
node-version: '24'
69+
cache: 'npm'
70+
71+
- name: Restore node_modules cache
72+
id: cache-npm
73+
uses: actions/cache@v5
74+
with:
75+
path: ~/.npm
76+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
77+
restore-keys: |
78+
${{ runner.os }}-build-${{ env.cache-name }}-
79+
${{ runner.os }}-build-
80+
${{ runner.os }}-
81+
82+
- name: Setup Salesforce CLI and authenticate
83+
if: ${{ vars.SF_TEST_MOCKENABLED == 'false' }}
84+
env:
85+
SF_CLI_URL: ${{ vars.SF_CLI_URL }}
86+
SF_TEST_APIVERSION: ${{ vars.SF_TEST_APIVERSION }}
87+
SF_TEST_MOCKENABLED: ${{ vars.SF_TEST_MOCKENABLED }}
88+
SF_TEST_ACCOUNTID: ${{ vars.SF_TEST_ACCOUNTID }}
89+
SF_TEST_FLOWID: ${{ vars.SF_TEST_FLOWID }}
90+
SF_TEST_FLOWDEFID: ${{ vars.SF_TEST_FLOWDEFID }}
91+
SF_AUTH_URL: ${{ secrets.SF_AUTH_URL }}
92+
run: |
93+
# Install Salesforce CLI
94+
echo "Installing Salesforce CLI from $SF_CLI_URL"
95+
wget $SF_CLI_URL -O sf-cli.tar.xz
96+
mkdir -p sf-cli
97+
tar xJf sf-cli.tar.xz -C sf-cli --strip-components=1
98+
echo "$PWD/sf-cli/bin" >> $GITHUB_PATH
99+
export PATH="$PWD/sf-cli/bin:$PATH"
100+
sf --version
101+
102+
# Authenticate and get access token
103+
echo "Authenticating to Salesforce org using SF_AUTH_URL..."
104+
echo $SF_AUTH_URL > ./SFDX_AUTH_URL.txt
105+
sf org login sfdx-url -f ./SFDX_AUTH_URL.txt -a cicdorg -d
106+
107+
# Display the authenticated org and extract the access token and instance url
108+
echo "Extracting authentication information..."
109+
ORG_INFO=$(sf org display --json -o cicdorg 2>/dev/null)
110+
SF_EXIT_CODE=$?
111+
112+
if [ $SF_EXIT_CODE -ne 0 ]; then
113+
echo "Error: sf org display failed with exit code $SF_EXIT_CODE"
114+
exit 1
115+
fi
116+
117+
# Check if we got valid JSON
118+
if [ -z "$ORG_INFO" ]; then
119+
echo "Error: sf org display returned empty output"
120+
exit 1
121+
fi
122+
123+
ACCESS_TOKEN=$(echo "$ORG_INFO" | jq -r '.result.accessToken // empty' 2>/dev/null)
124+
INSTANCE_URL=$(echo "$ORG_INFO" | jq -r '.result.instanceUrl // empty' 2>/dev/null)
125+
126+
if [ -z "$ACCESS_TOKEN" ]; then
127+
echo "Error: Could not extract access_token from auth response"
128+
exit 1
129+
fi
130+
131+
# Mask the token so it never appears in logs
132+
echo "::add-mask::$ACCESS_TOKEN"
133+
134+
# Extract hostname from instance URL
135+
if [ -n "$INSTANCE_URL" ]; then
136+
SF_HOST=$(echo "$INSTANCE_URL" | sed 's|https\?://||' | sed 's|/.*||')
137+
else
138+
echo "Error: Could not determine Salesforce instance URL"
139+
exit 1
140+
fi
141+
142+
if [ -z "$SF_HOST" ]; then
143+
echo "Error: Could not determine Salesforce hostname"
144+
exit 1
145+
fi
146+
147+
# Generate test-constants.local.js with real credentials
148+
echo "Generating tests/e2e/test-constants.local.js..."
149+
printf '%s\n' \
150+
'export const TEST_CONSTANTS = {' \
151+
' mockHost: "'"$SF_HOST"'",' \
152+
' mockToken: "'"$ACCESS_TOKEN"'",' \
153+
' apiVersion: "'"$SF_TEST_APIVERSION"'",' \
154+
' accountRecordId: "'"$SF_TEST_ACCOUNTID"'",' \
155+
' accountRecordName: "Test Account 1",' \
156+
' testUserSearchTerm: "Integration User",' \
157+
' flowId: "'"$SF_TEST_FLOWID"'",' \
158+
' flowDefId: "'"$SF_TEST_FLOWDEFID"'",' \
159+
' mockEnabled: '"$SF_TEST_MOCKENABLED" \
160+
'};' > tests/e2e/test-constants.local.js
161+
162+
- name: Ensure test constants exist (fallback when auth step skipped)
163+
if: vars.SF_TEST_MOCKENABLED != 'false'
164+
run: cp tests/e2e/test-constants.template.js tests/e2e/test-constants.local.js
165+
166+
- name: Display test mode
167+
run: |
168+
if [ "${{ vars.SF_TEST_MOCKENABLED }}" = "false" ]; then
169+
echo "::notice::🔗 Tests running against REAL Salesforce org (SF_TEST_MOCKENABLED=false)"
170+
else
171+
echo "::notice::🧪 Tests running in MOCKED mode (SF_TEST_MOCKENABLED not set to false, API calls intercepted)"
172+
fi
173+
174+
- name: Install dependencies
175+
run: npm ci
176+
177+
- name: Install Playwright Browsers
178+
run: npx playwright install chromium
179+
180+
- name: Run Playwright tests
181+
run: npm run test:e2e
182+
183+
- uses: actions/upload-artifact@v4
184+
if: always()
185+
with:
186+
name: playwright-report
187+
path: playwright-report/
188+
retention-days: 30

.gitignore

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,13 @@ venv/
1414
.sf/
1515
.vscode/
1616
.DS_Store
17-
.cursorrules
17+
.cursorrules
18+
19+
# Playwright
20+
playwright-report/
21+
test-results/
22+
blob-report/
23+
tests/coverage/
24+
25+
# Local test constants (contains org credentials)
26+
tests/e2e/test-constants.local.js

CHANGES.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
# Release Notes
22

3-
## Version 2.0
3+
## Version 2.1
44

55
- `Popup` Make popup header clickable to close it and add synchronized hover effects with the extension button (contribution by [Camille Guillory](https://github.com/CamilleGuillory))
6+
- `Popup` Add filter icon and menu on User tab search input [discussion #1147](https://github.com/tprouvot/Salesforce-Inspector-reloaded/discussions/1147)
7+
- `Event Monitor` Allow users to generate, publish and save Platform Events based on their definition
8+
9+
## Version 2.0
10+
11+
- `Data Export` Fix unrecognized Salesforce Ids [issue #984](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/984)
12+
- `Data Import` Expose metadata updates through Tooling API (ie Bulk Deactivate Flows) [feature 1125](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/1125)
13+
- Fix Lightning Navigation from Analytics / Tableau [issue #1121](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/1121)
14+
- `Popup` review cache management in "Preload SObjects before popup opens". If enabled, refresh of SObject definition is done every "SObjects List Cache" hours, else done in background when the popup is expanded
15+
- `Rest Explorer` fix a performance issue (edit entrypoint rerender completely the output even if no changes) (contribution by [Nicolas Greard](https://github.com/ngreardSF))
16+
- `Popup` fix recent items scroll not working anymore in v2 (contribution by [Nicolas Greard](https://github.com/ngreardSF))
17+
- Fix popup/detail record name field [issue #274](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/274) (contribution by [Nicolas Greard](https://github.com/ngreardSF))
18+
- `Data Export` Fix Column order not respected when performing subqueries [#598](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/598)
619
- `Accessibility` Improve screen reader support: fix AlertBanner silent announcements, convert inspector button and tooltip trigger to semantic elements, add popup iframe title issues [#1107](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/1107) & [#1108](https://github.com/tprouvot/Salesforce-Inspector-reloaded/issues/1108) (contribution by [akj](https://github.com/akj))
720
- `Dependencies Explorer` (contribution by [Georgi Dobrishinov](https://github.com/dobrishinov))
821
- `Flow Scanner` Extract Flow Scanner rules logic into shared module (fixes the Flow Scanner import flash on the Options page) contribution by [Camille Guillory](https://github.com/CamilleGuillory))

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,14 +226,7 @@ This branch will be merged into beta and then master when the new version is pub
226226

227227
### Unit tests
228228

229-
1. Set up an org (e.g. a Developer Edition) and apply the following customizations:
230-
1. Everything described in metadata in `test/`. Push to org with `sf deploy metadata -d test/ -o [your-test-org-alias]`.
231-
2. Make sure your user language is set to English.
232-
3. Ensure the org has no _namespace prefix_ (Setup → Package Manager).
233-
4. Assign Permission Set `SfInspector` to your user.
234-
2. Navigate to one of the extension pages and replace the file name with `test-framework.html`, for example `chrome-extension://example/test-framework.html?host=example.my.salesforce.com`.
235-
3. Wait until "Salesforce Inspector unit test finished successfully" is shown.
236-
4. If the test fails, open your browser's developer tools console to see error messages.
229+
See [How to run tests](tests/HOW_TO_RUN_TESTS.md).
237230

238231
### Linting
239232

@@ -261,7 +254,7 @@ By Thomas Prouvot and forked from [Søren Krabbe and Jesper Kristensen](https://
261254

262255
This extension uses the following third-party libraries:
263256

264-
- [Lightning Flow Scanner Core](https://github.com/Flow-Scanner/lightning-flow-scanner-core) - A lightweight engine for Flow metadata analysis in Node.js and browser environments (MIT License)
257+
- [Lightning Flow Scanner Core](https://github.com/Flow-Scanner/lightning-flow-scanner) - A lightweight engine for Flow metadata analysis in Node.js and browser environments (MIT License)
265258
- [PrismJS](https://prismjs.com/) - Lightweight, extensible syntax highlighter (MIT License)
266259

267260
For full license details, see [THIRD_PARTY_NOTICES.md](./THIRD_PARTY_NOTICES.md)

THIRD_PARTY_NOTICES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This project includes code from the following open source projects:
66

77
- **License**: MIT License
88
- **Copyright**: Flow-Scanner Contributors
9-
- **Source**: https://github.com/Flow-Scanner/lightning-flow-scanner-core
9+
- **Source**: https://github.com/Flow-Scanner/lightning-flow-scanner
1010
- **Files**: `addon/lib/flow-scanner-core.js`
1111

1212
MIT License

0 commit comments

Comments
 (0)