Get the behat profile name in a context - bdd

How do I get the profile name that I'm running currently in a future context. Id didn't find any behat documentation on running this. I saw a post related to my question. But is there a better way of getting profile name that the test is currently running on?
My expected results change based on the profile that I'm running.

$baseurl = $this->getMinkParameter('base_url');
Using the $baseurl parameter, it is possible to differentiate between the profiles. Thank you #lauda

Related

Possible to get username for owner of mentioned comment?

I'm brand new to wrangling the IG Graph (and to API's, in general) and hoping someone might be willing to lend a hand. A bit of context: I am building a SaaS on Bubble.io. I have my authentication set up and am in the process of developing my FB App. In short, I want to enable the following:
Auth'd users curate content on IG by #mentioning my app's account in a comment to a post.
Those comments are intercepted via web hook (currently running smoothly on Integromat).
They payload is then passed to an API Workflow on Bubble, which parses the comment ID
The workflow then retrieves details of the comment and associated post.
The comment is correlated with the appropriate app user based on the username of the comment's owner.
The final two steps is where I'm confused. Based on my reading of FB's documentation, it seems impossible to retrieve a username or user id for the owner of a mentioned comment, which clearly presents a problem for me. Is this the case or am I just missing something? It seems to me there should be a way of getting at this data.
enter image description here
You can use the username field, as done followingly:
mentioned_comment.comment_id(COMMENT_ID){media,text,username}

How can my app programatically fetch all of it's console logs? [duplicate]

This question already has answers here:
Can I get console logs from my iPhone app testers?
(2 answers)
Closed 3 years ago.
I am looking for a way to programatically pull all of my application logs that are shown in console.
.
I DO NOT WANT to just be able to see them, so using xcode as a preview will not work for me.
What I want is my users to be able to send me those logs along with feedback any time since app is in beta phase and plain user explanations are not good enough for proper debugging at my end.
So, what I DO WANT is some iOS analogy for Android's logcat command which is being used somehow like this:
final Process process = Runtime.getRuntime().exec("logcat -d");
final InputStream inputStream = process.getInputStream();
... then you manipulate the stream into whatever you need to do with it, in my case, to create a String object that i would pass on to my log service.
SO FAR in my investigation I was only being able to find this option, but I would appreciate if something easier to integrate into Swift app is available.
Also, os.log module is used for logging, but I wasn't able to find an option where it allows loading the logs. Or my understanding of the following explanation found HERE is not good enough:
Use the Console app or the log command-line tool to view and filter log messages.
EDIT:
END USER SHOULD NOT INTERRACT WITH LOGS in any way other than just clicking the submit button while switch for debug logs is ON.
So #matt NO - this is not the duplicate of the linked issue.
End users should NOT have to download something else too in order to be able to feed me with my own app logs.
That is a classic killer of user experience and should not even be approved as a solver on the linked post either.
To your last point. That explanation is telling you to connect your phone to a mac and use the "Console" application (or command line tool) to extract the console logs e.g. https://support.apple.com/en-ie/guide/console/welcome/mac
The first link you have provided (using ASL) is the only solution I'm aware of to do this natively. 2 other options would be:
Use a server/cloud based analytical/event tracking system to log messages for each user. If someone sends an issue you can search the logs to see what happened. (Be careful about storing personal information though).
You could write your own class / function that takes in a string, and writes it to a text file and logs it to the console. During development you will see it in the console and in the wild it will store it. When you want the details, you could just read the text file and upload it. Need to be careful of it growing too big. And again depending on where its stored, personal data could be an issue.
I've always used option 1. There are many free services to do this and lots of solutions for releasing apps to test users provide this out of the box too. Microsofts AppCenter being one, and I believe is free unless you want CI/CD

UIAutomatorViewer showing same resource id's

I have been doing Android Automation for an app using Appium. Everyday a new build comes of the app and I have to check the code for new fixes using Automation. The problem I am facing is that in a current new build of the app the resource id's of all the buttons and fields that I need to access in automation has become same. I could use Xpaths to access certain elements but using Xpath's will make automation slow.
I use UIAutomatorViewer to get Xpath's and resource id's.
Can somebody help me in determining if the same resource id issue that I am facing is at the Android end or if my UIAutomator is not working correctly and showing same id's?
For security purposes I cannot share the screenshot.
Using Xpath is not recommended. The reason is that the infrastructure used to generate the XPath, doesn't guarantee that the XPath will remain the same between two different executions.
The only solution i see to your problem is to ask developer to add unique automation id for each element. You can ask them to put unique cont-desc in their code. Then you will be able to access element using findByAccessibilityId.
MobileElement element = driver.findElementByAccessibilityId("SomeAccessibilityID");
I ask my devs to always put ids of all the items in the screen for automation purpose. Also check with devs if in some case they are not able to do so then xpath can be used in some cases.

Spreadsheet : Issue in fetching current user email id

I am using Session.getActiveUser().getUserLoginId() to fetch the current user's email id but other than creator of the spreadsheet it is returning empty string. I have also used getEffetiveUser() but no hopes.
I will be appreciate if i could get some suggestions on this.
Many Thanks in advance.
Regards,
Chetan
Quote from the Google documentation:
If security policies do not allow access to the user's identity, User.getEmail() returns a blank string
Note that User in the above code is a sort of "placeholder" for the "User" class, which the Session.getActiveUser() returns.
If your script is set to:
web app deployed to "execute as me"
You can not get the user email.
So, the one thing I can tell you for sure, is that your code does not have permission to get the user info. I can't tell you why, because I don't know the conditions and settings under which your code is running.
Link to Google Documentation for getActiveUser method

Uid has already been taken in ruby?

I'm new in ruby on rails. I have done my deployment of ruby site (catarse) on linode. When I'm doing my first signup using normal method or aAuth i.e facebook login it creates the account. But when I'm trying to create another account I'm getting the error 'Uid has already been taken?' Do anyone have idea about this error ? Please help
This is an indication that you are trying to create a new user with a UID that already exists in the system. The best place to start is to look up the UID of your first created user - it's probably not what you expect it to be (perhaps nil, perhaps some error code). To fix, you'll want to find out what's causing your UID to be set incorrectly, and adjust that code in your user creation method.

Resources