Project

General

Profile

Revision 73703e18

ID73703e189d61c3c5220e87f8b168d654bef08170
Parent e42db5b0
Child 67f5eac2

Added by Andreas Kohlbecker 9 months ago

fix #8076 typified name test for registration page implemented

View differences:

modules/cdm_dataportal/includes/name.inc
579 579
  // name and typedesignation in detail
580 580
  if($registration_dto->nameRef){
581 581
    $name = cdm_ws_get(CDM_WS_PORTAL_NAME, $registration_dto->nameRef->uuid);
582
    $render_array['name'] = markup_to_render_array('<p class="name">' . render_taxon_or_name($name) . '</p>', 0);
582
    $render_array['published_name'] = markup_to_render_array('<p class="published-name">' . render_taxon_or_name($name) . '</p>', 0);
583 583
    $name_relations = cdm_ws_fetch_all(str_replace("$0", $registration_dto->nameRef->uuid, CDM_WS_PORTAL_NAME_NAME_RELATIONS));
584 584
    $render_array['name_relations'] = markup_to_render_array(render_name_relationships_of($name_relations, $registration_dto->nameRef->uuid, null, false));
585 585
    $render_array['name_relations']['#weight'] = 10;
src/main/java/eu/etaxonomy/dataportal/elements/RegistrationItem.java
38 38
    protected WebElement metadata;
39 39
    protected WebElement identifier;
40 40
    protected WebElement nameElement;
41
    protected WebElement typifiedNameElement;
41 42
    protected WebElement summaryElement;
42 43

  
43 44
    /**"
......
56 57

  
57 58
        if(style == null){
58 59
            try {
59
                nameElement = containerElement.findElement(By.cssSelector(".name"));
60
            } catch (Exception e) { /* IGNORE */}
60
                nameElement = containerElement.findElement(By.cssSelector(".published-name"));
61
            } catch (Exception e) {
62
                try {
63
                    typifiedNameElement = containerElement.findElement(By.cssSelector(".typified-name"));
64
                } catch (Exception e2) {
65
                    // typifiedNameElement must exist whennameElement is not present, so we throw the  Exception in this case:
66
                    throw e2;
67
                }
68
            }
61 69
            try{
62 70
                specimenTypeDesignations = containerElement.findElements(By.cssSelector(".specimen_type_designation"));
63 71
            } catch (Exception e) { /* IGNORE */}
src/main/java/eu/etaxonomy/dataportal/elements/RegistrationItemFull.java
30 30
        return nameElement;
31 31
    }
32 32

  
33
    public WebElement getTypifiedNameElement() {
34
        return typifiedNameElement;
35
    }
36

  
33 37
    public List<WebElement> getSpecimenTypeDesignations() {
34 38
        return specimenTypeDesignations;
35 39
    }
src/test/java/eu/etaxonomy/dataportal/selenium/tests/reference/RegistrationPageTest.java
83 83
                "Epitype: (B 40 0040871).",
84 84
                regItem.getSpecimenTypeDesignations().get(0).getText());
85 85
        assertEquals(
86
                "for Planothidium victori Novis, Braidwood & Kilroy in Phytotaxa 64. 2012",
87
                regItem.getTypifiedNameElement().getText());
88
        assertEquals(
86 89
                "Jahn, R., Abarca, N., Gemeinholzer, B. & al., Planothidium lanceolatum and Planothicium frequentissimum reinvestigated wieht molecular methods and morphology: four new species and the taxonomic importance of the sinus and cavum in Diatom Research 32: 75-107. 2017",
87 90
                regItem.getCitation().getText());
88 91
        assertEquals(

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)