-
Notifications
You must be signed in to change notification settings - Fork 437
RI-8003 Add encryption handling E2E tests #5606
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
Open
pd-redis
wants to merge
4
commits into
main
Choose a base branch
from
e2e/RI-8003/encryption
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5368956
test(e2e): add encryption handling E2E tests
pd-redis 2106414
test(e2e): enhance encryption handling tests
pd-redis f13d005
test(e2e): update EULA acceptance method in encryption tests
pd-redis 93fe65b
style(e2e): fix prettier formatting in encryption spec
pd-redis 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
63 changes: 63 additions & 0 deletions
63
tests/e2e-playwright/tests/main/databases/encryption/encryption.spec.ts
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,63 @@ | ||
| import { test, expect } from 'e2eSrc/fixtures/base'; | ||
|
|
||
| /** | ||
| * Certificate and Encryption Handling Tests (TEST_PLAN.md: 1.7 Certificate and Encryption Handling) | ||
| * | ||
| * Tests for credential encryption settings managed through the EULA popup. | ||
| * These tests reset the EULA agreements to trigger the consent dialog, | ||
| * so they re-accept EULA after each test to restore normal state. | ||
| */ | ||
| test.describe('Certificate and Encryption Handling', () => { | ||
| test.describe.configure({ mode: 'serial' }); | ||
|
|
||
| test.afterAll(async ({ apiHelper }) => { | ||
| await apiHelper.acceptEula(); | ||
| }); | ||
|
|
||
| test('should store credentials encrypted when encryption enabled', async ({ apiHelper, eulaPage }) => { | ||
| // Reset agreements to trigger EULA popup | ||
| await apiHelper.resetAgreements(); | ||
|
|
||
| await eulaPage.goto(); | ||
| await eulaPage.waitForPopup(); | ||
|
|
||
| // Encryption is enabled by default in the EULA dialog | ||
| const isEncryptionChecked = await eulaPage.isSwitchChecked(eulaPage.encryptionSwitch); | ||
| expect(isEncryptionChecked).toBe(true); | ||
|
|
||
| // Accept with encryption enabled (default) | ||
| await eulaPage.acceptEula(); | ||
|
|
||
| // Verify via API that encryption is enabled | ||
| const settings = await apiHelper.getSettings(); | ||
| expect(settings.agreements?.encryption).toBe(true); | ||
| }); | ||
|
|
||
| test('should display warning when encryption disabled and credentials stored as plaintext', async ({ | ||
| apiHelper, | ||
| eulaPage, | ||
| }) => { | ||
| // Reset agreements to trigger EULA popup again | ||
| await apiHelper.resetAgreements(); | ||
|
|
||
| await eulaPage.goto(); | ||
| await eulaPage.waitForPopup(); | ||
|
|
||
| // Disable encryption | ||
| await eulaPage.encryptionSwitch.click(); | ||
| const isEncryptionChecked = await eulaPage.isSwitchChecked(eulaPage.encryptionSwitch); | ||
| expect(isEncryptionChecked).toBe(false); | ||
|
|
||
| // Verify the plain-text storage warning is visible in the dialog | ||
| await expect(eulaPage.dialog.getByText(/stored locally in plain text/)).toBeVisible(); | ||
|
|
||
| // Accept EULA and submit | ||
| await eulaPage.eulaSwitch.click(); | ||
| await eulaPage.submitButton.click(); | ||
| await expect(eulaPage.dialog).not.toBeVisible(); | ||
|
|
||
| // Verify via API that encryption is disabled | ||
| const settings = await apiHelper.getSettings(); | ||
| expect(settings.agreements?.encryption).toBe(false); | ||
| }); | ||
cursor[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }); | ||
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.
Uh oh!
There was an error while loading. Please reload this page.