private String osSpecificPathOf(final String fileToUpload) { if (isAFullWindowsPath(fileToUpload)) { return windowsNative(fileToUpload); } else { return fileToUpload; } }
public FileToUpload(final String filename) { if (isOnTheClasspath(filename)) { this.filename = getFileFromResourcePath(filename); } else { this.filename = getFileFromFileSystem(filename); } }
private boolean isOnTheClasspath(final String filename) { if (isOnTheUnixFileSystem(filename) || isOnTheWindowsFileSystem(filename)) { return false; } else { return (resourceOnClasspath(filename) != null); } }
public void to(final WebElement uploadFileField) { String filePath = windowsSafe(uploadableFilePathTo(uploadFileField).forFile(resolvedFilename)); checkThatFileExistsFor(filePath); uploadFileField.sendKeys(osSpecificPathOf(filePath)); }
public Set<String> getSelectedOptionLabelsFrom(final WebElement dropdown) { return Dropdown.forWebElement(dropdown).getSelectedOptionLabels(); }
public static List<WebElement> filterRows(final WebElement table, final BeanMatcher... matchers) { return new HtmlTable(table).getRowElementsWhere(matchers); }
public String getSelectedLabelFrom(final WebElement dropdown) { return Dropdown.forWebElement(dropdown).getSelectedLabel(); }
private FilePathLocator uploadableFilePathTo(WebElement uploadFileField) { return (isRemoteDriver()) ? new RemoteFilePathLocator(uploadFileField) : new LocalFilePathLocator(); }
var items = []; for(var i = 1; i <= 100; i++) { items.push({ value: i, name: i }); } new Dropdown('dropdown', { items: items });
public HtmlTable inTable(WebElement table) { return new HtmlTable(table, headings); } }
private EnoughCellsCheck enoughCellsFor(List<String> headings) { return new EnoughCellsCheck(headings); }
public FileToUpload(WebDriver driver, final String requestedFilename) { this.driver = driver; this.requestedFilename = requestedFilename; this.resolvedFilename = resolveAsBestWeCan(requestedFilename); }
private String osSpecificPathOf(final String fileToUpload) { if (isAFullWindowsPath(fileToUpload)) { return windowsNative(fileToUpload); } else { return fileToUpload; } }
public FileToUpload(final String filename) { if (isOnTheClasspath(filename)) { this.filename = getFileFromResourcePath(filename); } else { this.filename = getFileFromFileSystem(filename); } }
private boolean isOnTheClasspath(final String filename) { if (isOnTheUnixFileSystem(filename) || isOnTheWindowsFileSystem(filename)) { return false; } else { return (resourceOnClasspath(filename) != null); } }
public Set<String> getSelectedOptionLabelsFrom(final WebElement dropdown) { return Dropdown.forWebElement(dropdown).getSelectedOptionLabels(); }
public List<WebElement> filterRows(final BeanMatcher... matchers) { return new HtmlTable(tableElement).getRowElementsWhere(matchers); }
public static Dropdown forWebElement(final WebElement webElement) { return new Dropdown(webElement); }
private String osSpecificPathOf(final String fileToUpload) { if (isAFullWindowsPath(fileToUpload)) { return windowsNative(fileToUpload); } else { return fileToUpload; } }