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

Protractor Report not Showing Images in AZURE DEVOPS #6

Closed
ybc9959 opened this issue Jan 29, 2020 · 6 comments · Fixed by #7
Closed

Protractor Report not Showing Images in AZURE DEVOPS #6

ybc9959 opened this issue Jan 29, 2020 · 6 comments · Fixed by #7

Comments

@ybc9959
Copy link

ybc9959 commented Jan 29, 2020

Protractor Beautiful Reporter is working fine and I was able to see all the screenshots and index.html file in temp folder.
When I open the Index.html folder from my local, I was able to see the Report with failed screenshots and all the Logs what I expected.
Now I configured same thing in Azure Devops , Everything is Displaying well except the screenshots.
When I click on the image it was blank, checked locally and html report works fine. Attaching some screenshots.
1
2
3

@ybc9959
Copy link
Author

ybc9959 commented Jan 29, 2020

Attaching Code below.
onPrepare: function() {
// Add a screenshot reporter and store screenshots to /tmp/screenshots:
jasmine.getEnv().addReporter(new HtmlReporter({
baseDirectory: 'tmp/screenshots',
docName: 'index.html',
docTitle: 'my reporter',
takeScreenShotsOnlyForFailedSpecs: true,
excludeSkippedSpecs: true,
preserveDirectory: false,
gatherBrowserLogs: false,
sortFunction: function sortFunction(a, b) {
if (a.cachedBase === undefined) {
var aTemp = a.description.split('|').reverse();
a.cachedBase = aTemp.slice(0).slice(0, -1);
a.cachedName = aTemp.slice(0).join('');
};
if (b.cachedBase === undefined) {
var bTemp = b.description.split('|').reverse();
b.cachedBase = bTemp.slice(0).slice(0, -1);
b.cachedName = bTemp.slice(0).join('');
};

            var firstBase = a.cachedBase;
            var secondBase = b.cachedBase;

            for (var i = 0; i < firstBase.length || i < secondBase.length; i++) {

                if (firstBase[i] === undefined) { return -1; }
                if (secondBase[i] === undefined) { return 1; }
                if (firstBase[i].localeCompare(secondBase[i]) === 0) { continue; }
                return firstBase[i].localeCompare(secondBase[i]);
            }

            var firstTimestamp = a.timestamp;
            var secondTimestamp = b.timestamp;

            if (firstTimestamp < secondTimestamp) return -1;
            else return 1;
        },
        clientDefaults: {
            searchSettings: {
                allselected: false,
                passed: false,
                failed: true,
                pending: true,
                withLog: true
            },
            columnSettings: {
                displayTime: true,
                displayBrowser: true,
                displaySessionId: false,
                displayOS: true,
                inlineScreenshots: false
            },
            showTotalDurationIn: "header",
            totalDurationFormat: "hms",

        }
    }).getJasmine2Reporter());
},

1

@maciejmaciejewski
Copy link
Owner

@ybc9959
Thank you for reporting this issue

Could you please specify which version of the reporter you are using.
Also If you could run your build pipeline with variable system.debug=true to confirm that screenshot have been uploaded. You should see

Attached copy of the task execution
log.txt

@maciejmaciejewski
Copy link
Owner

maciejmaciejewski commented Jan 30, 2020

Package dependency globby stopped supporting windows slashes with the release of version 10.x.
You can read details here

sindresorhus/globby#130

Updating upload path to replace windows slashes with unix ones.

@ybc9959
Copy link
Author

ybc9959 commented Jan 30, 2020

Please find the attached Logs & Version
1 Image not loading
Reporter version with updated one
version
packagejson
Log

@maciejmaciejewski
Copy link
Owner

maciejmaciejewski commented Jan 30, 2020

@ybc9959
Bear in mind that extension task looks for combined.json file in root directory of your report and then it searches for screenshots in screenshots subdirectory.

Please try adding following line to your reporter configuration

  screenshotsSubfolder: 'screenshots',

@ybc9959
Copy link
Author

ybc9959 commented Jan 30, 2020

Yeah I see that the task is looking for Combined.json file.

  • Changed the Screenshot to Sub folder.
    I see the screenshots are pointed in combine.json file(attached for refernce). Html file Displays Screenshots well in Local, but still I see Images are not Loading in Azure
    1
    2

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

Successfully merging a pull request may close this issue.

2 participants