-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from aquality-automation/breaking/add-visualiz…
…ation [Feature][Breaking] Visualization
- Loading branch information
Showing
15 changed files
with
127 additions
and
23 deletions.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,84 @@ | ||
package aquality.appium.mobile.screens; | ||
|
||
import aquality.appium.mobile.application.AqualityServices; | ||
import aquality.appium.mobile.elements.interfaces.IElement; | ||
import aquality.appium.mobile.elements.interfaces.IElementFactory; | ||
import aquality.appium.mobile.elements.interfaces.ILabel; | ||
import aquality.selenium.core.configurations.IVisualizationConfiguration; | ||
import aquality.selenium.core.elements.interfaces.IElementStateProvider; | ||
import aquality.selenium.core.forms.Form; | ||
import aquality.selenium.core.localization.ILocalizedLogger; | ||
import org.openqa.selenium.By; | ||
import org.openqa.selenium.Dimension; | ||
|
||
public abstract class Screen implements IScreen { | ||
import java.awt.*; | ||
|
||
/** | ||
* Defines base class for any UI form. | ||
*/ | ||
public abstract class Screen extends Form<IElement> implements IScreen { | ||
/** | ||
* Locator for specified form | ||
*/ | ||
private final By locator; | ||
/** | ||
* Name of specified form | ||
*/ | ||
private final String name; | ||
private final ILabel screenLabel; | ||
/** | ||
* Screen element defined by its locator and name. | ||
*/ | ||
private final IElement screenElement; | ||
|
||
/** | ||
* Constructor with parameters | ||
*/ | ||
protected Screen(By locator, String name) { | ||
super(IElement.class); | ||
this.locator = locator; | ||
this.name = name; | ||
this.screenLabel = getElementFactory().getLabel(locator, name); | ||
this.screenElement = getElementFactory().getLabel(locator, name); | ||
} | ||
|
||
@Override | ||
public By getLocator() { | ||
return locator; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public Dimension getSize() { | ||
return screenLabel.getElement().getSize(); | ||
return screenElement.visual().getSize(); | ||
} | ||
|
||
@Override | ||
public IElementStateProvider state() { | ||
return screenLabel.state(); | ||
return screenElement.state(); | ||
} | ||
|
||
/** | ||
* Gets form element defined by its locator and name. | ||
* Could be used to find child elements relative to form element. | ||
* | ||
* @return form element. | ||
*/ | ||
protected IElement getScreenElement() { | ||
return screenElement; | ||
} | ||
|
||
protected IElementFactory getElementFactory(){ | ||
return AqualityServices.getElementFactory(); | ||
} | ||
|
||
@Override | ||
protected IVisualizationConfiguration getVisualizationConfiguration() { | ||
return AqualityServices.getConfiguration().getVisualizationConfiguration(); | ||
} | ||
|
||
@Override | ||
protected ILocalizedLogger getLocalizedLogger() { | ||
return AqualityServices.getLocalizedLogger(); | ||
} | ||
} |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.