Project

General

Profile

« Previous | Next » 

Revision 8e677507

Added by Andreas Kohlbecker over 3 years ago

ref #8543 improving zen_dataportal theme detection

View differences:

src/main/java/eu/etaxonomy/dataportal/pages/PortalPage.java
28 28
import org.openqa.selenium.support.PageFactory;
29 29
import org.openqa.selenium.support.ui.WebDriverWait;
30 30

  
31
import com.gargoylesoftware.htmlunit.ElementNotFoundException;
31 32
import com.google.common.base.Function;
32 33

  
33 34
import eu.etaxonomy.dataportal.DataPortalContext;
......
110 111

  
111 112
    public boolean isZenTheme() {
112 113
        if(isZenTheme == null) {
113
            isZenTheme = driver.getPageSource().contains("themes/zen_dataportal");
114
            try {
115
                WebElement bodyElement = driver.findElement(By.tagName("body"));
116
                isZenTheme = bodyElement.getAttribute("class").contains("zen_dataportal");
117
            } catch (ElementNotFoundException e) {
118
                // IGNORE
119
            }
114 120
        }
115 121
        return isZenTheme.booleanValue();
116 122
    }

Also available in: Unified diff