-
Notifications
You must be signed in to change notification settings - Fork 4
E2e setup and add first test #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
dc4d325
feat: initial e2e setup with first test implemented
refael-m 9f6e21c
feat: initial e2e setup with first test implemented
refael-m ab1d15a
feat: initial e2e setup with first test implemented
refael-m 8f201f1
feat: initial e2e setup with first test implemented
refael-m d9524de
feat: initial e2e setup with first test implemented
refael-m d58c7f9
feat: initial e2e setup with first test implemented
refael-m ba40d4e
feat: initial e2e setup with first test implemented
refael-m 9939109
feat: initial e2e setup with first test implemented
refael-m f0f8424
feat: initial e2e setup with first test implemented
refael-m 57048e6
feat: initial e2e setup with first test implemented
refael-m 71c6753
feat: initial e2e setup with first test implemented
refael-m 5e63702
feat: initial e2e setup with first test implemented
refael-m 99a7119
feat: initial e2e setup with first test implemented
refael-m e75cf1e
feat: initial e2e setup with first test implemented
refael-m 4d77d1b
feat: initial e2e setup with first test implemented
refael-m b6918d6
feat: initial e2e setup with first test implemented
refael-m f069811
feat: initial e2e setup with first test implemented
refael-m 41b64d4
feat: initial e2e setup with first test implemented
refael-m 0ef114a
feat: initial e2e setup with first test implemented
refael-m fe8d417
feat: initial e2e setup with first test implemented
refael-m 243e110
feat: initial e2e setup with first test implemented
refael-m 59bb1e2
feat: initial e2e setup with first test implemented
refael-m d7ef659
feat: initial e2e setup with first test implemented
refael-m a613432
feat: initial e2e setup with first test implemented
refael-m ccc4bdc
feat: initial e2e setup with first test implemented
refael-m 6b703af
feat: initial e2e setup with first test implemented
refael-m e3ea23a
feat: initial e2e setup with first test implemented
refael-m e1086da
feat: initial e2e setup with first test implemented
refael-m e3d22c3
feat: initial e2e setup with first test implemented
refael-m 479a200
feat: initial e2e setup with first test implemented
refael-m 8b20d77
feat: initial e2e setup with first test implemented
refael-m 42cadb8
feat: initial e2e setup with first test implemented
refael-m 2efba2c
test: update workflow node version
refael-m 6e86490
test: update workflow node version
refael-m File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| name: 📊 E2E Tests | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| e2e: | ||
| name: E2E | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: "24" | ||
|
|
||
| - name: Install and compile extension | ||
| run: | | ||
| npm ci | ||
| npm run compile | ||
|
|
||
| - name: Install pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10.24.0 | ||
|
|
||
| - name: Install E2E dependencies | ||
| run: pnpm install | ||
| working-directory: test/e2e | ||
|
|
||
| - name: Run E2E tests | ||
| uses: GabrielBB/xvfb-action@v1 | ||
| with: | ||
| run: pnpm test:e2e | ||
| working-directory: test/e2e | ||
| env: | ||
| E2E_CLOUD: ${{ secrets.E2E_CLOUD }} | ||
| E2E_API_KEY: ${{ secrets.E2E_API_KEY }} | ||
| E2E_API_SECRET: ${{ secrets.E2E_API_SECRET }} | ||
| CI: true | ||
|
|
||
| - name: Generate Allure report | ||
| if: always() | ||
| run: pnpm exec allure generate allure-results -o allure-report --clean | ||
| working-directory: test/e2e | ||
|
|
||
| - name: Upload Allure report | ||
| if: always() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: allure-report-${{ github.run_number }} | ||
| path: test/e2e/allure-report | ||
| retention-days: 30 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| # E2E Tests | ||
|
|
||
| End-to-end tests for the Cloudinary VS Code extension using [WebdriverIO](https://webdriver.io/) and [wdio-vscode-service](https://github.com/webdriverio-community/wdio-vscode-service). | ||
|
|
||
| ## Setup | ||
|
|
||
| ```bash | ||
| cd test/e2e | ||
| pnpm install | ||
| ``` | ||
|
|
||
| ## Environment variables | ||
|
|
||
| End-to-end runs require Cloudinary credentials in `process.env`. The `onPrepare` hook in `wdio.conf.ts` reads `E2E_CLOUD`, `E2E_API_KEY`, and `E2E_API_SECRET`, then writes `~/.cloudinary/environments.json` in the shape the extension expects (cloud name as the top-level key, with `apiKey` and `apiSecret`). | ||
|
|
||
| | Variable | Description | | ||
| |----------|-------------| | ||
| | `E2E_CLOUD` | Cloudinary cloud name | | ||
| | `E2E_API_KEY` | API key | | ||
| | `E2E_API_SECRET` | API secret | | ||
|
|
||
| **Local:** add a `test/e2e/.env` file (gitignored) such as: | ||
|
|
||
| ## Running Tests | ||
|
|
||
| ```bash | ||
| pnpm test:e2e | ||
| ``` | ||
|
|
||
| This will: | ||
| 1. Download a VS Code binary (if not already cached in `.wdio-vscode-service/`) | ||
| 2. Launch VS Code with the extension loaded | ||
| 3. Run all specs in `specs/` | ||
|
|
||
| ## Viewing Reports | ||
|
|
||
| After a test run, generate and open the Allure report: | ||
|
|
||
| ```bash | ||
| pnpm test:report | ||
| ``` | ||
|
|
||
| ## Project Structure | ||
|
|
||
| ``` | ||
| test/e2e/ | ||
| ├── wdio.conf.ts # WebdriverIO configuration | ||
| ├── tsconfig.json # TypeScript config for e2e tests | ||
| ├── package.json # Dependencies (separate from root) | ||
| ├── specs/ # Test spec files | ||
| ├── src/ | ||
| │ └── utils/ # Page object utilities | ||
| ``` | ||
|
|
||
| ## Writing Tests | ||
|
|
||
| Tests use [Mocha](https://mochajs.org/) as the test framework and the `wdio-vscode-service` page objects to interact with VS Code. | ||
|
|
||
| ```ts | ||
| import { activityBarUtils } from '../src/utils/ActivityBarUtils.js' | ||
| import { sideBarViewUtils } from '../src/utils/SideBarViewUtils.js' | ||
|
|
||
| it('should open the Cloudinary view', async () => { | ||
| await activityBarUtils.openView('Cloudinary') | ||
| await sideBarViewUtils.validateSideBarViewTitle('CLOUDINARY') | ||
| await sideBarViewUtils.validateContentItemsExist(['cats', 'dogs']) | ||
| }) | ||
| ``` | ||
|
|
||
| ### Allure Reporting | ||
|
|
||
| Steps are reported via `allureReporter.addStep()` inside utility methods. WebDriver-level steps (findElement, etc.) are disabled in the config to keep reports clean. | ||
|
|
||
| ## Configuration | ||
|
|
||
| Key settings in `wdio.conf.ts`: | ||
|
|
||
| | Setting | Value | Description | | ||
| |---------|-------|-------------| | ||
| | `browserVersion` | `'stable'` | VS Code version to test against | | ||
| | `logLevel` | `'warn'` | Suppresses verbose WebDriver logs | | ||
| | `extensionPath` | `../../` | Points to the root extension directory | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| { | ||
| "name": "e2e", | ||
| "type": "module", | ||
| "devDependencies": { | ||
| "@types/node": "^25.5.2", | ||
| "@wdio/allure-reporter": "^9.27.0", | ||
| "@wdio/cli": "^9.27.0", | ||
| "@wdio/globals": "^9.27.0", | ||
| "@wdio/local-runner": "^9.27.0", | ||
| "@wdio/mocha-framework": "^9.27.0", | ||
| "@wdio/spec-reporter": "^9.27.0", | ||
| "allure-commandline": "^2.38.1", | ||
| "cloudinary": "^2.9.0", | ||
| "expect-webdriverio": "^5.6.5", | ||
| "wdio-video-reporter": "^6.2.0", | ||
| "wdio-vscode-service": "^6.1.4" | ||
| }, | ||
| "scripts": { | ||
| "test:e2e": "wdio run ./wdio.conf.ts", | ||
| "test:report": "allure generate allure-results -o allure-report --clean && allure open allure-report" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider switching order and use pnpm in install and compile