|
50 | 50 | import org.slf4j.LoggerFactory; |
51 | 51 | import org.springframework.beans.BeanUtils; |
52 | 52 | import org.springframework.beans.factory.NoSuchBeanDefinitionException; |
| 53 | +import org.springframework.cglib.proxy.Enhancer; |
53 | 54 | import org.springframework.context.ApplicationContext; |
54 | 55 | import org.springframework.context.annotation.AnnotationConfigApplicationContext; |
55 | 56 | import org.springframework.context.support.AbstractApplicationContext; |
|
87 | 88 | import com.surenpi.autotest.webui.ui.AbstractElement; |
88 | 89 | import com.surenpi.autotest.webui.ui.Text; |
89 | 90 |
|
| 91 | +import net.sf.cglib.proxy.Proxy; |
90 | 92 | import net.sf.json.util.JSONUtils; |
91 | 93 |
|
92 | 94 | /** |
@@ -227,11 +229,11 @@ private void annotationScan() |
227 | 229 |
|
228 | 230 | Page pageBean = (Page) bean; |
229 | 231 | 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 | + |
235 | 237 | String clsName = beanCls.getName(); |
236 | 238 | pageMap.put(clsName, (Page) bean); |
237 | 239 |
|
@@ -440,6 +442,20 @@ public void read(InputStream inputStream) throws DocumentException, IOException, |
440 | 442 |
|
441 | 443 | parse(document); |
442 | 444 | } |
| 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 | + } |
443 | 459 |
|
444 | 460 | /** |
445 | 461 | * 从数据源中加载第一组数据,设置到所有page类中 |
|
0 commit comments