-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into angular_rework_development
- Loading branch information
Showing
19 changed files
with
91 additions
and
90 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
21 changes: 21 additions & 0 deletions
21
jdi-light-html/src/main/java/com/epam/jdi/light/ui/html/asserts/HasImageAssert.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,21 @@ | ||
package com.epam.jdi.light.ui.html.asserts; | ||
|
||
import com.epam.jdi.light.asserts.generic.IBaseAssert; | ||
import com.epam.jdi.light.ui.html.interfaces.HasImage; | ||
import org.hamcrest.Matchers; | ||
|
||
import static com.epam.jdi.light.asserts.core.SoftAssert.jdiAssert; | ||
|
||
public interface HasImageAssert<A, E extends HasImage> extends IBaseAssert<HasImage> { | ||
|
||
default A hasImage(){ | ||
jdiAssert(element().hasImage(), Matchers.is(true), "Image doesn't exists"); | ||
return (A) this; | ||
} | ||
|
||
default A withoutImage(){ | ||
jdiAssert(element().hasImage(), Matchers.is(true), "Image exists"); | ||
return (A) this; | ||
} | ||
|
||
} |
15 changes: 7 additions & 8 deletions
15
...i/light/material/interfaces/HasImage.java → ...di/light/ui/html/interfaces/HasImage.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 |
---|---|---|
@@ -1,32 +1,31 @@ | ||
package com.epam.jdi.light.material.interfaces; | ||
package com.epam.jdi.light.ui.html.interfaces; | ||
|
||
import com.epam.jdi.light.common.JDIAction; | ||
import com.epam.jdi.light.elements.interfaces.base.ICoreElement; | ||
import com.epam.jdi.light.ui.html.elements.common.Image; | ||
|
||
/** | ||
* Represents an element that has an {@link Image}. | ||
*/ | ||
public interface HasImage extends ICoreElement { | ||
|
||
default String imageLocator() { | ||
return ".//img"; | ||
} | ||
/** | ||
* Gets the image of the element. | ||
* | ||
* @return image of the element as {@link Image} | ||
*/ | ||
@JDIAction("Get '{name}' image") | ||
default Image image() { | ||
return new Image().setCore(Image.class, find("img")); | ||
return new Image().setCore(Image.class, find(imageLocator())); | ||
} | ||
|
||
/** | ||
* Checks that image or background image is displayed. | ||
* | ||
* @return {@code true} if the image is displayed, otherwise {@code false} | ||
*/ | ||
@JDIAction("Check that '{name}' image is displayed") | ||
@JDIAction("Check that '{name}' image exist") | ||
default boolean hasImage() { | ||
return core().find("img").isDisplayed() | ||
|| core().find("//*[contains(@style, 'background-image')]").isDisplayed(); | ||
return image().isExist(); | ||
} | ||
} |
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
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
Oops, something went wrong.