Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Commit 55918b7

Browse files
committed
增加对代理类的判断
1 parent 7c6fc55 commit 55918b7

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

src/main/java/org/suren/autotest/web/framework/selenium/WebPage.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,5 +96,4 @@ public String getTitle()
9696
{
9797
return engine.getDriver().getTitle();
9898
}
99-
10099
}

src/main/java/org/suren/autotest/web/framework/settings/Phoenix.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.slf4j.LoggerFactory;
5151
import org.springframework.beans.BeanUtils;
5252
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
53+
import org.springframework.cglib.proxy.Enhancer;
5354
import org.springframework.context.ApplicationContext;
5455
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
5556
import org.springframework.context.support.AbstractApplicationContext;
@@ -87,6 +88,7 @@
8788
import com.surenpi.autotest.webui.ui.AbstractElement;
8889
import com.surenpi.autotest.webui.ui.Text;
8990

91+
import net.sf.cglib.proxy.Proxy;
9092
import net.sf.json.util.JSONUtils;
9193

9294
/**
@@ -227,11 +229,11 @@ private void annotationScan()
227229

228230
Page pageBean = (Page) bean;
229231
Class<?> beanCls = bean.getClass();
230-
// if(!beanCls.getSuperclass().equals(Page.class))
231-
// {
232-
// beanCls = beanCls.getSuperclass();
233-
// }
234-
232+
if(Enhancer.isEnhanced(beanCls))
233+
{
234+
beanCls = beanCls.getSuperclass();
235+
}
236+
235237
String clsName = beanCls.getName();
236238
pageMap.put(clsName, (Page) bean);
237239

@@ -440,6 +442,20 @@ public void read(InputStream inputStream) throws DocumentException, IOException,
440442

441443
parse(document);
442444
}
445+
446+
public SeleniumEngine init()
447+
{
448+
SeleniumEngine engine = getEngine();
449+
engine.init();
450+
451+
return engine;
452+
}
453+
454+
public void initWithData()
455+
{
456+
init();
457+
initData();
458+
}
443459

444460
/**
445461
* 从数据源中加载第一组数据,设置到所有page类中

0 commit comments

Comments
 (0)