Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd image galler/slider for screenshots etc #112
Conversation
|
This is a great start, thanks @BeyondEvil! Whilst testing this, I found that if I had multiple failures in my report, only the last occurrence of an image worked - perhaps because all inputs belong to the same group? It would be nice if the prev/next buttons were circular, in that clicking next on the last image would display the first image. When next/prev are not required (if there's only one image) they should be hidden, and not add extra padding to the images. Could we add the image name as an alt attribute for the image? A caption might be nice, but this will at least help when users need to link the images to the names. |
| html.a(html.img(src=src), href=href), | ||
| class_='image')) | ||
| self.images_html.append(html.a(html.img( | ||
| src=src), href=href, target='_blank')) |
This comment has been minimized.
This comment has been minimized.
davehunt
May 15, 2017
Collaborator
In the case that the src is a base64 encoded string, we're duplicating it for the href. This will cause considerable increase in the file size if there's more than a few screenshots. This is actually related to #110, where I suggest resolving this using JavaScript.
This comment has been minimized.
This comment has been minimized.
|
I do not understand how the remote version of this branch can have the "name" PR. I really don't. Because I haven't pushed it. And if it has it, why then do I need to push it again for it to not complain when I'm trying to push real changes. It. Does. Not. Make. Sense. To avoid this crap, do I push with |
|
Ping @davehunt |
|
I just pulled down the changes and tested them locally. I'm still seeing issues where the first result with multiple images works as expected, but later results with multiple images affect the images displayed in the first result. I also noticed that the page jumps around when clicking the buttons, and the URL changes after a click. I think we should prevent this. Also, style wise, I'd like to see the next/previous buttons at the bottom of the image, almost like a toolbar. I mocked up an example here: What do you think? |
|
Also, I just wanted to note that I haven't reviewed the code as I think we should get the style and functionality working first. |
|
That's so weird as I specifically tested that scenario. I also mixed failures with 1 image, with failures with multiple images, and passes. And I couldn't see any issues. Maybe you can screenshot and/or be more specific to what issues you're seeing? I will look at the jumping around issue (didn't notice that myself). The URL changing is unfortunately something we have to live with unless we want to involve JS. At least to my knowledge (and the frontenders where I work). I'll see how close to your mock I can get. :) |
|
Ping @davehunt I'm finally back to normalcy. Well, somewhat. Please have a look at my previous comments. I'm going to spend some time on this now, but need to get my head back in the game. :) |
|
@BeyondEvil are there any particular comments you'd like me to review? |
PhilippSelenium
commented
Jan 7, 2019
|
Is there any update on this merge request? I would really like to have the ability to click the thumbnail instead of right click --> open image location. |
|
@PhilippSelenium Agreed, that should be an easy fix. I might do a separate PR just to fix that, unless you're willing to do it? |
|
Hi @RibeiroAna ! Would you mind talking a look at this PR? I have to admit it's a bit over my head. :( The way a report looks today with multiple screenshots is no good. The stacktrace section is all squished together. https://dporganizer-test-results.s3.amazonaws.com/e2e/2019-01-22_16-56-31_e2e_test_report_24396.html |
|
I'm taking a look @BeyondEvil |
| html.a('>', class_='button next', | ||
| href='#{}'.format(self.images[next_image][0]))) | ||
| image_html.append( | ||
| html.div(carousel_html, id='{}'.format(src))) |
This comment has been minimized.
This comment has been minimized.
RibeiroAna
Jan 23, 2019
Member
Id must be unique for every image!! That is because the caroussel is not working when there are multiple test's cases.
| html.div(carousel_html, id='{}'.format(src))) | |
| html.div(carousel_html, id='{}'.format(src + self.test_id))) |
|
@BeyondEvil I think I figured out the problem: when there are multiple test cases, the id for the multiple generated I reinforce Dave's request to style as he mocked because in the way you styled, depending on the image, the "next" and "previous" links are basically invisible, when I tested with some local images with gray background, I couldn't see them. Last but not least, I think it would be nice to have a test case of this new functionality with the rerun plugin. |
| next_image = (image + 1) % num_of_images | ||
| carousel_html.append( | ||
| html.a('>', class_='button next', | ||
| href='#{}'.format(self.images[next_image][0]))) |
This comment has been minimized.
This comment has been minimized.
RibeiroAna
Jan 23, 2019
Member
| href='#{}'.format(self.images[next_image][0]))) | |
| href='#{}'.format(self.images[next_image][0] + self.test_id))) |
| prev_image = (image - 1) % num_of_images | ||
| carousel_html.append( | ||
| html.a('<', class_='button prev', | ||
| href='#{}'.format(self.images[prev_image][0]))) |
This comment has been minimized.
This comment has been minimized.
RibeiroAna
Jan 23, 2019
Member
| href='#{}'.format(self.images[prev_image][0]))) | |
| href='#{}'.format(self.images[prev_image][0] + self.test_id))) |
|
|
||
| test_index = hasattr(report, 'rerun') and report.rerun + 1 or 0 | ||
|
|
||
| for extra_index, extra in enumerate(getattr(report, 'extra', [])): | ||
| self.append_extra_html(extra, extra_index, test_index) | ||
|
|
||
| num_of_images = len(self.images) | ||
| if num_of_images == 1: # Only one image, no need for carousel |
This comment has been minimized.
This comment has been minimized.
PhilippSelenium
Jan 23, 2019
Have you considered generalizing it using one for loop instead of the if elif else stuff.
|
|
||
| elif num_of_images > 1: # More than one image, build carousel | ||
| image_html = [] | ||
| for image in range(num_of_images): |
This comment has been minimized.
This comment has been minimized.
PhilippSelenium
Jan 23, 2019
for i in range(iterable):
iterable[i]
Doesn't look very pythonic
Have a look here: https://stackoverflow.com/questions/1011938/python-previous-and-next-values-inside-a-loop
|
Thank you so much for your input @PhilippSelenium and @RibeiroAna ! Much appreciated! If your fingers are itching, I'm more than happy to relinquish this PR to your capable hands. If not, I should be able to work some on it next month. |
|
@BeyondEvil I'm not interested on finishing it. If depends on me, you can go on. |
|
@BeyondEvil Can you fix conflicts or close it if no longer needed? Thanks. |
BeyondEvil commentedMay 10, 2017
I would suggest merging this PR #111 first. Since this PR really hits the same code.
Hopefully this will get the discussion started @davehunt :)