/*
* ###
* PHR_widget-hw
* %%
* Copyright (C) 1999 - 2012 Photon Infotech Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* ###
*/
package com.photon.phresco.testcases;
import java.io.IOException;
import junit.framework.TestCase;
import org.junit.Test;
import com.photon.phresco.Screens.MenuScreen;
import com.photon.phresco.Screens.WelcomeScreen;
import com.photon.phresco.uiconstants.PhrescoUiConstants;
import com.photon.phresco.uiconstants.UIConstants;
public class WelcomePage extends TestCase {
private PhrescoUiConstants phrsc;
private UIConstants phr;
private WelcomeScreen wel;
private int SELENIUM_PORT;
private String browserAppends;
@Test
public void testWel() throws InterruptedException, IOException, Exception {
try {
phrsc = new PhrescoUiConstants();
phr = new UIConstants();
String serverURL = phrsc.PROTOCOL + "://"
+ phrsc.HOST + ":"
+ phrsc.PORT + "/";
browserAppends = "*" + phrsc.BROWSER;
assertNotNull("Browser name should not be null",browserAppends);
SELENIUM_PORT = Integer.parseInt(phrsc.SERVER_PORT);
assertNotNull("selenium-port number should not be null",
SELENIUM_PORT);
wel=new WelcomeScreen(phrsc.SERVER_HOST, SELENIUM_PORT,
browserAppends, serverURL, phrsc.SPEED,
phrsc.CONTEXT );
assertNotNull(wel);
MenuScreen menuObj = wel.menuScreen(phr);
assertNotNull(menuObj);
} catch (Exception t) {
t.printStackTrace();
System.out.println("ScreenCaptured");
}
}
public void setUp() throws Exception {
phrsc = new PhrescoUiConstants();
}
public void tearDown() {
clean();
}
private void clean() {
wel.closeBrowser();
}
}