Inject HTML at the end of <head> section #5
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
copy()
method by this module which replaces the copying operation of protractor-screenshoter-plugin [3].copy()
accepts an optional parameterinjectToHead
, 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 requiresdist/
exists. Instead I plan to test it in a test ofprotractor-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