<commit_before>package org.jboss.reddeer.swt.test;

import static org.junit.Assert.assertTrue;

import org.jboss.reddeer.eclipse.jdt.ui.ProjectExplorer;
import org.jboss.reddeer.swt.condition.ShellWithTextIsActive;
import org.jboss.reddeer.swt.impl.button.PushButton;
import org.jboss.reddeer.swt.impl.menu.ShellMenu;
import org.jboss.reddeer.swt.impl.shell.WorkbenchShell;
import org.jboss.reddeer.swt.impl.text.LabeledText;
import org.jboss.reddeer.swt.impl.toolbar.DefaultToolItem;
import org.jboss.reddeer.swt.impl.tree.DefaultTreeItem;
import org.jboss.reddeer.swt.test.ui.editor.EditorState;
import org.jboss.reddeer.swt.wait.WaitUntil;
import org.jboss.reddeer.swt.wait.WaitWhile;
import org.jboss.reddeer.workbench.impl.editor.DefaultEditor;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class EditorBarTest extends RedDeerTest {

	private static String projectName = "EditorBarTest-test";
	
	@Before
	public void prepare() {
		// new DefaultShell("Spring Tool Tips").close();
		new WorkbenchShell();
		new ShellMenu("File","New","Other...").select();
		new WaitUntil(new ShellWithTextIsActive("New"));
		new DefaultTreeItem("General","Project").select();
		new PushButton("Next >").click();
		new WaitUntil(new ShellWithTextIsActive("New Project"));
		new LabeledText("Project name:").setText(projectName);
		new PushButton("Finish").click();

		ProjectExplorer pe = new ProjectExplorer();
		pe.open();
		pe.selectProjects(projectName);


		new ShellMenu("File","New","File").select();
		new WaitUntil(new ShellWithTextIsActive("New File"));
		new LabeledText("File name:").setText("test.tlb");
		new PushButton("Finish").click();
		new WaitWhile(new ShellWithTextIsActive("New File"));
		new DefaultEditor("editor-with-toolbar");
	}<commit_msg>Adds waiting for closing New Project shell within EditorBarTest. Fixes #602<commit_after>package org.jboss.reddeer.swt.test;

import static org.junit.Assert.assertTrue;

import org.jboss.reddeer.eclipse.jdt.ui.ProjectExplorer;
import org.jboss.reddeer.swt.condition.JobIsRunning;
import org.jboss.reddeer.swt.condition.ShellWithTextIsActive;
import org.jboss.reddeer.swt.impl.button.PushButton;
import org.jboss.reddeer.swt.impl.menu.ShellMenu;
import org.jboss.reddeer.swt.impl.shell.WorkbenchShell;
import org.jboss.reddeer.swt.impl.text.LabeledText;
import org.jboss.reddeer.swt.impl.toolbar.DefaultToolItem;
import org.jboss.reddeer.swt.impl.tree.DefaultTreeItem;
import org.jboss.reddeer.swt.test.ui.editor.EditorState;
import org.jboss.reddeer.swt.wait.TimePeriod;
import org.jboss.reddeer.swt.wait.WaitUntil;
import org.jboss.reddeer.swt.wait.WaitWhile;
import org.jboss.reddeer.workbench.impl.editor.DefaultEditor;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class EditorBarTest extends RedDeerTest {

	private static String projectName = "EditorBarTest-test";
	
	@Before
	public void prepare() {
		// new DefaultShell("Spring Tool Tips").close();
		new WorkbenchShell();
		new ShellMenu("File","New","Other...").select();
		new WaitUntil(new ShellWithTextIsActive("New"));
		new DefaultTreeItem("General","Project").select();
		new PushButton("Next >").click();
		new WaitUntil(new ShellWithTextIsActive("New Project"));
		new LabeledText("Project name:").setText(projectName);
		new PushButton("Finish").click();
		
		new WaitWhile(new ShellWithTextIsActive("New Project"), TimePeriod.LONG);
		new WaitWhile(new JobIsRunning(), TimePeriod.LONG);
		
		ProjectExplorer pe = new ProjectExplorer();
		pe.open();
		pe.selectProjects(projectName);


		new ShellMenu("File","New","File").select();
		new WaitUntil(new ShellWithTextIsActive("New File"));
		new LabeledText("File name:").setText("test.tlb");
		new PushButton("Finish").click();
		new WaitWhile(new ShellWithTextIsActive("New File"));
		new DefaultEditor("editor-with-toolbar");
	}
{'fraction_non_alphanumeric': 0.14307851239669422, 'fraction_numerical': 0.0007747933884297521, 'mean_word_length': 5.990974729241877, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5110621', 'n_tokens_mistral': 1372, 'n_tokens_neox': 1273, 'n_words': 217}