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

chrome and %5С #27

Closed
kelebro13 opened this issue Dec 5, 2017 · 11 comments · Fixed by #316
Closed

chrome and %5С #27

kelebro13 opened this issue Dec 5, 2017 · 11 comments · Fixed by #316
Labels

Comments

@kelebro13
Copy link

Добрый день! Не отображаются скриншоты в отчёте в браузере chrome: в url обратный слеш заменяется на %5C.
html-report

p.s.: корректно работает только в firefox.

@DudaGod
Copy link
Member

DudaGod commented Dec 5, 2017

Привет.

Подскажи пожалуйста, какая у тебя версия html-reporter-а?
Мы вчера катили версию, возможно в ней бага. Сегодня проверим.

Как временное решение - откатись на предыдущую версию.
Спасибо за информацию.

@kelebro13
Copy link
Author

версия 1.0.0

@tylertrotter
Copy link

I believe I have the same problem. I think it is caused by windows using backslashes. I wonder if you just encode the image path that would fix it.

@Hrommi
Copy link

Hrommi commented Mar 6, 2018

html-reporter@2.5.0 проблема с путями в chrome по прежнему актуальна. Как можно решить?

@jayveeMaui
Copy link

Any update on this issue?

@jayveeMaui
Copy link

Instead of returning just pathToImage at createpath() on lib/server-utils.js I did pathtoImage.replace(/\/g,''). Is it a good Idea? seems like the path module is causing the backslash.

@Astimus
Copy link

Astimus commented Nov 15, 2018

I found workaround for this issue. I have set path property to empty string:

plugins: {
            'html-reporter/gemini': {
                enabled: true,
                path: '',
                defaultView: 'all',
                baseHost: 'test.com'
            }
        }

@SokolovAlex
Copy link

it problem in logic in server-utils
https://github.com/gemini-testing/html-reporter/blob/master/lib/server-utils.js#L42

when author uses lib "path", lib generate path depends of OS. it`s necessery for server usage, but it's wrong for client usage. Paths generated on window don't work on client

the generated path uses on clinet in background.

for client path you math replace path.join
to

components.reduce((createdPath, component) =>
createdPath ? ${createdPath}/${component.replace('\', '/')} : component, '');

@hughtroeger
Copy link

I am also experiencing this issue using html-reporter 4.6.0 on Windows 7. The problem seems to be that Windows paths use \ separators while html-reporter assumes POSIX / separators. This line in particular splits on / when generating the background-image urls for the report. So \s are URI encoded as %5C, which results in invalid urls, preventing the images from being displayed.

hughtroeger added a commit to hughtroeger/html-reporter that referenced this issue May 2, 2019
Allow correct urls to be generated for images in the report on windows.

Fixes gemini-testing#27
@wrager
Copy link

wrager commented Jul 10, 2019

Any updates on this issue? 🤔

FF also can't render images on Windows. Which browser should we use to avoid this 1.5 year old bug?

image

@wrager
Copy link

wrager commented Jul 10, 2019

I've made a rough tampermonkey script for showing the screenshots, hope this helps.

(function() {
    'use strict';

    function fix() {
        setTimeout(function() {
            const screenshots = document.querySelectorAll('.image-box__screenshot');
            for (let screenshot of screenshots) {
                screenshot.style.backgroundImage = screenshot.style.backgroundImage.replace(/%5C/, '/');
            }
        }, 100);
    }
    document.onscroll = document.onclick = fix;
    fix();
})();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
10 participants