Creating a cypress custom command for getting text in typescript

i am working on a cypress project and I am trying to create a custom command which resolves promise and returns text on the passed locator. export default class QuickRegisterPage { emailAddressText() { return cy.get(‘#emailAddress’); } public createNewUser() { cy.getQuickRegisterUrl().then(url => { cy.visit(url); text = cy.getText(this.emailAddressText()); cy.log(text); }); } Cypress.Commands.add( ‘getText’, (element: Cypress.Chainable<JQuery<HTMLElement>>) => {…

How to find quotes with double quotes?

my english language is not good. sorry! How to write quotes with double quotes inside the one var? i want merge two script: number1 and number2 //number 1: var rew = /\’/g; $(‘span’).contents().each(function() { if (this.nodeType === 3 && rew.test(this.nodeValue)) { this.nodeValue = this.nodeValue.replace(rew, ”); } }); //number 2: var ref = /\”/g; $(‘span’).contents().each(function() {…

REST API + WebMethods

I have developed RESTful API using C# which accepts JSON object. It works perfectly alright when i invoke it using jQuery, and returns the correct response. Now, this same API is being consumed by webmethods (it’s JAVA based tool). While doing so they pass special characters, and the API throws “Internal Server Error”. I checked…

Show “Thank you message” in same popup window in Magnific popup with gravity forms

I want to keep showing “Thanks for contacting us! We will get in touch with you shortly.” message in same Magnific popup window after form been submitted. At the moment after form been submitted window closes. Code I using: <script> jQuery(function ($) { $(‘.open-popup-link’).magnificPopup({ type: ‘inline’, closeOnBgClick: false, fixedContentPos: true, closeOnContentClick: false }); }); </script>…

How to fix video click event issue in mobile Firefox in jQuery

When I add a click listener on a video element it is working in all browsers except Firefox mobile. <div class=”modal fade” id=”myModal” role=”dialog”> <div class=”modal-dialog”> <div class=”modal-content”> <div class=”modal-header”> <button type=”button” class=”close” data-dismiss=”modal”>&times;</button> <h4 class=”modal-title”>Modal Header</h4> </div> <div class=”modal-body”> <h1 id=”video-id”></h1> </div> <div class=”modal-footer”> <button type=”button” class=”btn btn-default” data-dismiss=”modal”>Close</button> </div> </div> </div> </div> <div…