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

[Bug] Default template, theme switch error #383

Closed
1 task done
IceBjerg opened this issue May 2, 2022 · 6 comments
Closed
1 task done

[Bug] Default template, theme switch error #383

IceBjerg opened this issue May 2, 2022 · 6 comments
Assignees
Labels
state: triaged This issue has been triaged type: bug Something isn't working

Comments

@IceBjerg
Copy link
Contributor

IceBjerg commented May 2, 2022

Is There An Existing Issue

What Are You Seeing

When loading a report, generated by the htmlextra reporter, the default switch is always showing OFF, however the site loads correctly, with the last used theme. (tested on Chrome 101)

The error I get is the following (in console:)

Uncaught ReferenceError: $ is not defined

From this line of code:

$(document).ready( function () {
     document.getElementById('slider').checked = sliderChecked
});

What I think is happening is that the script wants to use JQuery, but is not yet loaded.

One of a solution I can think of, is to move the highlighted code after jQuery has already been loaded.

Steps To Reproduce The Issue

  1. Run Newman using the command in the terminal
  2. Host the new htmlextra report in a server
  3. Open the report in the browser
  4. Change the theme
  5. Reload the page

Full Newman Command Or Node Script

newman run postman_collection.json -r htmlextra,cli --reporter-htmlextra-export ./results/report.html

HTMLEXTRA Version

latest

Newman Version

latest docker image

Additional Context

No response

@IceBjerg IceBjerg added state: needs-triage This issue needs to be triaged type: bug Something isn't working labels May 2, 2022
@IceBjerg IceBjerg changed the title Default template, theme switch error [Bug] Default template, theme switch error May 2, 2022
@DannyDainton
Copy link
Owner

Thanks @IceBjerg

I'm 99% sure I introduced this issue recently 😢 - I'll take a look tomorrow and see what's happening.

PRs are always welcome too ❤️

@DannyDainton DannyDainton added state: triaged This issue has been triaged and removed state: needs-triage This issue needs to be triaged labels May 2, 2022
@DannyDainton DannyDainton self-assigned this May 2, 2022
@IceBjerg IceBjerg closed this as completed May 2, 2022
@IceBjerg IceBjerg reopened this May 2, 2022
@IceBjerg
Copy link
Contributor Author

IceBjerg commented May 2, 2022

I created a PR. :)

@DannyDainton
Copy link
Owner

Looks good, this could have also been fixed by adding jquery in the template above the function. :D

I've merged it now, I'll sort out the package stuff later and add your name to the readme 😄

@IceBjerg
Copy link
Contributor Author

IceBjerg commented May 3, 2022

Thanks :)
Yeah, it could have been solved with the fix you mentioned as well :)

@DannyDainton
Copy link
Owner

I've pushed out a new version and updated the project to include your name 🏆

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
state: triaged This issue has been triaged type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants