zalando / zalenium

A flexible and scalable container based Selenium Grid with video recording, live preview, basic auth & dashboard.
https://opensource.zalando.com/zalenium/
Other
2.39k stars 575 forks source link

Dashboard UI is broken when clicking the reset button #1047

Open kobenguyent opened 5 years ago

kobenguyent commented 5 years ago

🐛 Bug Report

After clicking the Reset button, the UI is broken.

Screenshot 2019-09-10 at 10 46 04

To Reproduce

  1. Navigate to http://localhost:4444/dashboard
  2. Click Reset button

Expected behavior

the UI loads perfectly.

antlong commented 5 years ago

@PeterNgTr I tried to reproduce on Chrome and it worked for me. Can you include the html of that page, so we can reproduce with your setup. Also what browser version and os version are you using?

kobenguyent commented 5 years ago

Sorry, I just did try to reproduce this today but it loads normally. I guess maybe there is something is hidden I haven't found out yet. 😆

xMutaGenx commented 5 years ago

@PeterNgTr we're still getting this, I think it was something to do with the dashboard css not being copied over correctly

kobenguyent commented 5 years ago

@xMutaGenx would be great if you could find a solid step to reproduce this. I haven't found out yet cause my laptop is a mix of many things like vpn connecting, sleeping over nights, etc.

antlong commented 5 years ago

Which browser, browser version, OS, OS version, etc.

On Wed, Sep 25, 2019 at 6:29 AM Peter Nguyen Tr notifications@github.com wrote:

@xMutaGenx https://github.com/xMutaGenx would be great if you could find a solid step to reproduce this. I haven't found out yet cause my laptop is a mix of many things like vpn connecting, sleeping over nights, etc.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zalando/zalenium/issues/1047?email_source=notifications&email_token=AAAWRNB7MY2GIEQNMZWHB6LQLM4SNA5CNFSM4IVEZLX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7RNKPY#issuecomment-534959423, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAWRNCR52BRUP5LLH5RPSLQLM4SNANCNFSM4IVEZLXQ .

kobenguyent commented 5 years ago

I'm on MacOS 10.14.6, Chrome Version 76.0.3809.132 (Official Build) (64-bit)

antlong commented 5 years ago

Built from current master?

On Wed, Sep 25, 2019 at 6:38 AM Peter Nguyen Tr notifications@github.com wrote:

I'm on MacOS 10.14.6, Chrome Version 76.0.3809.132 (Official Build) (64-bit)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zalando/zalenium/issues/1047?email_source=notifications&email_token=AAAWRNB5BG65CKMP3M6BQM3QLM5S5A5CNFSM4IVEZLX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7RN7TQ#issuecomment-534962126, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAWRNC655KDOX6JCD7FJKTQLM5S5ANCNFSM4IVEZLXQ .

kobenguyent commented 5 years ago

yeah, I used the cmd from homepage

# Pull docker-selenium
    docker pull elgalu/selenium

    # Pull Zalenium
    docker pull dosel/zalenium

    # Run it!
    docker run --rm -ti --name zalenium -p 4444:4444 \
      -v /var/run/docker.sock:/var/run/docker.sock \
      -v /tmp/videos:/home/seluser/videos \
      --privileged dosel/zalenium start
antlong commented 5 years ago

Can you save the page as complete html, and attach it here. I will take a look today.

On Wed, Sep 25, 2019 at 6:41 AM Peter Nguyen Tr notifications@github.com wrote:

yeah, I used the cmd from homepage

Pull docker-selenium

docker pull elgalu/selenium

# Pull Zalenium
docker pull dosel/zalenium

# Run it!
docker run --rm -ti --name zalenium -p 4444:4444 \
  -v /var/run/docker.sock:/var/run/docker.sock \
  -v /tmp/videos:/home/seluser/videos \
  --privileged dosel/zalenium start

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zalando/zalenium/issues/1047?email_source=notifications&email_token=AAAWRNA4GPEFWZIOGOAJ4H3QLM57JA5CNFSM4IVEZLX2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD7ROHWY#issuecomment-534963163, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAWRNGMY4P7JV6Z562LISTQLM57JANCNFSM4IVEZLXQ .

kobenguyent commented 5 years ago

oops, I just got the broken UI again. I also attached the complete html there.

what I did is:

brokenui.txt

xMutaGenx commented 5 years ago

Ours runs in aws kubernetes, seems like the css,js etc for the dashboard is being loaded from the videos folder and the dashboard reset deletes everything apart from dashboard.html there. The files do get regenerated when a new video gets added though.

Screenshot 2019-09-25 at 11 44 10 You can see the files exist in the videos folder, then when the reset happens they get deleted, and regenerate when a new video is added. Screenshot 2019-09-25 at 11 44 59

xMutaGenx commented 5 years ago

Attached the complete HTML as well. Thanks for looking into it @antlong

Dashboard.txt

kobenguyent commented 5 years ago

Hi @antlong,

I tried the combined keys CTRL+SHIFT+R and seemed that is a solid step to reproduce this issue for me.

dudziakm commented 5 years ago

I've had the same today - after a few hours of working on my tests :(

diemol commented 4 years ago

Hi all, Sadly we do not have enough time right now to work on this, a PR is much appreciated!

diemol commented 4 years ago

