Cypress + Gapi.js auth testing - node.js

I want to do full e2e with DB reset on each pre-commit on the local machine. So I trying to set up Cypress on the project with Gapi, which opens another browser window.
Is it even possible to take control of this process and get a valid g-token? Without the token, every API request will be failed.

Related

Disable automatic browser session on running E2E Test for CodeceptIO

I am using Codecept with Playwright. The problem I am experiencing is that whenever I start my E2E Test, there is a default browser session launched. Is there a way to disable this default browser session as I want to create sessions manually, if and when needed

Can a VSTS Cloud Load Test be configured to run a setup script before the test?

Prior to the test, I'd like to have a pre-test setup script make an API call to obtain a current auth token and then have the request headers in the load test web scenario refer to this token. To clarify what's meant by "prior to the test": Each run of a test might make hundreds of API calls using the exact same parameters: URL, headers, etc. I want the pre-test script to run before the test to populate a header value, but I don't need it to run before each of the API calls made during that test.

uber api - Take Me Home Now app - invalid access token - node JS

I'm trying to implement this prototype app: https://github.com/agraebe/Take-Me-Home-Now As a disclaimer, I'm fairly new to Node JS and API integration. I'd like to get the code functioning to show that I properly implement this OAuth2 workflow, and saw this app as a good way to practice that.
I'm having trouble obtaining an access token and receive the error: Invalid access token when I go to localhost:1455, and then click the "Login to request ride" button.
I've seen various reasons on stackoverflow. One could be that I need to have requests approved by Uber. I wouldn't think so though, since the code is using sandbox and not production.
My redirect uri is set as https://login.uber.com/oauth/v2/authorize?client_id=client_id&response_type=code with "client_id" set as my client id in that link. I've made sure the redirect uri matches what I have in the app developer account page.
Also, I've hard coded the details into the config.js file, since I've seen someone mention on stackoverflow that storing the environment variables could be an issue from the error I was receiving.
please help...
thanks!
I created the Take-Me-Home-Now app. Assuming you already installed all the dependencies (npm install in the project root folder), here are some things to consider:
You should disable your ad-blocker to ensure that's not the issue
You have to configure your app in the Uber Developer Dashboard:
Create a new app
Go to the authorizations tab and set the following configuration:
redirect url: http://localhost:1455/api/callback
origin url: http://localhost:1455/
general scopes: enable all the scopes (except for the priviliged ones)
Go to the settings tab and copy over the required credentials (client id, server token, and client secret). You will need them to start the NodeJS server, like this: client_id=[1] client_secret=[2] server_token=[3] redirect_uri=[4] mashape_key=[5] node app.js
In order to make use of the gender-awareness feature, you'd need to get an account with Mashape (Face++). As you might have realized already, the start command above also requires this key.
When you register your app with uber, you will have to define a callback URL. Even if it is your development machine (i.e. localhost:1455) When you send the request to the Auth server, you provide a client_id, response_type and callback_url.
When the user successfully authenticates, Uber sends back a code (hence the response_type=code) as a URL parameter to your callback URL. This code is NOT the token. This code is then used to get the token using the client_id, client_secret and code.
I would suggest doing some reading on how oAuth works to get a better understanding.

Slackbox - the requested URL could not be retrieved - access denied

I have slackbox running locally, have created a Spotify dev application and have successfully authenticated slackbox. It says I am logged in at http://localhost:5000/. All of my variables have been set, including the slack token, in an .env file via dotenv.
All seems well there.
On the slack side, I have created a slash command mapped to /spotify that POSTs to http://localhost:5000/store. The slash command shows up in my command description list when typing.
When I attempt to use it though, I get an access denied message in chat, I'm assuming due to cross-domain issues:
ERROR: The requested URL could not be retrieved Access Denied.
According to their docs - https://github.com/benchmarkstudios/slackbox - running this locally should work. I also run a Hubot bot locally and it integrates fine with the same slack room.
Any help is appreciated!
https://sprint.ly/blog/5-steps-to-a-slack-integration/
Slack’s outgoing slash command requests need to be sent to a public facing url, which is a problem if we want to receive these messages to our local development server.
How do we solve this?
One way is with the use of a secure tunnel which acts as a public HTTPS URL for our local development server. Problem solved!
Who provides this service?
ForwardHQ provide the best user experience, including a browser extension for setting up a local tunnel in one click. They have a free 7 day trial.
My preferred option is ngrok. It’s free for one concurrent tunnel client, with no time restriction. Woop! Its a little harder to use but it does the job.

CRD host for linux - "OAuth credentials are invalid"

I was trying to build the chromium source for the chrome remote desktop host and chromoting web app in linux. I followed the instructions from here and here, and the build was successful.
But the problem is when I add the chromoting webapp as an extension, it starts, asks for authorization, but after that shows:
Error: invalid_client
Examining the request details, I got client_id=dummytoken and believe this is the problem. So my question is, why this is happening and how can I solve this?
Another problem is when I try to start the chrome remote desktop host process, it stops with the following message:
...
Launching host process
['/opt/google/chrome-remote-desktop/chrome-remote-desktop-host', '--host-config=-', '--audio-pipe-name=/home/diptap/.config/chrome-remote-desktop/pulseaudio#7e4d6b70aa/fifo_output', '--signal-parent']
wait() returned (6794,26112)
Host process terminated
Failure count for 'host' is now 1
OAuth credentials are invalid - exiting.
Cleanup.
Terminating Xvfb
....
Why my credentials are invalid? Are these two problems are related? I got them according to the steps mentioned in the links.
This is first time I am building chromium or any chrome app, I may miss something obvious.
ok so I just figured this part out. Stuck at the next stage. I shall help you move forward.
I assume you compiled the chromoting webapp yourself. the credentials from the google cloud console dont seem to stick when you build it. I had to manually add it later.
Go to the folder where the app is located and modify plugin_settings.js as follows
remoting.Settings.prototype.OAUTH2_CLIENT_ID = 'YOUR CLIENT ID HERE'
remoting.Settings.prototype.OAUTH2_CLIENT_SECRET = 'YOUR CLIENT SECRET HERE'
and now you should be able to get past that stage. Infact you will now be able to access remote machines. enabling remote access to this machine however is posing me a few small problems. let me know where you get to

Resources