This repository has been archived by the owner on Nov 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 40
Core components content fragment handling fixes #391
Merged
mkrzyzanowski
merged 8 commits into
master
from
core-components-content-fragment-handling-fixes
Oct 22, 2019
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
f65d045
Fix handling of Textfield to enable configuration for the Content Fra…
1a594fb
Fix an error in the DefaultTextfield
bcc90e2
Merge branch 'master' into core-components-content-fragment-handling-…
2f0ea6a
Add NumberInput dialog field
a0a8c3d
Fix handling the content fragment warning dialog
0f9e02e
Fix most issues mentioned in CR
a09cf05
Fix the last of the issues mentioned in the CR
2d9b0c3
Fix the current year in copyright comments
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 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
85 changes: 85 additions & 0 deletions
85
...ifide/qa/bb/aem/core/component/dialog/dialogfields/DefaultContentFragmentPathBrowser.java
This file contains 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,85 @@ | ||
/*- | ||
* #%L | ||
* Bobcat | ||
* %% | ||
* Copyright (C) 2019 Cognifide Ltd. | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package com.cognifide.qa.bb.aem.core.component.dialog.dialogfields; | ||
|
||
import static org.openqa.selenium.support.ui.ExpectedConditions.not; | ||
import static org.openqa.selenium.support.ui.ExpectedConditions.elementToBeClickable; | ||
|
||
import java.util.List; | ||
import java.util.NoSuchElementException; | ||
|
||
import org.openqa.selenium.Keys; | ||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
|
||
import com.cognifide.qa.bb.qualifier.Global; | ||
import com.cognifide.qa.bb.qualifier.PageObject; | ||
import com.cognifide.qa.bb.wait.BobcatWait; | ||
import com.cognifide.qa.bb.wait.TimingsBuilder; | ||
import com.google.inject.Inject; | ||
|
||
/** | ||
* Default implementation of {@link ContentFragmentPathBrowser} | ||
*/ | ||
@PageObject(css = Locators.AUTOCOMPLETE_CSS) | ||
public class DefaultContentFragmentPathBrowser implements ContentFragmentPathBrowser { | ||
|
||
@FindBy(css = ".coral3-Textfield") | ||
private WebElement input; | ||
|
||
@FindBy(xpath = Locators.ALTERNATE_LABEL_XPATH) | ||
private List<WebElement> label; | ||
|
||
@FindBy(css = ".foundation-picker-buttonlist.coral3-Overlay.is-open") | ||
private WebElement firstResult; | ||
|
||
@Global | ||
@FindBy(css = ".coral3-Dialog--warning.is-open .coral3-Button--primary") | ||
private WebElement warningConfirmation; | ||
|
||
@Inject | ||
private BobcatWait bobcatWait; | ||
|
||
@Override | ||
public void setValue(Object value) { | ||
input.clear(); | ||
input.sendKeys(String.valueOf(value)); | ||
bobcatWait.until(elementToBeClickable(firstResult)); | ||
input.sendKeys(Keys.ENTER); | ||
closeWarningDialogIfRequired(); | ||
} | ||
|
||
@Override | ||
public String getLabel() { | ||
return label.isEmpty() ? "" : label.get(0).getText(); | ||
} | ||
|
||
// The warning dialog doesn't always appear, so it's handled within an if-clause | ||
private void closeWarningDialogIfRequired() { | ||
if (bobcatWait | ||
.tweak(new TimingsBuilder().explicitTimeout(1).build()) | ||
.ignoring(NoSuchElementException.class) | ||
.isConditionMet(elementToBeClickable(warningConfirmation))) { | ||
warningConfirmation.click(); | ||
bobcatWait.tweak(new TimingsBuilder().explicitTimeout(1).build()) | ||
.isConditionMet(not(elementToBeClickable(warningConfirmation))); | ||
} | ||
} | ||
} |
This file contains 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
51 changes: 51 additions & 0 deletions
51
...n/java/com/cognifide/qa/bb/aem/core/component/dialog/dialogfields/DefaultNumberInput.java
This file contains 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,51 @@ | ||
/*- | ||
* #%L | ||
* Bobcat | ||
* %% | ||
* Copyright (C) 2019 Cognifide Ltd. | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package com.cognifide.qa.bb.aem.core.component.dialog.dialogfields; | ||
|
||
import java.util.List; | ||
|
||
import org.openqa.selenium.WebElement; | ||
import org.openqa.selenium.support.FindBy; | ||
|
||
import com.cognifide.qa.bb.qualifier.PageObject; | ||
|
||
/** | ||
* Default implementation of {@link NumberInput} | ||
*/ | ||
@PageObject(css = "coral-numberinput") | ||
public class DefaultNumberInput implements NumberInput { | ||
|
||
@FindBy(css = "input") | ||
private WebElement input; | ||
|
||
@FindBy(xpath = Locators.ALTERNATE_LABEL_XPATH) | ||
private List<WebElement> label; | ||
|
||
@Override | ||
public void setValue(Object value) { | ||
input.clear(); | ||
input.sendKeys(String.valueOf(value)); | ||
} | ||
|
||
@Override | ||
public String getLabel() { | ||
return label.isEmpty() ? "" : label.get(0).getText(); | ||
} | ||
} |
This file contains 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 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 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 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 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 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 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
29 changes: 29 additions & 0 deletions
29
...om/cognifide/qa/bb/aem/core/component/dialog/dialogfields/ContentFragmentPathBrowser.java
This file contains 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,29 @@ | ||
/*- | ||
* #%L | ||
* Bobcat | ||
* %% | ||
* Copyright (C) 2019 Cognifide Ltd. | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package com.cognifide.qa.bb.aem.core.component.dialog.dialogfields; | ||
|
||
import com.cognifide.qa.bb.qualifier.PageObjectInterface; | ||
|
||
/** | ||
* This class represents path browser dialog field. | ||
*/ | ||
@PageObjectInterface | ||
public interface ContentFragmentPathBrowser extends DialogField { | ||
} |
29 changes: 29 additions & 0 deletions
29
...src/main/java/com/cognifide/qa/bb/aem/core/component/dialog/dialogfields/NumberInput.java
This file contains 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,29 @@ | ||
/*- | ||
* #%L | ||
* Bobcat | ||
* %% | ||
* Copyright (C) 2019 Cognifide Ltd. | ||
* %% | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
* #L% | ||
*/ | ||
package com.cognifide.qa.bb.aem.core.component.dialog.dialogfields; | ||
|
||
import com.cognifide.qa.bb.qualifier.PageObjectInterface; | ||
|
||
/** | ||
* This class represents single line number input dialog field. | ||
*/ | ||
@PageObjectInterface | ||
public interface NumberInput extends DialogField { | ||
} |
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.
Why the change from the previous implementation?
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.
The previous implementation didn't support external links, like to github.com - BB would click the first result suggestem by AEM, so a page within the AEM instance instead of github.com