Package com.znize.platform.test.api
Interface Annotation
-
public interface AnnotationAnnotation is comment or help info added on screen during test automation. It can be used for recording demo or tutorial videos.- Since:
- 5.21
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classAnnotation.AnimationAnimation.static classAnnotation.ArrowArrow on annotation border.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Annotationanimate(int animationSpeed, Annotation.Animation... animations)Configure animation.Annotationanimate(int animationSpeed, java.util.List<Annotation.Animation> animations)Configure animation.AnnotationbackgroundColor(java.lang.String rgba)Set background color.java.lang.StringgetName()Get annotation name.Annotationmove(int distanceX, int distanceY)Move this annotation away from its current position for the designated distance.AnnotationmoveBySize(double percentX, double percentY)Move this annotation away from its current position for the designated horizontal and vertical percentages of annotation size.Annotationposition(java.lang.String my, java.lang.String at, Component target)Position this annotation at the specified location.voidremove()Remove this annotation from screen.voidsetName(java.lang.String name)Set annotation name.Annotationshow()Show this annotation on screen using configured animation and position.default Annotationstyle(int fontSize, Annotation.Arrow arrow)Set style: font size and arrow.Annotationstyle(java.lang.String width, java.lang.String height, int fontSize, Annotation.Arrow arrow)Set style including width/height, font size, background opacity, and arrow.voidwaitUntilAnimationComplete()Wait until the animation of this Annotation has been completed.
-
-
-
Method Detail
-
getName
java.lang.String getName()
Get annotation name. It must be unique among current showing annotations.- Returns:
- annotation name.
-
setName
void setName(java.lang.String name)
Set annotation name. It must be unique among current showing annotations.- Parameters:
name- annotation name.
-
style
default Annotation style(int fontSize, Annotation.Arrow arrow)
Set style: font size and arrow.- Parameters:
fontSize- font size from 1 to 6 (em)arrow- the side of the annotation to show arrow. null for no arrow.- Returns:
- this Annotation
-
style
Annotation style(java.lang.String width, java.lang.String height, int fontSize, Annotation.Arrow arrow)
Set style including width/height, font size, background opacity, and arrow.- Parameters:
width- annotation width, e.g., 200px, 100vw. null for auto.height- annotation height, e.g., 100px, 100vh. null for auto.fontSize- font size from 1 to 6 (em)arrow- the side of the annotation to show arrow. null for no arrow.- Returns:
- this Annotation
-
backgroundColor
Annotation backgroundColor(java.lang.String rgba)
Set background color. If a value in RGBA is empty, keep its existing value. For example, ',,,0.8' for setting opacity only.- Parameters:
rgba- rgba values separated by comma in format: "r,g,b,a".- Returns:
- this Annotation
-
animate
default Annotation animate(int animationSpeed, Annotation.Animation... animations)
Configure animation.- Parameters:
animationSpeed- animation speed in millisecondsanimations- a list of animations(run in parallel) to show this annotation- Returns:
- this Annotation
-
animate
Annotation animate(int animationSpeed, java.util.List<Annotation.Animation> animations)
Configure animation.- Parameters:
animationSpeed- animation speed in millisecondsanimations- a list of animations(run in parallel) to show this annotation- Returns:
- this Annotation
-
position
Annotation position(java.lang.String my, java.lang.String at, Component target)
Position this annotation at the specified location.- Parameters:
my- the position point(horizontal,vertical) of this annotation. Horizontal values can be "left", "center" or "right", and vertical values can be "top", "center" or "bottom". e.g., "left top", "right center, "right bottom", "left+100 bottom-20%".at- the position point(horizontal,vertical) of target component. see parameter#myfor detail.target- the target component- Returns:
- this Annotation
-
show
Annotation show()
Show this annotation on screen using configured animation and position.- Returns:
- this Annotation
-
move
Annotation move(int distanceX, int distanceY)
Move this annotation away from its current position for the designated distance.- Parameters:
distanceX- horizontal distance in pixel. Positive value for moving right, and negative value for moving left.distanceY- vertical distance in pixel. Positive value for moving down, and negative value for moving up.- Returns:
- this Annotation
-
moveBySize
Annotation moveBySize(double percentX, double percentY)
Move this annotation away from its current position for the designated horizontal and vertical percentages of annotation size.- Parameters:
percentX- horizontal distance = width * percentX. Positive value for moving right, and negative value for moving left.percentY- vertical distance = height * percentY. Positive value for moving down, and negative value for moving up.- Returns:
- this Annotation
-
remove
void remove()
Remove this annotation from screen.
-
waitUntilAnimationComplete
void waitUntilAnimationComplete()
Wait until the animation of this Annotation has been completed.
-
-