-
Notifications
You must be signed in to change notification settings - Fork 40
Core components content fragment handling fixes #391
Core components content fragment handling fixes #391
Conversation
Fix DefaultSelect to enable BB the configuration of the Content Fragment component
Add ContentFragmentPathBrowser dialog field
...m/cognifide/qa/bb/aem/core/component/dialog/dialogfields/ContentFragmentPathBrowserImpl.java
Outdated
Show resolved
Hide resolved
// the application. Sometimes a warning dialog appears and it needs to be handled. | ||
if (bobcatWait | ||
.tweak(new TimingsBuilder().explicitTimeout(1).build()) | ||
.ignoring(Stream.of(NoSuchElementException.class).collect(Collectors.toList())) |
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 a stream?
You can use: ignoring(NoSuchElementException.class)
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.
I was testing this solution and thought that I might add more Exceptions later. But I didn't :D
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.
Fixed
|
||
// Branching logic in tests is not OK, it's true. But this part handles an unpredictable part of | ||
// the application. Sometimes a warning dialog appears and it needs to be handled. | ||
if (bobcatWait |
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.
- Try to extract the logic into a self-describing method instead of commenting.
- About the logic itself: are you trying to wait for the warning message -> confirm it -> verify the message disappeared?
Few comments:
- you are ignoring the results of the last
isConditionMet
- you burn some CPU time here, nothing more. - why the
if
clause in the first place? Does the message not appear every time? How about a following flow: wait for message to appear -> click it -> wait for it to disappear?
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.
OK, will move to separate method.
The warning message doesn't always appear and I don't know yet what causes it to appear.
I know I'm ignoring the results of isConditionMet - it's a pretty sleep, nothing more, but it helps me avoid handling Selenium Exceptions
/** | ||
* Default implementation of {@link NumberInput} | ||
*/ | ||
@PageObject(css = Locators.NUMBERINPUT_CSS) |
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.
If the locator is not used anywhere else, put it here directly.
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.
Fixed
|
||
bobcatWait.until(elementToBeClickable(firstResult)).click(); | ||
bobcatWait.until(elementToBeClickable(firstResult)); | ||
input.sendKeys(Keys.ENTER); |
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
|
||
/** | ||
* Default implementation of {@link Select} | ||
*/ | ||
@PageObject(xpath = "//coral-select/..") | ||
@PageObject(css = Locators.SELECT_CSS) |
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.
Same as above - if this is the only place where the selector is used, leave it here.
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.
Fixed
private List<WebElement> label; | ||
|
||
@Inject | ||
private BobcatWait wait; |
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.
Not used?
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.
Fixed
|
||
/** | ||
* Default implementation of {@link Textfield} | ||
*/ | ||
@PageObject(css = Locators.FIELD_WRAPPER_CSS) | ||
@PageObject(css = Locators.TEXTFIELD_CSS) |
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.
Same comment regarding locator
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.
Fixed
* Default implementation of {@link PathBrowser} | ||
*/ | ||
@PageObject(css = Locators.AUTOCOMPLETE_CSS) | ||
public class ContentFragmentPathBrowserImpl implements ContentFragmentPathBrowser { |
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 DefaultXYZ
naming is more aligned with the rest fields
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.
Fixed
* #%L | ||
* Bobcat | ||
* %% | ||
* Copyright (C) 2016 Cognifide Ltd. |
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.
Lies, it's 2019
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.
Fixed
Description
Fixes for BB enabling the handling of Content Fragment core component
Required for: wttech/bobcat-aem-tests#13
Part of #373
Motivation and Context
Types of changes
Checklist: