How to send Allure Reports in Email using Jenkins server - allure

I have created a Automation using Rest Assured, TestNg, Gradle and Allure reports. Now i am able to generate Allure reports , But i am looking something where i can send Allure reports in Email. Whether this is any plugin is available or any latest deployment is going on

First you need to install Email Extension plugin in your Jenkins. You can also use the default Jenkins mail but I prefer the Email Extension plugin since it's more configurable.
Second you need smtp server to send email from Jenkins. If you have one then cool otherwise create one. (If you are using gmail then your smtp server is smtp.gmail.com by default)
Third is you need to configure Jenkins. Open your Jenkins Dashboard > Manage Jenkins > Configure Systems. Then scroll down to Email Extension. If you have decided to use the default Email the scroll down to Email and enter the details and save.
Fourth you need to add the following code to your existing pipeline.
stage('Email Report') {
// Change the recipent address
sh "zip -r allure-report.zip allure-report"
def mailRecipients = "therecipient#mail.com"
env.ForEmailPlugin = env.WORKSPACE
if(fileExists('allure-report.zip')){
emailext(
to: "${mailRecipients}",
from: "sender#mail.com",
subject: "Allure Report",
body: "PFA",
attachmentsPattern: 'allure-report.zip'
)
} else{
echo("COULD NOT FIND FILE TO ATTACH")
}
}
Fifth the recipient need to download the zip attachment and execute allure serve to see the reports and dashboards.
It's worth noting that the best way to serve allure report is to upload in some common place for example in jira, confluence etc.

Related

Use path/slug after Web App's base url in Google Apps Script

I'm looking to make the url by adding a path which is something like this below in Google Apps Script:
https://script.google.com/macros/s/APP_ID/exec/fileName.txt
How can I achieve this for Web App service?
I believe your goal as follows.
You want to access to Web Apps using the URL of https://script.google.com/macros/s/APP_ID/exec/fileName.txt.
For this, how about this answer? I think that you can achieve your goal using Web Apps. As a sample case, I would like to explain about this using a sample script for downloading a text file, when an user accesses to https://script.google.com/macros/s/APP_ID/exec/fileName.txt.
Usage:
Please do the following flow.
1. Create new project of Google Apps Script.
Sample script of Web Apps is a Google Apps Script. So please create a project of Google Apps Script.
If you want to directly create it, please access to https://script.new/. In this case, if you are not logged in Google, the log in screen is opened. So please log in to Google. By this, the script editor of Google Apps Script is opened.
2. Prepare script.
Please copy and paste the following script (Google Apps Script) to the script editor. This script is for the Web Apps.
function doGet(e) {
const path = e.pathInfo;
if (path == "filename.txt") {
const sampleTextData = "sample";
return ContentService.createTextOutput(sampleTextData).downloadAsFile(path);
}
return ContentService.createTextOutput("Wrong path.");
}
In order to retrieve the value of fileName.txt in https://script.google.com/macros/s/APP_ID/exec/fileName.txt, please use pathInfo.
For example, when you check e of doGet(e) by accessing with https://script.google.com/macros/s/APP_ID/exec/fileName.txt, you can retrieve {"contextPath":"","contentLength":-1,"parameter":{},"parameters":{},"queryString":"","pathInfo":"fileName.txt"}.
In this case, the GET method is used.
3. Deploy Web Apps.
On the script editor, Open a dialog box by "Publish" -> "Deploy as web app".
Select "Me" for "Execute the app as:".
By this, the script is run as the owner.
Select "Anyone, even anonymous" for "Who has access to the app:".
In this case, no access token is required to be request. I think that I recommend this setting for your goal.
Of course, you can also use the access token. At that time, please set this to "Anyone". And please include the scope of https://www.googleapis.com/auth/drive.readonly and https://www.googleapis.com/auth/drive to the access token. These scopes are required to access to Web Apps.
Click "Deploy" button as new "Project version".
Automatically open a dialog box of "Authorization required".
Click "Review Permissions".
Select own account.
Click "Advanced" at "This app isn't verified".
Click "Go to ### project name ###(unsafe)"
Click "Allow" button.
Click "OK".
Copy the URL of Web Apps. It's like https://script.google.com/macros/s/###/exec.
When you modified the Google Apps Script, please redeploy as new version. By this, the modified script is reflected to Web Apps. Please be careful this.
4. Run the function using Web Apps.
Please access to https://script.google.com/macros/s/###/exec/filename.txt using your browser. By this, a text file is downloaded.
Note:
When you modified the script of Web Apps, please redeploy the Web Apps as new version. By this, the latest script is reflected to the Web Apps. Please be careful this.
References:
Web Apps
Taking advantage of Web Apps with Google Apps Script
Updated on February 14, 2023
In the current stage, it seems that pathInfo can be used with the access token. It supposes that the following sample script is used.
function doGet(e) {
return ContentService.createTextOutput(JSON.stringify(e));
}
When you log in to your Google account and you access https://script.google.com/macros/s/###/exec/sample.txt with your browser, {"contextPath":"","parameter":{},"pathInfo":"sample.txt","contentLength":-1,"parameters":{},"queryString":""} can be seen.
In this case, when you access it without logging in Google account, even when Web Apps is deployed as Execute as: Me and Who has access to the app: Anyone, the log in screen is opened. Please be careful about this.
And, if you want to access with https://script.google.com/macros/s/###/exec/sample.txt using a script, please request it by including the access token. The sample curl command is as follows. In this case, the access token can be used as the query parameter. Please include one of the scopes of Drive API in the access token.
curl -L "https://script.google.com/macros/s/###/exec/sample.txt?access_token=###"
By this, the following result is returned.
{"contextPath":"","queryString":"access_token=###"},"pathInfo":"sample.txt","parameters":{"access_token":["###"]},"contentLength":-1}

Getting Error while adding File System ISE Logic App Connector

I have created an ISE Logic Apps environment, and am trying to add the FileSystem ISE connector to the Managed connectors list, as it does not appear in my default list. When I click on '+Add', I can see the File System connector in the drop down that comes up, but when I select it & click on 'Create', I get the following error:
Failed to create connector 'isefilesystem'
Operation name
Set Integration Service Environment managed API
Time stamp
Mon Jan 13 2020 16:53:24 GMT+0000 (GMT Standard Time)
Event initiated by
xxxxxxxxx#xxxx.xxx
Error code
IntergrationServiceEnvironmentManagedApiDefinitionTagsNotSupported
Message
The tags are not supported in the managed API 'isefilesystem'.
The ISE File System connector is available. The ISE File System connector will not be automatically added to the ISE, you will need to manually add it yourself. Our engineers are working on getting that automatically added with new ISE deployments.
Here are steps from the document to add it manually to the ISE :
On your ISE menu, under Settings, select Managed connectors. On the toolbar, select Add.
On the Add a new managed connector pane, open the Find connector list. Select the ISE connector that you want to use but isn't yet deployed in your ISE. Select Create.
Only ISE connectors that are eligible but not yet deployed to your ISE appear available for you to select. Connectors that are already deployed in your ISE appear unavailable for selection.
Checkout this GitHub issue as well for details.
File system connectors is not yet available in ISE. You can use the shared connector (With gateway) in a Logic app in ISE till it is available.
It is on-premises data gateway. Yes there is already a work items for this and it is in progress and will be there in near future but this timeline is subject to change. As far as new features go, we are not able to disclose much at this time.
Also you could vote up this feedback to promote this feature to be achieved quickly.
I am having problems with the ISE Create File (Preview).
I have an API Connection defined with the Root Folder setting using dot notation, e.g. 192.168.1.23, because there is a DNS issue with hybrid cloud-on-prem lookup, or so I am told.
The Logic App portal editor in Designer mode behaves strangely when configuring the folder path in the Create File action. When using the pop-out folder picker I see "The use name or password is incorrect".
I have made sure that the credentials are correct and have tested successfully via other means.
Is there a work around?
Is this a known issue?

