Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Spring configuration, beans and aspects vs EventFiringWebdriver #242

Closed
TikhomirovSergey opened this issue Sep 10, 2015 · 6 comments
Milestone

Comments

@TikhomirovSergey
Copy link
Contributor

The Selenium project has an interesting solution,
EventFiringWebDriver:

Everything is cool but I think there are disadvantages for Appium users:

  • this implementation restricts the using of mobile-specific functions till
AppiumDriver d = (AppiumDriver) eventFiringWebDriver.getWrappedDriver();

The same is true for elements

MobileElement e = (MobileElement) ((WrapsElement) element).getWrappedDriver();
  • almost all interfaces which are nested in WebDriver has protected/private implementations here. So an end user has to duplicate the present code when there is need to extend it

What is supposed to be designed:

  • it is supposed that the WebDriverEventListener interface will be reused. Also it would be cool if there were interfaces whose implementations allow to listen to (optionally) events of alerts, windows, contexts and so on.
  • To design a solution which has linear architecture. It would be cool to use Spring & AspectJ here.
    http://www.mkyong.com/spring3/spring-aop-aspectj-annotation-example/
@Gpap84
Copy link
Contributor

Gpap84 commented Sep 15, 2015

Isn't it very strict to depend on Spring and AspectJ for proxifying objects for logging and other features?

@TikhomirovSergey
Copy link
Contributor Author

@GiannisPapadakis
Why not? :)

It would be good to have same AndroidDriver/IOSDriver or MobileElement with subclasses that also provide an ability to log events implicitly. Spring and AspectJ provide ability to create proxies of whole classes (not only interfaces) and implement that logging architecture in transparent and linear style.

There are probably another suitable tools...

@Gpap84
Copy link
Contributor

Gpap84 commented Sep 15, 2015

It is ok with this solution of course. There are a lot of possibilities for Spring AOP to cover. You need of course to have a bean lifecycle. I could try some examples and review together if you want.

@TikhomirovSergey
Copy link
Contributor Author

@GiannisPapadakis
So do you consider that Spring could be more widely used in java_client? You are right definitely. The logging is just the most obvious capability :)

@Gpap84
Copy link
Contributor

Gpap84 commented Sep 15, 2015

Of course it would be great to have Spring features into java_client. But careful design should be approached in order to expose ApplicationContext and referenced beans correctly.

@TikhomirovSergey
Copy link
Contributor Author

Ok. I've got and this will be kept in mind.
For now this feature is being just imagined. Also there is some dependency on few PR's to Selenium...

@TikhomirovSergey TikhomirovSergey added this to the 4.0.0 milestone Mar 7, 2016
@TikhomirovSergey TikhomirovSergey modified the milestones: 4.1.0, 4.0.0 Apr 21, 2016
@TikhomirovSergey TikhomirovSergey mentioned this issue Jul 11, 2016
3 tasks
pfoster-youitv pushed a commit to pfoster-youitv/appium-java-client that referenced this issue Jul 29, 2016
Now it is needed to add the listenable objet factory and cover it with tests
pfoster-youitv pushed a commit to pfoster-youitv/appium-java-client that referenced this issue Jul 29, 2016
pfoster-youitv pushed a commit to pfoster-youitv/appium-java-client that referenced this issue Jul 29, 2016
pfoster-youitv pushed a commit to pfoster-youitv/appium-java-client that referenced this issue Jul 29, 2016
pfoster-youitv pushed a commit to pfoster-youitv/appium-java-client that referenced this issue Jul 29, 2016
pfoster-youitv pushed a commit to pfoster-youitv/appium-java-client that referenced this issue Jul 29, 2016
pfoster-youitv pushed a commit to pfoster-youitv/appium-java-client that referenced this issue Jul 29, 2016
Also:
- improvement of the WIKI chapter
- update to org.springframework spring-context v4.3.1.RELEASE
pfoster-youitv pushed a commit to pfoster-youitv/appium-java-client that referenced this issue Jul 29, 2016
It was found during the self-review.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants