/*******************************************************************************
* Copyright (c) 2012 Google, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Google, Inc. - initial API and implementation
*******************************************************************************/
package com.windowtester.test.cases.linux;
import junit.framework.TestCase;
import com.windowtester.runtime.IUIContext;
import com.windowtester.runtime.swt.UITestCaseSWT;
import com.windowtester.runtime.swt.condition.shell.ShellDisposedCondition;
import com.windowtester.runtime.swt.condition.shell.ShellShowingCondition;
import com.windowtester.runtime.swt.locator.ButtonLocator;
import com.windowtester.runtime.swt.locator.FilteredTreeItemLocator;
import com.windowtester.runtime.swt.locator.MenuItemLocator;
import com.windowtester.runtime.swt.locator.eclipse.ViewLocator;
import com.windowtester.runtime.swt.locator.eclipse.WorkbenchLocator;
/**
*
* @author Jaime Wren
*/
public class Case41847_2Test extends UITestCaseSWT {
/* @see junit.framework.TestCase#setUp()
*/
protected void setUp() throws Exception {
super.setUp();
IUIContext ui = getUI();
ui.ensureThat(new WorkbenchLocator().hasFocus());
ui.ensureThat(ViewLocator.forName("Welcome").isClosed());
}
/**
* Main test method.
*/
public void testmytest1() throws Exception {
IUIContext ui = getUI();
//issue: console view cannot always bring to top
//ui.click(new MenuItemLocator("Window/Show View/Console"));
ui.click(new MenuItemLocator("Window/Show View/Other..."));
//issue: Show View doesn't show
ui.wait(new ShellShowingCondition("Show View"));
ui.click(new FilteredTreeItemLocator("General/Project Explorer"));
ui.click(new ButtonLocator("OK"));
ui.wait(new ShellDisposedCondition("Show View"));
}
}