checking for xpath selector in rails using capybara - xpath

I am checking a label with text like
user's email can't be blank
I am testing it as follow:
assert_selector(:xpath,"//label[text()[contains(.,'user''s email can''t be blank')]]")
but it is not working.
Also I tried this:
assert_selector(:xpath,"//label[text()[contains(.,'user\'s email can\'t be blank')]]")
Can some please tell me how to check for selector?

How about you reverse the quotes:
assert_selector(:xpath, '//label[contains(., "user\'s email can\'t be blank")]')

Related

$quot; not being parsed in laravel email

For some reason, Laravel does not parse " as expected in the footer of emails.
I am expecting to see an actual quote, but it's returning the HTML as-is.
I have tried overriding this using the toMailUsing in my AuthServiceProvider but this particular line doesn't seen to be editable.
Please advise on what I'm doing wrong.

How to read gmail inbox messages and extract the data from the email in a word/excel folder using UiPath?

I'm using gmail account to extract the data, from the body of the mail and I want to store that data in a word/excel folder.
Can someone explain the process to achieve this?
The email body would be like this:
Hello!
First name
John
Last name
Doe
Email
sample#gmail.com
Message
Text
You can read the email using the Get IMAP Mail Message activity and get the Body of Email in a Text then you can use the String manipulation/regex to find the required text and then store it in Excel/Word.
You may need to keep the following things in mind.
You will need to create an App Password by going to your Google Account Settings (https://myaccount.google.com/apppasswords) and use that Password in the Get Mail Message Activity.
To Get the Email Body the EmailMessage.Body property will not work instead you will need to use the EmailMessage.Headers("PlainText") Here EmailMessage is the Each Email Message from the list of Message. Here is the screenshot.
Above If condition is used to check if the Subject of Email which we want to read.
Once you get the Email Body in a String Variable you can use either String Manipulation or Regex to extract the required data from the body of the email and write to the excel or word.
Hope this helps.

Encode E-Mail in Laravel 5.7

I have a page who i can see all user profiles.
So i have a foreach who show me all my profiles.
i want to display the user email
this is the way i do:
{{$user->email}}
but i want to encode the mailto because i want to prevent spam mails
so i want it like:
<a href="mailto:mail#example.com">
instead of
<mail#example.com
does anyone know how i can do this in laravel?
because there is a tool like this:http://www.wbwip.com/wbw/emailencoder.html
but here i can only encode one email
is there a way in laravel who i can say encode($user->email) and then i have the mail like on the top??
thank you so much!
i searched everywhere but i can not find anything
maybe what you need is htmlentities in php
htmlentities — Convert all applicable characters to HTML entities
read more here
You should try this:
{!! link_to("mailto:".$user->email, $user->email) !!}

Codeigniter's redirect is not passing variable data

I have a form to update some profile information. After making changes when the user clicks on the submit button my to be redirected to the profile page.
so after inserting the updated information into database I have the following code to redirect to the profile page:
database query goes here...
redirect('studentprofile/get/$id');
Here the $id is the the profile id and "get" is the function and "studentprofile" is the controller. But this is not working at all. It seems like the "redirect" is not getting the value of $id.
When the user submits data it shows an error saying "The URI you submitted has disallowed characters." and the URL looks like this
http://localhost/sundial/studentprofile/get/$id
would you please kindly tell me what is wrong with my script? Just for your information I am using Codeigniter
Thanks in advance :)
You need the redirect path string to be in double quotes:
redirect("studentprofile/get/$id");
or write it like this:
redirect('studentprofile/get/'.$id);
You are using single quotes use single quotes instead and btw that is not an issue of CodeIgnitor. Read more about strings: http://www.php.net/manual/de/language.types.string.php#language.types.string.syntax.double

Blank Email issue in magento for new order

In my magento website As soon as someone places order , an email is sent to his/her emailid. In the email the subject is correct but there is no body in the message, i mean the message comes blank.
i added new template from Transactional Emails section and associated this template with the Order from configuration->sales emails. but still my subject of the template reaches to mails but not the body. the message body remains empty always.
please help me solve this issue
thanks in advance
Looks like there is some error during rendering the email template. Try to replace your email template body with something simple.
Magento doesn't trigger any error when the template is not returned/processed properly.
The trace is:
Mage/Sales/Model/Order.php - sendNewOrderEmail()
Mage/Core/Model/Email/Template/Mailer.php - send()
Mage/Core/Model/Template.php - send()
Some things to check first - is the email valid for send, see the conditions below:
public function isValidForSend()
{
return !Mage::getStoreConfigFlag('system/smtp/disable')
&& $this->getSenderName()
&& $this->getSenderEmail()
&& $this->getTemplateSubject();
}
Another thing to look for:
If you copy-pasted some of the email content you might have some characters in the email that are not ASCII. This causes a crash when the template is parsed and there is no error logged/displayed.
This can be checked by using the standard Magento email template and if that works and your custom template doesn't.
I found that the cause of the error was the vars:
{{config path='trans_email/ident_support/email'}}
{{config path='general/store_information/phone'}}
If these are deleted/substituted, then the emails are being sent without errors.

Resources