Skip to content

Commit

Permalink
Merge pull request #20 from BorderTech/futher_implementations
Browse files Browse the repository at this point in the history
Futher implementations
  • Loading branch information
jonathanaustin authored Sep 26, 2023
2 parents 7acc2f1 + efd4911 commit c252320
Show file tree
Hide file tree
Showing 20 changed files with 394 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.github.bordertech.webfriends.api.common.tags;

import com.github.bordertech.webfriends.api.common.tag.TagType;
import com.github.bordertech.webfriends.api.element.table.HCaption;

/**
* HTML <code>caption</code> tag.
*
* @param <T> the element type
*
*/
public interface TagCaption<T extends HCaption> extends TagType<T> {

@Override
default String getTagName() {
return "caption";
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.github.bordertech.webfriends.api.common.tags;

import com.github.bordertech.webfriends.api.common.tag.TagType;
import com.github.bordertech.webfriends.api.element.grouping.HDetails;

/**
* HTML <code>details</code> tag.
*
* @param <T> the element type
*/
public interface TagDetails<T extends HDetails> extends TagType<T> {

@Override
default String getTagName() {
return "details";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.github.bordertech.webfriends.api.common.tags;

import com.github.bordertech.webfriends.api.common.tag.TagType;
import com.github.bordertech.webfriends.api.element.grouping.HSummary;

/**
* HTML <code>summary</code> tag.
*
* @param <T> the element type
*/
public interface TagSummary<T extends HSummary> extends TagType<T> {

@Override
default String getTagName() {
return "summary";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.github.bordertech.webfriends.api.element.grouping;

import com.github.bordertech.webfriends.api.common.combo.FlowPalpableElement;
import com.github.bordertech.webfriends.api.common.model.ScriptSupportingModel;
import com.github.bordertech.webfriends.api.common.tags.TagDetails;

/**
* Details element.
*/
public interface HDetails extends FlowPalpableElement, ScriptSupportingModel {

@Override
TagDetails getTagType();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.github.bordertech.webfriends.api.element.grouping;

import com.github.bordertech.webfriends.api.common.combo.FlowPalpableElement;
import com.github.bordertech.webfriends.api.common.model.ScriptSupportingModel;
import com.github.bordertech.webfriends.api.common.tags.TagSummary;

/**
* Summary element.
*/
public interface HSummary extends FlowPalpableElement, ScriptSupportingModel {

@Override
TagSummary getTagType();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.github.bordertech.webfriends.api.element.table;

import com.github.bordertech.webfriends.api.common.combo.FlowPalpableWithPhrasingElement;
import com.github.bordertech.webfriends.api.common.tags.TagCaption;

/**
* Caption element.
*/
public interface HCaption extends FlowPalpableWithPhrasingElement {

@Override
TagCaption getTagType();

}
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,14 @@ public interface HRow extends NoCategory, FlowModel, ScriptSupportingModel, Cust
HDataCell getRowCellAsData(final int colIdx);

/**
* @return the row header cell for this row or null
* @return true if the row has header cells
*/
HHeaderCell getRowHeader();
boolean hasRowHeaderCells();

/**
* @return true if the row has a header
* @return true if the row has data cells
*/
boolean hasRowHeader();
boolean hasRowDataCells();

/**
* @return the cell elements for this row. Could be a mix of data and header elements if the row has a header.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,12 @@ public interface HTable extends FlowPalpableElement, ScriptSupportingModel {
*/
HRow getRow(final int rowIdx);

/**
* @return the list of rows
*/
List<? extends HRow> getRows();


/**
* @return the no data message or null
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import com.github.bordertech.webfriends.selenium.common.tags.STagAudio;
import com.github.bordertech.webfriends.selenium.common.tags.STagBody;
import com.github.bordertech.webfriends.selenium.common.tags.STagButton;
import com.github.bordertech.webfriends.selenium.common.tags.STagCaption;
import com.github.bordertech.webfriends.selenium.common.tags.STagDatalist;
import com.github.bordertech.webfriends.selenium.common.tags.STagDetails;
import com.github.bordertech.webfriends.selenium.common.tags.STagDialog;
import com.github.bordertech.webfriends.selenium.common.tags.STagDiv;
import com.github.bordertech.webfriends.selenium.common.tags.STagFieldSet;
Expand Down Expand Up @@ -50,6 +52,7 @@
import com.github.bordertech.webfriends.selenium.common.tags.STagSource;
import com.github.bordertech.webfriends.selenium.common.tags.STagSpan;
import com.github.bordertech.webfriends.selenium.common.tags.STagStrong;
import com.github.bordertech.webfriends.selenium.common.tags.STagSummary;
import com.github.bordertech.webfriends.selenium.common.tags.STagTD;
import com.github.bordertech.webfriends.selenium.common.tags.STagTH;
import com.github.bordertech.webfriends.selenium.common.tags.STagTR;
Expand Down Expand Up @@ -82,7 +85,9 @@ public final class SeleniumTags {
public static final STagAudio AUDIO = new STagAudio();
public static final STagBody BODY = new STagBody();
public static final STagButton BUTTON = new STagButton();
public static final STagCaption CAPTION = new STagCaption();
public static final STagDatalist DATALIST = new STagDatalist();
public static final STagDetails DETAILS = new STagDetails();
public static final STagDialog DIALOG = new STagDialog();
public static final STagDiv DIV = new STagDiv();
public static final STagFieldSet FIELDSET = new STagFieldSet();
Expand Down Expand Up @@ -129,6 +134,7 @@ public final class SeleniumTags {
public static final STagSource SOURCE = new STagSource();
public static final STagSpan SPAN = new STagSpan();
public static final STagStrong STRONG = new STagStrong();
public static final STagSummary SUMMARY = new STagSummary();
public static final STagTable TABLE = new STagTable();
public static final STagTD TD = new STagTD();
public static final STagTextArea TEXTAREA = new STagTextArea();
Expand All @@ -141,11 +147,11 @@ public final class SeleniumTags {

private static final List<TagHeadingTypeSelenium> HEADING_TAGS = Arrays.asList(H1, H2, H3, H4, H5, H6);
private static final List<TagTypeSelenium> TAGS = Arrays.asList(
A, AUDIO, BODY, BUTTON, DATALIST, DIALOG, DIV, FIELDSET, FIGURE, FOOTER, FORM, H1, H2, H3, H4, H5, H6,
A, AUDIO, BODY, BUTTON, CAPTION, DATALIST, DETAILS, DIALOG, DIV, FIELDSET, FIGURE, FOOTER, FORM, H1, H2, H3, H4, H5, H6,
HEAD, HEADER, HTML, IMG, INPUT_CHECKBOX, INPUT_COLOR, INPUT_COLOR, INPUT_DATE, INPUT_DATETIME,
INPUT_EMAIL, INPUT_FILEUPLOAD, INPUT_NUMBER, INPUT_PASSWORD, INPUT_RADIO, INPUT_RADIO,
INPUT_RANGE, INPUT_SEARCH, INPUT_TELEPHONE, INPUT_TEXT, INPUT_URL,
LABEL, LISTITEM, MENU, METER, NAV, OL, OPTGROUP, OPTION, P, PROGRESS, SECTION, SELECT, SOURCE, SPAN, STRONG,
LABEL, LISTITEM, MENU, METER, NAV, OL, OPTGROUP, OPTION, P, PROGRESS, SECTION, SELECT, SOURCE, SPAN, SUMMARY, STRONG,
TABLE, TD, TEXTAREA, TH, TITLE, TR, TRACK,
UL, VIDEO
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.github.bordertech.webfriends.selenium.common.tags;

import com.github.bordertech.webfriends.api.common.tags.TagCaption;
import com.github.bordertech.webfriends.selenium.element.table.SCaption;

/**
* HTML <code>caption</code> tag.
*/
public class STagCaption extends AbstractTag<SCaption> implements TagCaption<SCaption> {

/**
* Default constructor.
*/
public STagCaption() {
super(SCaption.class);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.github.bordertech.webfriends.selenium.common.tags;

import com.github.bordertech.webfriends.api.common.tags.TagDetails;
import com.github.bordertech.webfriends.selenium.element.grouping.SDetails;

/**
* HTML <code>details</code> tag.
*/
public class STagDetails extends AbstractTag<SDetails> implements TagDetails<SDetails> {

/**
* Default constructor.
*/
public STagDetails() {
super(SDetails.class);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.github.bordertech.webfriends.selenium.common.tags;

import com.github.bordertech.webfriends.api.common.tags.TagSummary;
import com.github.bordertech.webfriends.selenium.element.grouping.SSummary;

/**
* HTML <code>summary</code> tag.
*/
public class STagSummary extends AbstractTag<SSummary> implements TagSummary<SSummary> {

/**
* Default constructor.
*/
public STagSummary() {
super(SSummary.class);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.github.bordertech.webfriends.selenium.element.grouping;

import com.github.bordertech.webfriends.api.element.grouping.HDetails;
import com.github.bordertech.webfriends.selenium.common.feature.ContainerWithButtons;
import com.github.bordertech.webfriends.selenium.common.feature.ContainerWithChildren;
import com.github.bordertech.webfriends.selenium.common.tag.SeleniumTags;
import com.github.bordertech.webfriends.selenium.common.tags.STagDetails;
import com.github.bordertech.webfriends.selenium.element.AbstractSElement;

/**
* Selenium details element.
*/
public class SDetails extends AbstractSElement implements HDetails,
ContainerWithChildren, ContainerWithButtons {

@Override
public STagDetails getTagType() {
return SeleniumTags.DETAILS;
}



}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package com.github.bordertech.webfriends.selenium.element.grouping;

import com.github.bordertech.webfriends.api.element.grouping.HSummary;
import com.github.bordertech.webfriends.selenium.common.feature.ContainerWithButtons;
import com.github.bordertech.webfriends.selenium.common.feature.ContainerWithChildren;
import com.github.bordertech.webfriends.selenium.common.tag.SeleniumTags;
import com.github.bordertech.webfriends.selenium.common.tags.STagSummary;
import com.github.bordertech.webfriends.selenium.element.AbstractSElement;

/**
* Selenium summary element.
*/
public class SSummary extends AbstractSElement implements HSummary,
ContainerWithChildren, ContainerWithButtons {

@Override
public STagSummary getTagType() {
return SeleniumTags.SUMMARY;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.github.bordertech.webfriends.selenium.common.tag.SeleniumTags;
import com.github.bordertech.webfriends.selenium.common.tags.STagDialog;
import com.github.bordertech.webfriends.selenium.element.AbstractSElement;
import org.apache.commons.lang3.StringUtils;

/**
* Selenium dialog element.
Expand All @@ -19,12 +20,12 @@ public STagDialog getTagType() {

@Override
public String getDialogTitle() {
throw new UnsupportedOperationException("Not supported yet.");
return getDriver().findWebFriend(SeleniumTags.HEADER, getWebElement()).getHeaderText();
}

@Override
public boolean isOpen() {
throw new UnsupportedOperationException("Not supported yet.");
return StringUtils.isNotBlank(getWebElement().getAttribute("open"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package com.github.bordertech.webfriends.selenium.element.table;

import com.github.bordertech.webfriends.api.element.table.HCaption;
import com.github.bordertech.webfriends.selenium.common.tag.SeleniumTags;
import com.github.bordertech.webfriends.selenium.common.tags.STagCaption;
import com.github.bordertech.webfriends.selenium.element.AbstractSElement;

/**
* Selenium Caption element.
*/
public class SCaption extends AbstractSElement implements HCaption {

@Override
public STagCaption getTagType() {
return SeleniumTags.CAPTION;
}

}
Loading

0 comments on commit c252320

Please sign in to comment.