Closed gavvvr closed 3 weeks ago
The pull request introduces several updates to the obsidian-imgur-plugin
. The package.json
file has been modified to include new development dependencies and an updated package manager version. Two new files, obsidian-app.page.ts
and obsidian-settings.page.ts
, have been added, each containing classes that facilitate end-to-end testing by encapsulating interactions with the Obsidian application and its settings. Additionally, the test suite has been refactored to utilize a page object model, enhancing the structure and maintainability of the tests.
File Path | Change Summary |
---|---|
package.json |
- Added dependency: "@types/node": "22.8.4" - Added dependency: "expect-webdriverio": "5.0.3" - Updated packageManager : pnpm@9.12.2 β pnpm@9.12.3 |
test/e2e/specs/pageobjects/obsidian-app.page.ts |
- Added class: ObsidianApp - Added methods: removeE2eTestVaultIfExists , createAndOpenFreshVault , activateImgurPlugin , closeModal , openSettings , createNewNoteWithContent , createNewNote , resizeToSmallThumbnailUsingCommandPalette , getTextFromOpenedNote , setCursorPositionInActiveNote , loadSampleImageToClipboard , pasteFromClipboard , confirmUpload - Exported instance: export default new ObsidianApp() |
test/e2e/specs/pageobjects/obsidian-settings.page.ts |
- Added class: ObsidianSettings - Added methods: switchToImgurSettingsTab , configureClientId , closeSettings , findClientIdInput - Exported instance: export default new ObsidianSettings() |
test/e2e/specs/test.e2e.ts |
- Refactored test suite to use ObsidianApp for setup and interactions- Updated test cases for image upload and resizing |
test/e2e/specs/utils/mocking.ts |
- Added class: MockingUtils - Added method: mockUploadedImageUrl - Exported instance: export default new MockingUtils() |
test/e2e/wdio.conf.ts |
- Added import: ObsidianApp - Updated timeout configuration based on DEBUG environment variable- Added beforeSuite hook for test setup |
sequenceDiagram
participant User
participant ObsidianApp
participant ObsidianSettings
User->>ObsidianApp: createAndOpenFreshVault()
ObsidianApp-->>User: Vault created
User->>ObsidianSettings: configureClientId("myClientId")
ObsidianSettings-->>User: Client ID configured
User->>ObsidianApp: createNewNoteWithContent("Hello World")
ObsidianApp-->>User: Note created
User->>ObsidianApp: loadSampleImageToClipboard()
ObsidianApp-->>User: Image loaded
User->>ObsidianApp: pasteFromClipboard()
ObsidianApp-->>User: Image pasted
User->>ObsidianApp: confirmUpload()
ObsidianApp-->>User: Upload confirmed
π° In a world of code and plugins bright,
A rabbit hops with pure delight.
New classes here, dependencies too,
Testing made easy, oh what a view!
With each new method, our hearts do sing,
Celebrate the changes, let the joy take wing! πβ¨
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
22 testsβ Β±0βββ22 β Β±0βββ0s β±οΈ Β±0s β3 suites Β±0ββββ0 π€ Β±0β β1 filesββ Β±0ββββ0 β Β±0β
Results for commit 0cc3f84d.βΒ± Comparison against base commit a2e96258.
:recycle: This comment has been updated with latest results.
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
Summary by CodeRabbit
Release Notes
New Features
ObsidianApp
andObsidianSettings
, enabling streamlined interactions with the Obsidian application and its settings.ObsidianApp
class.MockingUtils
class to facilitate image upload stubbing for tests.Bug Fixes
Chores
package.json
.