Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import org.openqa.selenium.WebDriver;
import com.relevantcodes.extentreports.LogStatus;
import com.standardchartered.s2b.utility.Constant;
import com.sun.istack.internal.NotNull;
public final class Report
{
private WebDriver driver;
ActionMethods action_method = new ActionMethods( driver);
private volatile static Report INSTANCE;
private Report(){
if( Report.INSTANCE != null ) {
throw new InstantiationError( "Creating of object is not allowed." );
}
}
public static Report getInstance(){
if(INSTANCE == null){
synchronized(Report.class){
if(INSTANCE == null){
INSTANCE = new Report();
}
}
}
return INSTANCE;
}
@Override
protected Object clone() throws CloneNotSupportedException {
throw new CloneNotSupportedException("Cloning of report class is not allowed");
}
//Handling Serialization
private Object readResolve(){
return INSTANCE;
}
public void generateReport(String Context, @NotNull String statusFlag, WebDriver driver)
{
System.out.println("Adding execution status to report....");
if(statusFlag == null){
System.out.println("Status not Provided. check statusflag variable");
}
else if(statusFlag.contains("Passed") & statusFlag!=null)
{
System.out.println( " Status in pass block : " + statusFlag );
Constant.extentTest.log(LogStatus.PASS, Context , "<font size="+3+" color='#7CFC00'>"+"Passed" +"</font>"+ " <br />" + statusFlag.replace("Passed", ""));
}else if(statusFlag.contains("Failed") & statusFlag!=null )
{
System.out.println( " Status in Fail block : " + statusFlag );
String screenshotPath= action_method.captureScreenshot(driver);
System.out.println("ScreenPath Returned " + screenshotPath);
// String imageOfFailedScenario = Constant.extentTest.addBase64ScreenShot(screenshotPath);
Constant.extentTest.log(LogStatus.FAIL,
Context ,
"<span title='"+Constant.statusFlag.replaceAll("'", "'")+"'><a href='"+Constant.logsPath+"/automationFramework.log'><font size="+3+" color='#DC143C'>FAILED</font></a></span>"+
Constant.extentTest.addBase64ScreenShot(screenshotPath));
}else if(statusFlag.contains("Skipped") & statusFlag!=null)
{
System.out.println( " Status in Skipped block : " + statusFlag );
System.out.println("skipped" + statusFlag);
Constant.extentTest.log(LogStatus.SKIP,Context, statusFlag);
}
else if(statusFlag.contains("Info") & statusFlag!=null )
{
System.out.println( " Status in Info block : " + statusFlag );
Constant.extentTest.log(LogStatus.INFO,Context, statusFlag);
}else{
System.out.println("Status not updated to report.");
}
Constant.statusFlag=null;
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team