public class ScreenServiceImpl extends Object implements ScreenService
Constructor and Description |
---|
ScreenServiceImpl() |
Modifier and Type | Method and Description |
---|---|
double |
getDifferencePercent(String actual,
String expected)
Percentage difference between images.
|
void |
saveScreenshot(String screenName)
Indicates a driver that can capture a screenshot and store it in different ways.
|
void |
saveScreenshot(String screenName,
org.openqa.selenium.WebElement element)
Indicates a driver that can capture a screenshot of one element only and store it in different ways.
|
void |
scrollIntoView(org.openqa.selenium.WebElement element) |
void |
startVideoCapture(String screenName)
Start video capture with screenName.avi in DOWNLOAD_FILES_FOLDER folder.
|
void |
stopVideoCapture()
Stop video capture in DOWNLOAD_FILES_FOLDER folder..
|
void |
takeScreenshot(io.cucumber.core.api.Scenario scenario)
Indicates a driver that can capture a screenshot and store it in different ways.
|
public void takeScreenshot(io.cucumber.core.api.Scenario scenario)
takeScreenshot
in interface ScreenService
scenario
- is instance of {link cucumber.api.Scenario}public void saveScreenshot(String screenName) throws IOException
saveScreenshot
in interface ScreenService
screenName
- name of screenshot file.IOException
- if file or directory is wrong.public void saveScreenshot(String screenName, org.openqa.selenium.WebElement element) throws IOException
saveScreenshot
in interface ScreenService
screenName
- name of screenshot file.element
- WebElement concerned.IOException
- if file or directory is wrong.public void startVideoCapture(String screenName) throws IOException, AWTException
startVideoCapture
in interface ScreenService
screenName
- name of output file (video file).IOException
- if file or directory is wrong.AWTException
- if configuration video file is wrong.public void stopVideoCapture() throws IOException
stopVideoCapture
in interface ScreenService
IOException
- if file or directory is wrong.public void scrollIntoView(org.openqa.selenium.WebElement element)
scrollIntoView
in interface ScreenService
element
- WebElement concerned.public double getDifferencePercent(String actual, String expected) throws IOException
getDifferencePercent
in interface ScreenService
actual
- is actual source.expected
- is expected source.IOException
Copyright © 2023 NoraUi. All rights reserved.