List of usage examples for org.openqa.selenium By cssSelector
public static By cssSelector(String cssSelector)
From source file:com.cognifide.qa.bb.aem.touch.siteadmin.aem61.SiteadminToolbar.java
License:Apache License
private WebElement getMoreButton() { return driver.findElement(By.cssSelector(MORE_BUTTON_SELECTOR)); }
From source file:com.cognifide.qa.bb.aem.touch.siteadmin.aem61.SiteadminToolbar.java
License:Apache License
private WebElement getMoveButton() { return driver.findElement(By.cssSelector(MOVE_BUTTON_SELECTOR)); }
From source file:com.cognifide.qa.bb.aem.touch.siteadmin.aem61.SiteadminToolbar.java
License:Apache License
private WebElement getPublishButton() { return driver.findElement(By.cssSelector(PUBLISH_BUTTON_SELECTOR)); }
From source file:com.cognifide.qa.bb.aem.touch.siteadmin.aem61.SiteadminToolbar.java
License:Apache License
private WebElement getUnpublishButton() { return driver.findElement(By.cssSelector(UNPUBLISH_BUTTON_SELECTOR)); }
From source file:com.cognifide.qa.bb.aem.touch.siteadmin.aem61.SiteadminToolbar.java
License:Apache License
private void clickCreatePageButton() { driver.findElement(By.cssSelector(TOOLBAR_CREATE_BUTTON_SELECTOR)).click(); driver.findElement(By.cssSelector(POPOVER_CREATE_PAGE_BUTTON_SELECTOR)).click(); }
From source file:com.cognifide.qa.bb.aem.touch.siteadmin.aem61.SiteadminToolbar.java
License:Apache License
private void clickButtonFromMoreSection(String buttonLabel) { List<WebElement> elements = driver.findElements(By.cssSelector(BUTTON_LIST_SELECTOR)); elements.stream().filter(t -> t.getText().equals(buttonLabel)).findFirst() .orElseThrow(() -> new IllegalStateException("Specified element is not present")).click(); }
From source file:com.cognifide.qa.bb.aem.touch.siteadmin.aem61.TemplateList.java
License:Apache License
void selectTemplate(String templateName) { WebElement template = templates.stream().filter( t -> StringUtils.equals(t.findElement(By.cssSelector("div.label > h4")).getText(), templateName)) .findFirst().orElseThrow(() -> new IllegalArgumentException("Template not found: " + templateName)); template.click();/*from w ww . ja v a2s . c om*/ }
From source file:com.cognifide.qa.bb.aem.touch.siteadmin.aem62.calendar.CoralCalendar.java
License:Apache License
private void chooseDay(int dayOfMonth) { String day = String.valueOf(dayOfMonth); List<WebElement> daysToSelect = driver .findElements(By.cssSelector(".coral-Calendar-calendarBody > table > tbody > tr > td > a")); daysToSelect.stream().filter(t -> StringUtils.equals(t.getText(), day)).findFirst().orElseThrow( () -> new IllegalArgumentException("No clickable day of month found in the current context")) .click();// w w w .j a va 2 s. c o m }
From source file:com.cognifide.qa.bb.aem.touch.siteadmin.aem62.ContentToolbar.java
License:Apache License
public WebElement getCreateButton() { List<WebElement> buttonsLabels = driver .findElements(By.cssSelector("button.coral-Button--primary coral-button-label.coral-Button-label")); return buttonsLabels.stream().filter(label -> label.getText().equals(CREATE_BTN_LABEL)).findFirst() .orElseThrow(() -> new IllegalStateException("Expected element is not found")); }
From source file:com.cognifide.qa.bb.aem.touch.siteadmin.aem62.CreatePageWizard.java
License:Apache License
private WebElement getButtonByLabel(String label) { return buttons.stream() .filter(n -> n.findElement(By.cssSelector("coral-button-label")).getText().equals(label)) .findFirst().get();/*from w w w.j a v a2s.c o m*/ }