How I can get link to specific test launch in ReportPortal? - reportportal

I want link to last execution to be in letter sent by Jenkins after tests execution. How I can get this link?

There is some plugin for Jenkins which does exactly what you ask for.
https://github.com/reportportal/plugin-jenkins
It's a quite outdated, but you are free to submit issue

Related

Puppeteer - Authorize device (2FA)

Is there a way to authorize Puppeteer for 2FA authentication?
Scenario:
Run Puppeteer and visit a 2FA protected URL
Enter credentials and wait for redirection
Request one-time passcode
Enter the passcode
Wait for redirection
Close the Puppeteer instance
Run Puppeteer and visit a 2FA protected URL
The protected page should be loaded not asking for the passcode anymore
This scenario doesn't work in my case :(
Any other library that can go successfully through this scenario?
There are two possible scenarios to handle 2FA using puppeteer, depending on the nature of the situation (it's not entirely clear from the way you phrase the question).
Replicating session data (in this scenario, you can't have someone provide you the code the second time, you need to bypass it in the future altogether):
I'm going to assume the site you are dealing with is performing some sort of analysis on the browser to determine whether to prompt for a 2FA code or not. In my experience, sometimes there is a random element to this that you can't control, but replicating the exact browser state (user data, cookies, everything) is a start. Pair that with a consistent IP address that has answered correctly previously, and I think chances are very very good.
See my code here, or if that is too heavy, here is a simple implementation of the functions I'm using to save the session data: simple code. In short, I'm converting the session data, cookies- everything that distinguishes that instance of chromium and stuffing it into a base64 string, then later I simply load that data and assume the exact state the browser had previously. I'm pretty sure this is what you want.
Interactive Bot
I'm unsure if this applies to your use-case, but I faced a situation where I needed to pull 2FA codes from a user's phone/email in real-time while the puppeteer was in the middle of performing a login process. The browser could not re-launch because the 2FA code would no longer be valid. It's not a trivial problem. I ended up using Redis and built a framework puppeteer-theater that addressed this use-case among pretty much every scraping/automation workflow I have encountered.
Feel free to reach out if you are looking for specific help.

Can chrome be used, from the command-line, to retrieve a URL's content to a file?

I've been driving myself mad trying to get curl, wget, the python request module, and others, to simply get me logged in to a website and pull page text there. I can certainly request HTML from the site, but only as an anonymous user. I've spent a few hours with tricks like chrome's "copy cURL" feature, but the website in question is smart enough to defend against login playbacks.
All I want is a way, from the command-line, to do something like:
chrome.exe --output_to_file page.html https://www.endpoint.com/auth_access_only.html
Essentially, I'm looking for chrome to do for me what cURL does, but I want the command-line invocation to be executed as me. I can see how this might open a potential security issue, but I don't mind at all if I have to do something magical to authorize my script. I'm not looking to do anything evil - I just want to be able to write scripts that are as "me" as I am.
I guess that, if it's truly unavoidable, I could suck it up and dust off Internet Explorer. I'd really rather not do that. I'd feel so dirty.
This is possible, but it's not as simple as you're thinking.
You can use the Chrome Debugging Protocol to remote-control Chrome.
You will need to write some code to make this work - I have done similar tasks using the chrome-remote-interface library for Node.js.
Make sure you understand what a browser profile is and where your profile folder lives.
If Chrome is already running using your browser profile: make sure it was launched with --remote-debugging-port=9002 or similar.
If Chrome is not already running using your browser profile: launch it with --user-data-dir="C:\path\to\your\profile" --remote-debugging-port=9002 or similar.
The "running or not" part is a bit tricky - you cannot launch more than one Chrome instance with the same browser profile, but you need to use this user profile because your login data is stored there. It may actually be easiest to create a separate browser profile that is just used for this automated task, and log in to the site there too.
Then, at a high level, your Node.js code will need to connect to Chrome, load the page, wait for the response, and save it to a file. Have a look at the example code for the chrome-remote-interface library - you can definitely piece together what you need from there.
Another option which uses the same underlying technology is to use puppeteer which is another tool to automate Chrome. It is designed to start from a fresh profile every time. If you do this, you'll need to script more interactions:
Visit the site's login page
Type the login credentials into the form and click the login button
Visit the site's authenticated page and save it to a file.
The benefit of this approach is that the result should be more reliable, preventing issues like expired login sessions.

Access all new Chrome Notifications programmatically

I have no previous experience with programming Google Chrome plugins which is why I am starting here to see if what I want to accomplish is possible/reasonable. I do however have a pretty broad experience in programming in general.
What I want:
I want some kind of "trigger" to go off when a new Chrome Notification (you know these little pop ups above the system tray) is popping up. I want to execute some script/code depending on what information the notification contains so that I for example could have an alarm go off if I receive an email from a certain user with a certain key word in the subject and get a pop up from my Gmail Notifier extension.
This is however just an example and I have a bunch of ideas for different notifications from different extensions and websites so don't get caught up on that particular example.
When I look at the Chrome Notification API I see that there is a getAll method that supposedly is getting all the "notifications in the system" but I do not find any Event for new notifications.
I suppose a possibility would be to poll with getAll a couple of times per second (it needs to be really fast for some implementations I have in mind) but it feels very tacky.
Is there any way to easily access new Notifications programmatically in Chrome?
(I'm open to all solutions, programming languages and such...)
Well, I searched long and hard and got involved with the Chromium dev group and asked around there. As far as I could figure out there was no reasonable way of accessing all Notifications programatically.
So what I ended up doing was just download the source-code of Chromium and build my own custom version of chromium adding a very crude API. Worked like a charm and not as complicated as one might think.
Cheers!

Can background jobs complete if you exit a browser after submitting a request?

I'm new to using background jobs (and much of programming in general) - so I'm aware this must be an simple question, but I haven't found an answer in my research.
I've written a Ruby on Rails web app that I have deployed to Heroku. After a form is submitted, it runs a background process for a web scraper script that takes about 10 minutes to complete.
My question is: If I quit my browser after the request is submitted,, will the background job still run and complete? If it will not, will just closing the window still allow it to complete?
My hunch is that it will, since the request goes through the server, but I just want to make sure. Thanks for your input!
I think so, Chrome now stays open, but I'm not sure if the webpage does.
Thanks to Ben Brammer's suggestion, I just went ahead and tried it myself! (It's amazing how I failed to think of something so obvious.)
Yes, it works fine: I quit Chrome immediately after submitting the form to begin the script. I then checked, and the script went through with no issues whatsoever.

Howto configure Hudson findbugs plugin to send notification mails

how do i configure Hudson Findbugs plugin to send a notification mail if a new failure is detected?
thx
That's what the description for the plugin states as features:
Failure threshold to mark a build as unstable
Configurable project health support
The first one won't help you. The second one might give you a chance to fail the build when new failures are detected.
This plug-in is developed and
maintained by Ullrich Hafner. Please
use the Hudson mailing lists or issue
tracker to ask questions, create
feature request or bug reports, since
I don't read the comment section on
this page regularly.
Since this a very special question, you might be better of using the mailing list. If enough people ask, he might update the plugin documentation.