Jenkins: email cucumber report as 1 file - email

I am using Email-ext Jenkins plugin to send email after build is completed. I need to send cucumber report, which contain index.html file and some .js and .css files.
I am sending them like:
${FILE,path="target/cucumber/index.html"}
<script>
${FILE,path="target/cucumber/formatter.js"}
</script>
<script>
${FILE,path="target/cucumber/jquery-1.8.2.min.js"}
</script>
<script>
${FILE,path="target/cucumber/report.js"}
</script>
<style>
${FILE,path="target/cucumber/style.css"}
</style>
The result file can be processed by browser, but the outlook is not able to run it.
Can cucumber generate reports in ready .html file, or how can I fix it?

I used Selenium to build target/cucumber/index.html file, all my styles are stored in .css in Jenkins workspace, I provided links to them and everything worked.

Related

How to use Ionic 4 CSS and JS without CDN in a static website?

How to include Ionic 4's CSS and JS in a static website without using CDN url’s?
When we tried to download the JS file to local and refer it as <script type='text/javascript' src="ionic.js"></script> , the page loads “Empty” with an error in Chrome dev console. The same works if we refer it from CDN.
Downloaded the js file from https://unpkg.com/#ionic/core#4.0.0/dist/ionic.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- <script src="https://unpkg.com/#ionic/core#4.0.0/dist/ionic.js"></script> -->
<script type='text/javascript' src="ionic.js"></script>
<link rel="stylesheet" href="https://unpkg.com/#ionic/core#4.0.0/css/ionic.bundle.css">
</head>
<body>
<ion-title>Sample Title</ion-title>
</body>
</html>
Thanks ghybs
ionic.js depends on about another 135 js files under #ionic/core/dist/ionc. After including the entire #ionic/core folder in my static website project folder, the pages with ion components loaded properly.
Here's the solution to build static websites using Ionic Framework:
Folder structure should be:
projectFolder
|_core
| |_css
| | |_ionic.bundle.css
| |_dist
| |_ionic (contains all dependent js files)
| |_ionic.js
|_index.html
How to get ionic core?
Run the below command.
$ npm install #ionic/core
This will generate node_modules folder. Copy the folder from node_modules/#ionic/core to your project.
index.html
<html lang="en">
<head>
<script type='text/javascript' src="core/dist/ionic.js"></script>
<link rel="stylesheet" href="core/css/ionic.bundle.css">
</head>
<body>
<ion-title>Sample</ion-title>
</body>
GitHub repo of the above example
Maybe you could try deploying the App with or without Cordoba as Webapp? That result should ne a static website in your dist folder.
https://forum.ionicframework.com/t/how-to-deploy-for-all-three-platforms-ios-android-and-web-too/100493/2
What is different between ionic 4 and common JS libraries is that ionic 4 uses lazy loading so that your user does not load components that are not used in your app.
As a consequence, ionic 4 is split in many different JS files. While it is true you only need to reference a single entry file in your HTML, ionic 4 expects the rest of the files to be available alongside this entry file. That is why you see in your dev console an extra network request to an ionic JS asset with hash file name.
You can browse https://unpkg.com/#ionic/core#4.0.0/dist/ionic/ to get an idea of what that means (although ionic will probably load only the chunks, not the individual components).
Then the entry file will automatically try loading these extra chunks whenever it sees ionic custom web elements on the page.
Therefore what you miss is simply to make available all these extra JS files at the same location as your entry file.
As to retrieve them, you can get a zip of released assets on the GitHub release page, from jsdelivr, or from npm.

javascript library not loaded in ionic

Im including the google cast external javascript library. When I run with ionic serve it works good, but when I run the app in the phone, the library is not loaded. Debugging can see that :
https://cdn-enterprise.discourse.org/ionicframework/uploads/default/original/3X/a/d/ad4c985f45c1c538bdfbfbb02d10141b6929e1d5.png
The "http" is replaced by "file"!
I tried to include the libraries with that code:
script src="//www.gstatic.com/cv/js/sender/v1/cast_sender.js?loadCastFramework=1">
and with type="text/javascript" added; but all codes replaces http by file, and the library is not loaded.
Any suggestions?
When you run the app do not add cdn files starting with "//:", add them like "http://".
If its possible download those files and keep them in directory, after that give directory path to file.
e.g. <script type="text/javascript" src="assets/js/library.js">

jenkins html reports link : can't index the index.html file automatically

This is the URL without index.html at the end( it doesn't work)
And this is the one I manually add index.html to the end(it works)
ps:Ubuntu Server 14.04.2/Jenkins 1.641
I've got the same bugs.
Update your Jenkins and the Html Report Plugin. This will solve your problem

How to add a javascript file in GWT host HTML?

I am trying to add a .js file https://code.google.com/p/geoxml3/#Basic_Usage to my GWT project.
I have made the entry in my host HTML:
I pasted the .js file in /src/main/resources/ and added it to my build path.
I am getting Error:
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:8080/src/main/resources/geoxml3.js
I found a very complicated solution here: https://stackoverflow.com/a/1660342/768894
Can someone please help me do it in some simple steps.
Thanks
Copy this file to your /war folder. Then you can simply add this to your host page:
<script type="text/javascript" src="geoxml3.js"></script>

Including local (JS and CSS) files in local Sinatra Development

I've been trying out Sinatra on my local Windows machine. I want to include some local CSS and JS files. This is how the code looks in layout.erb
<script src="jquery.js" type="text/javascript">
</script>
<link rel="stylesheet" href="reset.css" type="text/css" />
All my files are in the same folder as app.rb
This is my app.rb
require 'rubygems'
require 'sinatra'
get '/' do
erb :index
end
For some reason, I cant see these files included in my pages. When I view the source code and click on the file(JS/CSS) I see that - "Sinatra doesn't know this ditty"- error.
What am I doing wrong here?
Move your static files(css/js) into a folder named public. Sinatra looks there with default settings.
If you want to change that behaviour have a look at this: Static Files
By default Sinatra will look for static files in your public folder. You just need to make a folder called public in the same directory as your Ruby file, and place your JS and CSS files there.