how to send the emailable-report to specific recipient in TestNg framework

After executing the test suit through Testng framework, I don't have any idea on how to send the report through email. How to use emailable-report.html to be send a specific recipient?
you need to use testngxslt plugin and integrate ANT when generated a build.xml file BY using
javax mailjar and javax activation jar trying to send report as zip file.
Write a java class to send email using javax and then set it as a final task in your build.xml.( if you are using ant to build and run you can use this, it works fine for us)

Is there an Admin Console for JAMES 3?

I am using Java Apache Mail Enterprise Server 3. Each time I need a new user, I have to run a batch file and enter the command adduser username password. Is there any admin console for James3 like the one found for James 2.3.2 ?
We have a Google Summer of Code Student working on Apache James Bond - a web administration tool for James. It's work in progress but it might be useful - haven't tried it out yet.
In order to test it, you have to deploy the war in the server where you have running james, so as it has access to the configuration files, and it can connect to the jmx service in port 9999
Build the war and to run the war just type:
java -Djames.conf=/opt/apache-james-3.0-beta4/conf \
-Dip.range=192.168.1.* -jar bond-1.0-SNAPSHOT.war
Note that you have to indicate where your conf files are, and the authorized ip address/addresses from where you are going to run the browser.
Make a COPY of your configuration files !, because bond removes all comments when saving them.
http://code.google.com/a/apache-extras.org/p/bond/
Good luck,

Connect online quickbook to my php website

I am in need of generating invoices on my online quickbook account automatically through my php website.
i searched a lot over intuit and other sources but dont know where to start or what to do.
please help me..
Thanks
For non-SaaS QuickBooks integration with QuickBooks Online, you want to use qbXML.
To do this, you first need to register with Intuit. It's easiest to register in DESKTOP mode. There are instructions to do this on our QuickBooks PHP wiki. Register as a PRODUCTION application (you can only use DEV/PTC if you get a special account from Intuit, which you won't be able to get).
Once you've registered, you'll have a connection ticket, an app id, and a app login.
Then, you can grab our open source PHP QuickBooks DevKit (use a recent nightly build) and open this example:
docs/example_online_edition.php
From there, you plug in your app id, app login, and connection ticket, and you'll be able to send XML formatted requests to QuickBooks.
You'll want to use Intuits QuickBooks OSR for XML reference. Make sure to check "OE", uncheck "US", change the qbXML version to 6.0 (QuickBooks Online only supports 6.0), use the "Select Message" drop-down to choose the request type, and the "XML Ops" tab to see the available XML fields.
Your resulting code will look something like:
require_once dirname(__FILE__) . '/../QuickBooks.php';
// Register in DESKTOP mode to get these. Docs:
// http://www.consolibyte.com/docs/index.php/QuickBooks_Online_via_qbXML#Connecting_with_the_.27Desktop.27_model_of_communication
$application_id = '134476443';
$application_login = 'qboe.www.consolibyte.com';
$connection_ticket = 'TGT-68-1sRm2nXMVfm$n8hb2MZfVQ';
// Create our new gateway instance
$Gateway = new QuickBooks_Gateway_OnlineEdition(
$application_id,
$application_login,
$connection_ticket);
$xml = '<QBXMLMsgsRq onError="stopOnError">
<VendorAddRq>
<VendorAdd>
<Name>ConsoliBYTE</Name>
<FirstName>Keith</FirstName>
<LastName>Palmer</LastName>
<VendorAddress>
<Addr1>123 Test Road</Addr1>
<City>Mt Pleasant</City>
<State>MI</State>
<PostalCode>48858</PostalCode>
</VendorAddress>
<Email>support#consolibyte.com</Email>
</VendorAdd>
</VendorAddRq>
</QBXMLMsgsRq>';
// Send the request
$resp = $Gateway->qbxml($xml);
print($resp);

Resources