Project

General

Profile

« Previous | Next » 

Revision 0f32b53b

Added by Andreas Kohlbecker over 3 years ago

ref #9175 tests for map visibility

View differences:

src/main/java/eu/etaxonomy/dataportal/pages/PortalPage.java
85 85

  
86 86
    // ==== WebElements === //
87 87

  
88
    @FindBy(className="node")
89
    protected WebElement portalContent;
88
    @FindBy(id = "content")
89
    protected WebElement mainContentZen;
90

  
91
    @FindBy(id = "contento")
92
    protected WebElement mainContentGarland;
90 93

  
91 94
//    @FindBy(tagName="title")
92 95
//    @CacheLookup
......
110 113

  
111 114
    private Boolean isZenTheme;
112 115

  
116
    private BaseElement mainContentBaseElement;
117

  
113 118
    public boolean isZenTheme() {
114 119
        if(isZenTheme == null) {
115 120
            try {
......
251 256
    }
252 257

  
253 258
    /**
254
     * navigate and reload the page if not jet there
259
     * navigate and reload the page if not yet there
255 260
     */
256 261
    public void get() {
257 262
        if(!driver.getCurrentUrl().equals(pageUrl.toString())){
......
380 385
    }
381 386

  
382 387
    /**
383
     * Provides access to the the CDM specific content which is put into the <code>div</code> DOM element which has the class attribute <code>class="... node ..."</code>
384
     * @return
388
     * Provides access to the the CDM specific main content <code>div</code> element.
389
     *
390
     *
391
     * @return the main content div
385 392
     */
386 393
    public BaseElement getDataPortalContent() {
387
        return new BaseElement(portalContent);
394
        return new BaseElement(mainContent());
395
    }
396

  
397

  
398
    protected WebElement mainContent() {
399
        WebElement mainContent;
400
        if(isZenTheme()) {
401
            mainContent = mainContentZen;
402
        } else {
403
            // fallback to garland
404
            mainContent = mainContentGarland;
405
        }
406
        return mainContent;
388 407
    }
389 408

  
390 409
    public ClassificationTreeBlock getClassificationTree() {
src/main/java/eu/etaxonomy/dataportal/pages/TaxonPage.java
76 76
    }
77 77

  
78 78
    public List<WebElement> getTaxonNodeStatusContainer() {
79
        List<WebElement> taxonNodeStatus = portalContent.findElements(By.className("taxon-node-status"));
79
        List<WebElement> taxonNodeStatus = mainContent().findElements(By.className("taxon-node-status"));
80 80
        return taxonNodeStatus;
81 81
    }
82 82

  
83 83
    public List<TaxonNodeStatusElement> getTaxonNodeStates() {
84 84
        List<TaxonNodeStatusElement> statusEls = new ArrayList<>();
85
        List<WebElement> taxonNodeStatus = portalContent.findElements(By.className("taxon-node-status"));
85
        List<WebElement> taxonNodeStatus = mainContent().findElements(By.className("taxon-node-status"));
86 86
        for(WebElement el : taxonNodeStatus) {
87 87
            statusEls.add(new TaxonNodeStatusElement(el));
88 88
        }
src/main/java/eu/etaxonomy/dataportal/pages/TaxonProfilePage.java
147 147

  
148 148
        logger.setLevel(Level.TRACE);
149 149
        logger.trace("getFeatureBlockAt()");
150
        List<WebElement> featureBlocks = portalContent.findElements(By.className("block-cdm-dataportal-feature"));
150
        List<WebElement> featureBlocks = mainContent().findElements(By.className("block-cdm-dataportal-feature"));
151 151
        Assert.assertTrue("Too few feature block elements", featureBlocks.size() >= position);
152 152
        for(WebElement b : featureBlocks){
153 153
            if(logger.isTraceEnabled()) {
......
164 164

  
165 165
    public FeatureBlock getFeatureBlockAt(int position, String featureName, String enclosingTag, String ... elementTag){
166 166

  
167
        List<WebElement> featureBlocks = portalContent.findElements(By.className("block-cdm-dataportal-feature"));
167
        List<WebElement> featureBlocks = mainContent().findElements(By.className("block-cdm-dataportal-feature"));
168 168
        Assert.assertTrue("Too few feature block elements", featureBlocks.size() >= position);
169 169
        for(WebElement b : featureBlocks){
170 170
            if (b.getAttribute("id").equals("block-cdm-dataportal-feature-" + normalizeClassAttribute(featureName))){

Also available in: Unified diff