-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Extension Registry: QA Added acceptance tests for readOnlyGuards rule, entity action and custom property editor #19939
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
47 commits
Select commit
Hold shift + click to select a range
196d6ae
Added tests for readOnlyGuard rules
nhudinh0309 a74e1c6
Added backoffice override files for readOnlyGuard tests
nhudinh0309 c1b1e56
Merge branch 'main' into v16/QA/read-only-guard-tests
nhudinh0309 8d68d50
Bumped version
nhudinh0309 bb5e084
Added project for ExtensionRegistry tests in playwright configs
nhudinh0309 e009429
Updated nightly E2E test pipelines to run Extension Registry tests
nhudinh0309 e9b9649
Updated nightly E2E test pipeline
nhudinh0309 eb4524c
Updated nightly E2E test pipeline
nhudinh0309 3ab0469
Updated playwright configs
nhudinh0309 d373343
Updated nightly E2E test pipeline
nhudinh0309 43574cb
Add test for Entity Action Extension to retrieve entityType and uniqu…
NguyenThuyLan 4c5a5fa
Merge branch 'main' into v16/QA/read-only-guard-tests
nhudinh0309 2c5cf53
Added job to run the Extension Registry tests in the nightly pipeline
nhudinh0309 1b88a32
Cleaned up
nhudinh0309 68c5c39
Restructure AdditionSetup folder for extension registry
nhudinh0309 fdec949
Updated yaml file for nightly E2E pipeline
nhudinh0309 ea1b91e
Updated json file for lock action
nhudinh0309 96ec7af
Skip test for content delivery API
nhudinh0309 b9b8a90
Updated port
nhudinh0309 8b969bb
Merge branch 'main' into v16/QA/read-only-guard-tests
nhudinh0309 50944a1
Comment out others to run only extension registry tests
nhudinh0309 2e9a76a
Updated port
nhudinh0309 b3bad95
Remove retrieve action folder to test
nhudinh0309 bcd06da
Reverted nightly E2E test pipeline
nhudinh0309 920f6da
Reverted
nhudinh0309 0316268
Updated umbraco package json
nhudinh0309 d36670f
Reverted
nhudinh0309 ab7bce8
Renamed AdditionalSetup folder
nhudinh0309 5df6100
Renamed folder
nhudinh0309 3292c8b
Added appsetting.json file
nhudinh0309 52732e6
Updated appsettings.json
nhudinh0309 ada52c8
Updated appsettings.json
nhudinh0309 a4534b6
Added debug step
nhudinh0309 69cdd66
Added step to build backoffice
nhudinh0309 0e30f2a
Reverted
nhudinh0309 c55b485
Only spec.ts file run in the extension registry project
nhudinh0309 08881cf
Property Editor: Add tests for create and using custom property edito…
NguyenThuyLan 8a01ded
Format code
nhudinh0309 a2de173
Merge branch 'main' into v16/QA/read-only-guard-tests
nhudinh0309 e100e8a
Fixed
nhudinh0309 235d807
Format code
nhudinh0309 189e4e4
Format code
nhudinh0309 8c2f2bd
Format code
nhudinh0309 b3459a0
Updated indentation
andr317c cf2e99f
Fixed comments
nhudinh0309 ea1cd0f
change the name of test
LanThuyNguyen 20d9c32
Merge branch 'main' into v16/QA/read-only-guard-tests
nhudinh0309 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
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
2 changes: 1 addition & 1 deletion
2
tests/Umbraco.Tests.AcceptanceTest/tests/DeliveryApi/DeliveryApi.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
100 changes: 100 additions & 0 deletions
100
...nsionRegistry/AdditionalSetup/App_Plugins/custom-property-editor/dist/customtexteditor.js
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
...nRegistry/AdditionalSetup/App_Plugins/custom-property-editor/dist/customtexteditor.js.map
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
...ExtensionRegistry/AdditionalSetup/App_Plugins/custom-property-editor/umbraco-package.json
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,18 @@ | ||
| { | ||
| "$schema": "../../umbraco-package-schema.json", | ||
| "name": "My.Extension", | ||
| "extensions": [ | ||
| { | ||
| "type": "propertyEditorUi", | ||
| "alias": "Custom.TextEditor", | ||
| "name": "Custom Text Editor", | ||
| "element": "/App_Plugins/custom-property-editor/dist/customtexteditor.js", | ||
| "meta": { | ||
| "label": "Custom Text Editor", | ||
| "propertyEditorSchemaAlias": "Umbraco.TextBox", | ||
| "icon": "icon-edit", | ||
| "group": "Custom" | ||
| } | ||
| } | ||
| ] | ||
| } |
25 changes: 25 additions & 0 deletions
25
...ceTest/tests/ExtensionRegistry/AdditionalSetup/App_Plugins/lock-action/lock-action.api.js
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,25 @@ | ||
| import { UMB_DOCUMENT_WORKSPACE_CONTEXT } from '@umbraco-cms/backoffice/document'; | ||
| import { UmbVariantId } from '@umbraco-cms/backoffice/variant'; | ||
| import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action'; | ||
|
|
||
| export class UmbDocumentLockEntityAction extends UmbEntityActionBase { | ||
| async execute() { | ||
| const context = await this.getContext(UMB_DOCUMENT_WORKSPACE_CONTEXT); | ||
| const ruleUnique = 'lock'; | ||
|
|
||
| const myRule = { | ||
| unique: ruleUnique, | ||
| UmbVariantId: new UmbVariantId(), | ||
| }; | ||
|
|
||
| const hasRule = context?.readOnlyGuard.getRules().find((rule) => rule.unique === ruleUnique); | ||
|
|
||
| if (hasRule) { | ||
| context?.readOnlyGuard.removeRule(ruleUnique); | ||
| } else { | ||
| context?.readOnlyGuard.addRule(myRule); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| export { UmbDocumentLockEntityAction as api }; |
17 changes: 17 additions & 0 deletions
17
.../tests/ExtensionRegistry/AdditionalSetup/App_Plugins/lock-action/lock-action.manifests.js
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,17 @@ | ||
| import { UMB_DOCUMENT_ENTITY_TYPE } from '@umbraco-cms/backoffice/document'; | ||
|
|
||
| export const manifests = [ | ||
| { | ||
| type: 'entityAction', | ||
| kind: 'default', | ||
| alias: 'Umb.EntityAction.Document.Lock', | ||
| name: 'Lock Document Entity Action', | ||
| forEntityTypes: [UMB_DOCUMENT_ENTITY_TYPE], | ||
| api: () => import('./lock-action.api.js'), | ||
| weight: 200, | ||
| meta: { | ||
| label: 'Lock it', | ||
| icon: 'icon-lock', | ||
| } | ||
| } | ||
| ] |
12 changes: 12 additions & 0 deletions
12
...Test/tests/ExtensionRegistry/AdditionalSetup/App_Plugins/lock-action/umbraco-package.json
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,12 @@ | ||
| { | ||
| "name": "E2E Test Package", | ||
| "version": "1.0.0", | ||
| "extensions": [ | ||
| { | ||
| "type": "bundle", | ||
| "alias": "E2E.Package.Bundle", | ||
| "name": "E2E Test Package Bundle", | ||
| "js": "/App_Plugins/lock-action/lock-action.manifests.js" | ||
| } | ||
| ] | ||
| } |
18 changes: 18 additions & 0 deletions
18
...ests/ExtensionRegistry/AdditionalSetup/App_Plugins/retrieve-action/retrieve-action.api.js
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,18 @@ | ||
| import { UmbEntityActionBase } from '@umbraco-cms/backoffice/entity-action'; | ||
| import { UMB_NOTIFICATION_CONTEXT } from '@umbraco-cms/backoffice/notification'; | ||
|
|
||
| export class RetrieveAction extends UmbEntityActionBase { | ||
|
|
||
| async execute() { | ||
| const { entityType, unique } = this.args; | ||
| const message = `${entityType}_${unique}`; | ||
| const notificationContext = await this.getContext(UMB_NOTIFICATION_CONTEXT); | ||
| notificationContext?.peek('positive', { | ||
| data: { | ||
| headline: '', | ||
| message: message, | ||
| }, | ||
| }); | ||
| } | ||
| } | ||
| export { RetrieveAction as api }; |
13 changes: 13 additions & 0 deletions
13
...xtensionRegistry/AdditionalSetup/App_Plugins/retrieve-action/retrieve-action.manifests.js
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,13 @@ | ||
| export const manifest = { | ||
| type: 'entityAction', | ||
| kind: 'default', | ||
| alias: 'Retrieve', | ||
| name: 'Retrieve', | ||
| weight: 200, | ||
| forEntityTypes: ['document', 'media'], | ||
| api: () => import('./retrieve-action.api.js'), | ||
| meta: { | ||
| icon: 'icon-add', | ||
| label: 'Retrieve' | ||
| }, | ||
| }; |
12 changes: 12 additions & 0 deletions
12
.../tests/ExtensionRegistry/AdditionalSetup/App_Plugins/retrieve-action/umbraco-package.json
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,12 @@ | ||
| { | ||
| "name": "My entity action", | ||
| "version": "1.0.0", | ||
| "extensions": [ | ||
| { | ||
| "type": "bundle", | ||
| "alias": "Umb.EntityAction.Test.Bundle", | ||
| "name": "Test entity action bundle", | ||
| "js": "/App_Plugins/retrieve-action/retrieve-action.manifests.js" | ||
| } | ||
| ] | ||
| } |
58 changes: 58 additions & 0 deletions
58
tests/Umbraco.Tests.AcceptanceTest/tests/ExtensionRegistry/AdditionalSetup/appsettings.json
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,58 @@ | ||
| { | ||
| "$schema": "appsettings-schema.json", | ||
| "Serilog": { | ||
| "MinimumLevel": { | ||
| "Default": "Information", | ||
| "Override": { | ||
| "Microsoft": "Warning", | ||
| "Microsoft.Hosting.Lifetime": "Information", | ||
| "System": "Warning" | ||
| } | ||
| }, | ||
| "WriteTo": [ | ||
| { | ||
| "Name": "Async", | ||
| "Args": { | ||
| "Configure": [ | ||
| { | ||
| "Name": "Console" | ||
| } | ||
| ] | ||
| } | ||
| } | ||
| ] | ||
| }, | ||
| "Umbraco": { | ||
| "CMS": { | ||
| "Unattended": { | ||
| "InstallUnattended": true, | ||
| "UnattendedUserName": "Playwright Test", | ||
| "UnattendedUserEmail": "[email protected]", | ||
| "UnattendedUserPassword": "UmbracoAcceptance123!" | ||
| }, | ||
| "Content": { | ||
| "ContentVersionCleanupPolicy": { | ||
| "EnableCleanup": false | ||
| } | ||
| }, | ||
| "Global": { | ||
| "DisableElectionForSingleServer": true, | ||
| "InstallMissingDatabase": true, | ||
| "Id": "00000000-0000-0000-0000-000000000042", | ||
| "VersionCheckPeriod": 0, | ||
| "UseHttps": true | ||
| }, | ||
| "HealthChecks": { | ||
| "Notification": { | ||
| "Enabled": false | ||
| } | ||
| }, | ||
| "KeepAlive": { | ||
| "DisableKeepAliveTask": true | ||
| }, | ||
| "WebRouting": { | ||
| "UmbracoApplicationUrl": "https://localhost:44331/" | ||
| } | ||
| } | ||
| } | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.