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

External CSS and JS dependencies blocked in stricter CI environments #60

Closed
filfreire opened this issue Aug 14, 2018 · 3 comments
Closed
Assignees

Comments

@filfreire
Copy link

Environment:

  • Node.js version: 8.9.3
  • NPM version: 5.5.1
  • webdriver.io version: 4.13.1
  • wdio-cucumber-framework version: 1.1.0 (I believe this bug is independent of cucumber framework)
  • wdio-multiple-cucumber-html-reporter version: 0.1.3

Config of webdriver.io and the reporter

reporters: ["dot", "junit", "multiple-cucumber-html"],
    
reporterOptions: {
    outputDir: "./reports",
    junit: {
        outputDir: "./reports/"    
    },
    htmlReporter: {
        jsonFolder: "./reports/",
        reportFolder: "./reports/"
    }
},

Description
The external CSS/JS dependencies of the resulting index.html file are not compatible with a stricter CI environment when loading up the report inside that environment.

Depending on your CI configuration and the security levels of your CI environment you might set up the HTTP Content-Security-Policy response header to self, which in turn refers to the origin from which the protected document (in our case the html test report) is being served, and prevents other sources from being loaded.

I'm not sure about the expected behaviour in this case, but it impacts anyone trying to use the plugin in a more closed CI environment. My suggestions for a possible fix would be:

  • to include these libraries somehow as part of the reporter, which doesn't seem to be a positive fix;
  • allow the user to somehow point at them in a different way via configuration;
  • or allow the user to define a custom html template?

Snapshots
screen shot 2018-08-14 at 11 26 35

/cc @wswebcreation

@wswebcreation
Copy link
Collaborator

Tnx for filling this issue.

I'll create a PR for it when I get back and package the dependencies to it so secure CI environments don't have problems with this.

@wswebcreation
Copy link
Collaborator

Hi @filfreire

I've made a new release of the module, version 1.11.1 which now contains all assets. This should work. I'll try to create a new release of the wdio-plugin asap.
I'm going to close this issue now and keep you posted when the new version of the wdio-module is released

@filfreire
Copy link
Author

@wswebcreation thank you 👍 !

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

No branches or pull requests

2 participants