org.specrunner.webdriver.util
Class WritablePage

java.lang.Object
  extended by org.specrunner.webdriver.util.WritablePage
All Implemented Interfaces:
IWritable

public class WritablePage
extends Object
implements IWritable

Implements the page recording.

Author:
Thiago Santos

Constructor Summary
WritablePage(Map<String,Object> information, org.openqa.selenium.WebDriver driver)
          The writable with extra information plus web driver.
WritablePage(org.openqa.selenium.WebDriver driver)
          Writable page by web driver.
 
Method Summary
protected  void dump(File from, String target, Map<String,String> map, String label)
          Dump the file from temporary to target.
protected  void dumpScreenshot(org.openqa.selenium.WebDriver source, org.openqa.selenium.TakesScreenshot driver)
          Dump a screen shot of web driver which implements TakesScreenshot.
protected  String getExtension(File scrFile)
          Gets the file extension.
 Map<String,Object> getInformation()
           
 boolean hasInformation()
           
 Map<String,String> writeTo(String target)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WritablePage

public WritablePage(org.openqa.selenium.WebDriver driver)
Writable page by web driver.

Parameters:
driver - The driver.

WritablePage

public WritablePage(Map<String,Object> information,
                    org.openqa.selenium.WebDriver driver)
The writable with extra information plus web driver.

Parameters:
information - The extra information.
driver - The web driver.
Method Detail

hasInformation

public boolean hasInformation()
Specified by:
hasInformation in interface IWritable

dumpScreenshot

protected void dumpScreenshot(org.openqa.selenium.WebDriver source,
                              org.openqa.selenium.TakesScreenshot driver)
                       throws IOException
Dump a screen shot of web driver which implements TakesScreenshot.

Parameters:
source - The web driver source.
driver - The web driver casted to screenshot object.
Throws:
IOException - On writing errors.

getExtension

protected String getExtension(File scrFile)
Gets the file extension.

Parameters:
scrFile - The source.
Returns:
The corresponding file extension.

getInformation

public Map<String,Object> getInformation()
Specified by:
getInformation in interface IWritable

writeTo

public Map<String,String> writeTo(String target)
                           throws ResultException
Specified by:
writeTo in interface IWritable
Throws:
ResultException

dump

protected void dump(File from,
                    String target,
                    Map<String,String> map,
                    String label)
             throws ResultException
Dump the file from temporary to target.

Parameters:
from - The temporary file.
target - The target.
map - The map of informations.
label - The label to be used.
Throws:
ResultException - On dump errors.


Copyright © 2013. All rights reserved.