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

Inject HTML at the end of <head> section #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ikedam
Copy link

@ikedam ikedam commented Feb 12, 2020

protractor-screenshoter-plugin is really useful for angular developments.
Our CI server generates test reports with that plugin and they’re shared among our development teams.

But unfortunately web font icons aren’t displayed on those reports as those reports are placed in the authenticated area and web fonts are always accessed with “anonymous” mode [1] and blocked in this case.

I want to inject a <link> tag into the report, which imports css and web fonts from CDN, like ones provided by bootstrap [2] .

This request proposes following changes:

  • Provide copy() method by this module which replaces the copying operation of protractor-screenshoter-plugin [3].
  • copy() accepts an optional parameter injectToHead, which will be put just before the </head> tag. I intend to pass <link href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"> here.

I don’t add test codes here as unfortunately it looks difficult to test the behavior in this source tree as the copy feature requires dist/ exists. Instead I plan to test it in a test of protractor-screenshoter-plugin in a pull request where I will integrate this feature.

[1] https://www.w3.org/TR/css-fonts-3/#font-fetching-requirements
[2] https://www.bootstrapcdn.com/fontawesome/
[3] https://github.com/azachar/protractor-screenshoter-plugin/blob/v0.10.3/index.js#L418

Provide a method `setup` to install files and inject HTML at the end of <head> section
@ikedam
Copy link
Author

ikedam commented Feb 23, 2020

Updated the commit

  • Use git-cz to compose the commit message
  • Run npm install --save --prod [email protected] with nodejs-8.2.0.

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 this pull request may close these issues.

1 participant