package jp.sourceforge.cfneo.at4ie.api.impl.ie.invoker;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.fail;
import jp.sourceforge.cfneo.at4ie.api.ActionCommandEnum;
import jp.sourceforge.cfneo.at4ie.api.impl.DefaultTestCase;
import jp.sourceforge.cfneo.at4ie.api.impl.ie.AT4IEInternetExplorer;
import jp.sourceforge.cfneo.at4ie.api.impl.ie.DefaultContext;

import org.junit.Test;

public class SelectInvokerTest {

	static final String TEST_PAGE = "D:\\home\\eclipse-jee-europa-winter-win32\\eclipse\\workspace\\AutoTester4IE\\src\\test\\resources\\htmltest\\watijtest1.html";

	@Test
	public void test_1() {
		try {
			AT4IEInternetExplorer ie = new AT4IEInternetExplorer();
			ie.start(TEST_PAGE);
			DefaultContext context = new DefaultContext();
			DefaultTestCase testCase = new DefaultTestCase(
					context,
					ActionCommandEnum.ACTION_SELECT, "id=select1", "ccc");
			new SelectInvoker(context, ie).invoke(testCase);
			assertEquals("ccc", ie.getSelectedValueById("select1"));
			ie.close();
		} catch (Exception e) {
			e.printStackTrace();
			fail();
		}
	}

}
