refactor(tests): update context menu action tests and drag-drop functionality

- Refactored context menu action tests for collections and requests to use sequential tagging.
- Improved readability and consistency in test structure and assertions.
- Updated drag-and-drop tests for cross-project interactions to enhance clarity and maintainability.
- Ensured proper handling of asynchronous operations and improved test reliability.
This commit is contained in:
Bob Qiu committed 2026-09-28 12:09:54 +08:00
1 parent e1b919ca32
commit fac7a81708
17 files changed
+738 -885

No files matched your search

+60 -1
View File
@@ -137,7 +137,7 @@ jobs:
working-directory: packages/insomnia-test
env:
INSOMNIA_BINARY: ${{ github.workspace }}/packages/insomnia/dist/linux-unpacked/insomnia
run: xvfb-run --auto-servernum npx playwright test --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
run: xvfb-run --auto-servernum npx playwright test --grep-invert '@sequential' --shard=${{ matrix.shardIndex }}/${{ matrix.shardTotal }}
- name: Upload Playwright report
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
@@ -147,3 +147,62 @@ jobs:
path: packages/insomnia-test/playwright-report/
retention-days: 7
if-no-files-found: ignore
# ---------------------------------------------------------------------------
# Run tests tagged @sequential with a single worker. These cases interfere with
# each other (or with the parallel shards above) when run concurrently, so
# they're isolated into their own single-threaded stage.
# ---------------------------------------------------------------------------
test-sequential:
needs: build
timeout-minutes: 30
runs-on: ubuntu-latest
continue-on-error: true
permissions:
contents: read
packages: read
steps:
- name: Checkout repo
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
- name: Setup Node.js
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5
with:
node-version: "24"
- name: Restore Insomnia binary
uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5
with:
path: packages/insomnia/dist/linux-unpacked
key: insomnia-linux-unpacked-${{ github.sha }}
fail-on-cache-miss: true
- name: Install test dependencies
run: |
sed -i 's/patch-package && npm run verify-bundle-plugins -w insomnia && npm run install-libcurl-electron/patch-package/' package.json
npm ci
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Install Electron system dependencies
working-directory: packages/insomnia-test
run: npx playwright install-deps chromium
- name: Install ffmpeg (required for video recording)
working-directory: packages/insomnia-test
run: npx playwright install ffmpeg
- name: Run Playwright tests (@sequential, single worker)
working-directory: packages/insomnia-test
env:
INSOMNIA_BINARY: ${{ github.workspace }}/packages/insomnia/dist/linux-unpacked/insomnia
run: xvfb-run --auto-servernum npx playwright test --grep '@sequential' --workers=1
- name: Upload Playwright report
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6
if: ${{ !cancelled() }}
with:
name: playwright-report-sequential
path: packages/insomnia-test/playwright-report/
retention-days: 7
if-no-files-found: ignore