Skip to content

Conversation

ikedam
Copy link

@ikedam ikedam commented Feb 23, 2020

NOTE: This request depends on azachar/screenshoter-report-analyzer#5 and don't work without that update.

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 passes options to screenshoter-report-analyzer and allow us to inject HTMLs into the <head> content.

Before this change, icons are not shown:
Screenshot_2020-02-23-Screenshot-reporter

With this change and following configuration, icons are shown:

  plugins: [
    {
      package: 'protractor-screenshoter-plugin',
      screenshotPath: './screenshoter',
      reportOptions: {
        injectToHead: '<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">'
      }
    }
  ]

Screenshot_2020-02-23-Screenshot-reporter(1)

[1] https://www.w3.org/TR/css-fonts-3/#font-fetching-requirements
[2] https://www.bootstrapcdn.com/fontawesome/

@ikedam ikedam requested a review from azachar February 23, 2020 08:36
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