com.atlassian.confluence.pageobjects
Class WebdriverUtils

java.lang.Object
  extended by com.atlassian.confluence.pageobjects.WebdriverUtils

public class WebdriverUtils
extends java.lang.Object

A utility class for webdriver tests.


Constructor Summary
WebdriverUtils(com.atlassian.pageobjects.elements.PageElementFinder pageElementFinder, org.openqa.selenium.JavascriptExecutor executor, com.atlassian.pageobjects.elements.timeout.Timeouts timeouts)
           
 
Method Summary
 java.lang.String getMetadata(java.lang.String name)
          Returns the meta tag's content.
 long getMetadataLong(java.lang.String name)
           
 java.lang.Long getPageRequestTime()
          Returns the confluence request time served in the page's meta tag Note: this is done via javascript as the page can change during the time the elements are read
 void waitForNoPageReload(com.atlassian.pageobjects.elements.PageElement elementToClick)
           
 void waitForPageChange(com.atlassian.pageobjects.elements.PageElement elementToClick)
          This method is useful when a new page is loaded via javascript.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebdriverUtils

@Inject
public WebdriverUtils(com.atlassian.pageobjects.elements.PageElementFinder pageElementFinder,
                             org.openqa.selenium.JavascriptExecutor executor,
                             com.atlassian.pageobjects.elements.timeout.Timeouts timeouts)
Method Detail

waitForPageChange

public void waitForPageChange(com.atlassian.pageobjects.elements.PageElement elementToClick)
This method is useful when a new page is loaded via javascript. e.g. when the Create button in the blueprint dialogs is clicked and the newly created page/space is loaded. This implementation is a little hacky but the best solution at the time of writing.

Parameters:
elementToClick - the element to click before waiting for the page to change

waitForNoPageReload

public void waitForNoPageReload(com.atlassian.pageobjects.elements.PageElement elementToClick)

getPageRequestTime

public java.lang.Long getPageRequestTime()
Returns the confluence request time served in the page's meta tag Note: this is done via javascript as the page can change during the time the elements are read


getMetadata

public java.lang.String getMetadata(java.lang.String name)
Returns the meta tag's content. Note that you do not have to pass the "ajs-" prefix to the name, this is done for you.

Parameters:
name - name of the meta tag, excluding the ajs- prefix
Returns:
the content in the meta tag

getMetadataLong

public long getMetadataLong(java.lang.String name)


Copyright © 2003-2014 Atlassian. All Rights Reserved.