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

Log event listener improvements #927

Merged
merged 5 commits into from May 5, 2019

Conversation

Projects
None yet
3 participants
@pavelpp
Copy link
Contributor

commented Apr 4, 2019

Proposed changes

Currently SelenideLogger only logs stuff after each event happened, so in order to apply some logic before some action happens we have to resort to implementing custom WebDriverEventListener, which does not support all the methods that we might be interested in.

Example: I want to log click() methods before click happened. Currently I can not do it, as onEvent logs after event happened.

Added beforeEvent() method to LogEventListener and renamed onEvent to afterEvent to make it clear and consistent. beforeEvent() will be called in SelenideLogger.beginStep(...) method, which is used in SelenideElementProxy.invoke(...) method before dispatchAndRetry(), which will ensure the event is logged before action.

Checklist

  • Checkstyle and unit tests pass locally with my changes by running gradle check chrome htmlunit command
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)

Pavel Ponomarjov added some commits Apr 4, 2019

Pavel Ponomarjov
@rosolko

rosolko approved these changes May 3, 2019

@rosolko
Copy link
Collaborator

left a comment

Checkstyle rule violations were found:
[ant:checkstyle] [ERROR] /home/travis/build/selenide/selenide/src/test/java/integration/LogEventListenerTest.java:27:15: '{' is not preceded with whitespace. [WhitespaceAround]

Pavel Ponomarjov

@rosolko rosolko self-requested a review May 5, 2019

@rosolko

rosolko approved these changes May 5, 2019

@rosolko rosolko merged commit 2b8c952 into selenide:master May 5, 2019

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details

@asolntsev asolntsev added this to the 5.2.3 milestone May 11, 2019

@asolntsev asolntsev self-assigned this May 11, 2019

@asolntsev asolntsev added the feature label May 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.