-
Notifications
You must be signed in to change notification settings - Fork 96
Add test for creating new extensionpoint #5109
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
NicoleNG18
wants to merge
5
commits into
eclipse-dirigible:master
Choose a base branch
from
NicoleNG18:test/create-extension-points
base: master
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
5 commits
Select commit
Hold shift + click to select a range
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
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
22 changes: 22 additions & 0 deletions
22
...mework/src/main/java/org/eclipse/dirigible/tests/framework/ide/OperationsPerspective.java
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 @@ | ||
| package org.eclipse.dirigible.tests.framework.ide; | ||
|
|
||
| import org.eclipse.dirigible.tests.framework.browser.Browser; | ||
| import org.eclipse.dirigible.tests.framework.browser.HtmlElementType; | ||
| import org.springframework.context.annotation.Lazy; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
| @Lazy | ||
| @Component | ||
| public class OperationsPerspective { | ||
| private final Browser browser; | ||
|
|
||
| protected OperationsPerspective(Browser browser) { | ||
| this.browser = browser; | ||
| } | ||
|
|
||
| public void assertExtensionPointIsPresent(String extensionPointFileName, String extensionFileName) { | ||
| browser.doubleClickOnElementContainingText(HtmlElementType.ANCHOR, "CreateExtensionPointIT"); | ||
| browser.assertElementExistsByTypeAndText(HtmlElementType.ANCHOR, extensionPointFileName); | ||
| browser.assertElementExistsByTypeAndText(HtmlElementType.ANCHOR, extensionFileName); | ||
| } | ||
| } |
24 changes: 24 additions & 0 deletions
24
...src/main/java/org/eclipse/dirigible/tests/framework/ide/OperationsPerspectiveFactory.java
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,24 @@ | ||
| package org.eclipse.dirigible.tests.framework.ide; | ||
|
|
||
| import org.eclipse.dirigible.tests.framework.browser.Browser; | ||
| import org.springframework.context.annotation.Lazy; | ||
| import org.springframework.stereotype.Component; | ||
|
|
||
|
|
||
| @Lazy | ||
| @Component | ||
| public class OperationsPerspectiveFactory { | ||
| private final Browser browser; | ||
|
|
||
| protected OperationsPerspectiveFactory(Browser browser) { | ||
| this.browser = browser; | ||
| } | ||
|
|
||
| public OperationsPerspective create() { | ||
| return create(browser); | ||
| } | ||
|
|
||
| public OperationsPerspective create(Browser browser) { | ||
| return new OperationsPerspective(browser); | ||
| } | ||
| } |
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
68 changes: 68 additions & 0 deletions
68
...rc/main/java/org/eclipse/dirigible/integration/tests/ui/tests/CreateExtensionPointIT.java
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,68 @@ | ||
| package org.eclipse.dirigible.integration.tests.ui.tests; | ||
|
|
||
| import org.eclipse.dirigible.tests.base.UserInterfaceIntegrationTest; | ||
| import org.eclipse.dirigible.tests.framework.browser.HtmlAttribute; | ||
| import org.eclipse.dirigible.tests.framework.browser.HtmlElementType; | ||
| import org.eclipse.dirigible.tests.framework.ide.OperationsPerspective; | ||
| import org.eclipse.dirigible.tests.framework.ide.Workbench; | ||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| public class CreateExtensionPointIT extends UserInterfaceIntegrationTest { | ||
|
|
||
| private static final String PROJECT_NAME = "CreateExtensionPointIT"; | ||
| private static final String EXTENSION_POINT_FILE_NAME = "test1.extensionpoint"; | ||
| private static final String JS_FILE_NAME = "test1.mjs"; | ||
| private static final String EXTENSION_FILE_NAME = "test1.extension"; | ||
| private static final String EXTENSION_POINT_NAME = "test1"; | ||
|
|
||
| @Test | ||
| void test() { | ||
| Workbench workbench = ide.openWorkbench(); | ||
| workbench.createNewProject(this.getClass() | ||
| .getSimpleName()); | ||
|
|
||
| workbench.createCustomElementInProject(PROJECT_NAME, EXTENSION_POINT_FILE_NAME, "Extension Point"); | ||
| workbench.openFile(EXTENSION_POINT_FILE_NAME); | ||
| assertFileTabIsOpen(EXTENSION_POINT_FILE_NAME); | ||
|
|
||
| addExtensionPointName(workbench); | ||
|
|
||
| workbench.saveAll(); | ||
| workbench.publishAll(true); | ||
|
|
||
| workbench.createCustomElementInProject(PROJECT_NAME, JS_FILE_NAME, "JavaScript Service"); | ||
| workbench.openFile(JS_FILE_NAME); | ||
| assertFileTabIsOpen(JS_FILE_NAME); | ||
| workbench.publishAll(true); | ||
|
|
||
| workbench.createCustomElementInProject(PROJECT_NAME, EXTENSION_FILE_NAME, "Extension"); | ||
| browser.doubleClickOnElementById("j1_6_anchor"); | ||
| assertFileTabIsOpen(EXTENSION_FILE_NAME); | ||
|
|
||
| configureExtensionFields(workbench); | ||
|
|
||
| workbench.saveAll(); | ||
| workbench.publishAll(true); | ||
|
|
||
| OperationsPerspective operationsPerspective = ide.openOperationsPerspective(); | ||
| operationsPerspective.assertExtensionPointIsPresent(EXTENSION_POINT_FILE_NAME, EXTENSION_FILE_NAME); | ||
| } | ||
|
|
||
| private void configureExtensionFields(Workbench workbench) { | ||
| browser.clickOnElementByAttributePattern(HtmlElementType.BUTTON, HtmlAttribute.GLYPH, "sap-icon--navigation-down-arrow"); | ||
| browser.clickOnElementWithText(HtmlElementType.SPAN, EXTENSION_POINT_NAME); | ||
|
|
||
| workbench.addContentToField("idModule", "/CreateExtensionPointIT/test1.mjs"); | ||
|
|
||
| } | ||
|
|
||
| private void addExtensionPointName(Workbench workbench) { | ||
| browser.clickOnElementByAttributePattern(HtmlElementType.INPUT, HtmlAttribute.ID, "idName"); | ||
| workbench.selectAll(); | ||
| browser.type(EXTENSION_POINT_NAME); | ||
| } | ||
|
|
||
| private void assertFileTabIsOpen(String fileName) { | ||
| browser.assertElementExistByAttributePatternAndText(HtmlElementType.SPAN, HtmlAttribute.CLASS, "fd-icon-tab-bar__tag", fileName); | ||
| } | ||
| } |
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.
Check notice
Code scanning / CodeQL
Deprecated method or constructor invocation Note test