As mentioned in the previous comment, if someone has time to send a PR with this fix, we are happy to merge it. We are preparing the last Zalenium release, and afterwards the project will enter into a complete maintenance mode, which means that we will only reply to issues or answer questions in the chat, but no more code changes will be done.

mookkiah commented 4 years ago

Even though this project is not being developed, I see PR getting accepted for bug fixes. Appreciate that.

@diemol I would like to help fixing this bug.

Thinking of two different options

  1. During cleanup instead of deleting entire videos directory, delete only the video (mp4) files, logs directory and update test information.

    Pros:

  2. Add code to copy the css and img folder if not exists right after this line https://github.com/zalando/zalenium/blob/4b322387d0a88c6c81fec7466558df1e85fab98d/src/main/java/de/zalando/ep/zalenium/dashboard/Dashboard.java#L182 Pros:
    • Will not break any existing functionality. Cons:
    • Due to this issue not reproducible, it could look like unwanted code for some other view point.

I found that the unit test code already there to for reset functionality. That gains confidence in fixing this issue. https://github.com/zalando/zalenium/blob/4b322387d0a88c6c81fec7466558df1e85fab98d/src/test/java/de/zalando/ep/zalenium/dashboard/DashboardCleanupServletTest.java#L44

Looked at TravisCI and found below error and still test considered as pass due to the finally block https://github.com/zalando/zalenium/blob/4b322387d0a88c6c81fec7466558df1e85fab98d/src/test/java/de/zalando/ep/zalenium/dashboard/DashboardCleanupServletTest.java#L52


[INFO] Running de.zalando.ep.zalenium.dashboard.DashboardCleanupServletTest
12:09:40.074 [http://localhost:40000] INFO  d.z.ep.zalenium.dashboard.Dashboard - Resetting Dashboard
12:09:40.101 [SauceLabs addTestToDashboard seleniumSessionId [RANDOM_EXTERNAL_KEY] testCompleted [false]] ERROR d.z.e.z.util.CommonProxyUtilities - java.io.FileNotFoundException: https://saucelabs.com/rest/v1/[secure]/jobs/RANDOM_EXTERNAL_KEY
java.io.FileNotFoundException: https://saucelabs.com/rest/v1/[secure]/jobs/RANDOM_EXTERNAL_KEY
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1896)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1498)
    at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:268)
    at de.zalando.ep.zalenium.util.CommonProxyUtilities.readJSONFromUrl(CommonProxyUtilities.java:53)
    at de.zalando.ep.zalenium.proxy.SauceLabsRemoteProxy.getTestInformation(SauceLabsRemoteProxy.java:107)
    at de.zalando.ep.zalenium.proxy.SauceLabsRemoteProxy$MockitoMock$292179025.getTestInformation$accessor$8xe8qm2K(Unknown Source)
    at de.zalando.ep.zalenium.proxy.SauceLabsRemoteProxy$MockitoMock$292179025$auxiliary$2yd5yATd.call(Unknown Source)
    at org.mockito.internal.invocation.RealMethod$FromCallable$1.call(RealMethod.java:40)
    at org.mockito.internal.invocation.RealMethod$FromBehavior.invoke(RealMethod.java:62)
    at org.mockito.internal.invocation.InterceptedInvocation.callRealMethod(InterceptedInvocation.java:127)
    at org.mockito.internal.stubbing.answers.CallsRealMethods.answer(CallsRealMethods.java:43)
    at org.mockito.Answers.answer(Answers.java:100)
    at org.mockito.internal.handler.MockHandlerImpl.handle(MockHandlerImpl.java:103)
    at org.mockito.internal.handler.NullResultGuardian.handle(NullResultGuardian.java:29)
    at org.mockito.internal.handler.InvocationNotifierHandler.handle(InvocationNotifierHandler.java:35)
    at org.mockito.internal.creation.bytebuddy.MockMethodInterceptor.doIntercept(MockMethodInterceptor.java:63)
    at org.mockito.internal.creation.bytebuddy.MockMethodInterceptor.doIntercept(MockMethodInterceptor.java:49)
    at org.mockito.internal.creation.bytebuddy.MockMethodInterceptor$DispatcherDefaultingToRealMethod.interceptSuperCallable(MockMethodInterceptor.java:110)
    at de.zalando.ep.zalenium.proxy.SauceLabsRemoteProxy$MockitoMock$292179025.getTestInformation(Unknown Source)
    at de.zalando.ep.zalenium.proxy.CloudTestingRemoteProxy.lambda$0(CloudTestingRemoteProxy.java:272)
    at java.lang.Thread.run(Thread.java:748)
12:09:40.101 [SauceLabs addTestToDashboard seleniumSessionId [RANDOM_EXTERNAL_KEY] testCompleted [false]] INFO  d.z.e.z.util.CommonProxyUtilities - Trying download once again from https://saucelabs.com/rest/v1/[secure]/jobs/RANDOM_EXTERNAL_KEY
[INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.194 s - in

With this error, we cannot test the unit testing in Travis if I change the test method. Please advise how to proceed.

mookkiah commented 4 years ago

@diemol @elgalu @pearj Created PR#1201 by choosing option 2 as it will not break any functionality. Travis CI build is failing because of missing keys to run test and Codacy. Please let me know if we have instruction for me to follow to get that passed.