001/*
002 * (C) Copyright 2014 Nuxeo SA (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl-2.1.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     <a href="mailto:grenard@nuxeo.com">Guillaume Renard</a>
016 *
017 */
018
019package org.nuxeo.functionaltests.pages.workflow;
020
021import java.util.List;
022
023import org.nuxeo.functionaltests.Required;
024import org.nuxeo.functionaltests.pages.AbstractPage;
025import org.openqa.selenium.By;
026import org.openqa.selenium.WebDriver;
027import org.openqa.selenium.WebElement;
028import org.openqa.selenium.support.FindBy;
029
030/**
031 * @since 7.1
032 */
033public class WorkflowGraph extends AbstractPage {
034
035    @Required
036    @FindBy(id = "nxw_TAB_DOCUMENT_ROUTE_ELEMENTS_tab_content_graphView_box")
037    protected WebElement element;
038
039    @Required
040    @FindBy(name = "graphInitDone")
041    protected WebElement graphInitDone;
042
043    public WorkflowGraph(WebDriver driver) {
044        super(driver);
045    }
046
047    protected static final String END_NODE_CSS_CLASS = "workflow_end_node";
048
049    protected static final String START_NODE_CSS_CLASS = "workflow_start_node";
050
051    public List<WebElement> getWorkflowEndNodes() {
052        return element.findElements(By.cssSelector("." + END_NODE_CSS_CLASS));
053    }
054
055    public List<WebElement> getWorkflowStartNodes() {
056        return element.findElements(By.cssSelector("." + START_NODE_CSS_CLASS));
057    }
058
059}