
org.sitoolkit.tester.selenium.SeleniumTester Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2013 Monocrea 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 org.sitoolkit.tester.selenium;
import java.util.concurrent.TimeUnit;
import javax.annotation.PreDestroy;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebDriver;
import org.sitoolkit.tester.Tester;
import org.springframework.beans.factory.annotation.Autowired;
/**
*
* @author yuichi.kuwahara
*/
public class SeleniumTester extends Tester {
@Autowired
WebDriver seleniumDriver;
private int timeout = 30;
private Dimension windowSize = new Dimension(900, 1000);
@Override
public void setUpClass(String testScriptPath, String sheetName) {
super.setUpClass(testScriptPath, sheetName);
seleniumDriver.manage().timeouts().implicitlyWait(getTimeout(), TimeUnit.SECONDS);
seleniumDriver.manage().window().setSize(getWindowSize());
}
@PreDestroy
public void destroy() {
log.debug("WebDriverを停止します {}", seleniumDriver);
seleniumDriver.quit();
}
public int getTimeout() {
return timeout;
}
public void setTimeout(int timeout) {
this.timeout = timeout;
}
public Dimension getWindowSize() {
return windowSize;
}
public void setWindowSize(Dimension windowSize) {
this.windowSize = windowSize;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy