001/* 002 * (C) Copyright 2011 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.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 * Benoit Delbosc 016 * Antoine Taillefer 017 */ 018package org.nuxeo.functionaltests.pages; 019 020import org.nuxeo.functionaltests.pages.usermanagement.compat.UsersGroupsPage; 021import org.openqa.selenium.WebDriver; 022import org.openqa.selenium.WebElement; 023import org.openqa.selenium.support.FindBy; 024 025public class HeaderLinksSubPage extends AbstractPage { 026 027 @FindBy(linkText = "Users & Groups") 028 @Deprecated 029 WebElement userAndGroupsLink; 030 031 @FindBy(xpath = "//div[@class=\"userMenuActions\"]") 032 public WebElement userActions; 033 034 @FindBy(xpath = "//div[@class=\"userMenuActions\"]/ul/li/ul") 035 public WebElement userActionLinks; 036 037 @FindBy(xpath = "//div[@class=\"userMenuActions\"]/ul/li/ul/li/a[text()=\"Log out\"]") 038 WebElement logoutLink; 039 040 public HeaderLinksSubPage(WebDriver driver) { 041 super(driver); 042 } 043 044 public UsersGroupsPage goToUserManagementPage() { 045 userAndGroupsLink.click(); 046 return asPage(UsersGroupsPage.class); 047 } 048 049 public String getText() { 050 return userActions.getText(); 051 } 052 053 public NavigationSubPage getNavigationSubPage() { 054 return asPage(NavigationSubPage.class); 055 } 056 057}