Cypress - AEM default Captcha Service - javascript

How can I submit the default AEM (Adobe Experience Manager) captcha for testing purposes? Currently AEM allows to add 2 kinds of captcha: the first is default AEM built-in captcha service and the second is google reCaptcha service. In the second case it is so easy to write tests because google provides a test key that allows to submit a captcha whenever you want. But I dont have a clue how can I handle the first case. I haven't found any good simple solution to deal with this. Any ideas, workarounds?
Documentation:
https://experienceleague.adobe.com/docs/experience-manager-learn/forms/adaptive-forms/forms-captcha-feature-video-use.html?lang=en

Related

Amazon Mechanical Turk: How to use react/redux to implement HIT?

I have implemented a complex interactive HTML form using React and Redux. I want to show this form to mturk workers and retrieve the results as a json string (basically containing the redux state after completion of the form).
After some googling, I see three options how to do this:
1) Use a ExternalQuestion and host it on my own server. However, I can't find an option how to create an ExternalQuestion using the Mechanical Turk web-interface. I only found tutorials that explain how to create such a question using the mturk API. Is there no other way to do this? I want to avoid writing scripts for publishing, retrieving the results and approving the workers myself.
2) Use a pre-defined question type such as "Survey". In this question type I can embed an iframe pointing to my own server where the react app is hosted. Using additional javascript I could retrieve the results from the iframe, store it in a hidden field in the survey and submit that as my final result.
3) Compile my react app, upload the JS and CSS files to my own server, copy the HTML to mturk and reference the JS/CSS from there.
None of these options feels right to me. How can this be done correctly?
I think an ExternalQuestion would be my best bet, but I want to avoid writing my own API calls as bugs could result in money loss.
Option 3 is the typical pattern for this kind of use case.
You can reference your assets and then in your javascript put your submit value in a hidden input within the .
This blog post shows how to achieve a use case like this using Crowd HTML Elements with Amazon SageMaker Ground Truth. It should be a helpful starting point for how to do this using MTurk directly.
Please feel free to reach out to me at samhenry#amazon.com if you get stuck.
Thank you,
Amazon Mechanical Turk

Best practice: Typescript: Let a customer extend an application with custom code

we have an angular 9 based application framework, which gives a customer the possibility to configurate an application with fields and layouts. This works pretty nice.
But now we get to the point, where a customer wants to implement special features, like "He enters a value into a textfield and a request to a 3rd party software should be fired to load new data and autofill other values".
We could implement every possible interaction or allow to create custom snippets in javascript.
But in the past i have had a lot of bad experience with these base javascript snippets because they didn't have the needed standard functionality like typescript provides me.
1) Is there a way how a user can create custom code during runtime with typescript rather than plane javascript?
Yes i know typecript needs to be compiled before running, but I ask because I want to know if there is another way?
2) Alternative question:
Can a user develop an angular application and add it as plugin during runtime? Something like an extension or a custom functionality which will be added to the portal for the customer which is not part of the base framework?
Thanks for your help.
I don't know if I understand your question well but from my point of view the only way that an other user want to interact with the main Angular project is that he create a library by using the command ng generate library my-lib. (https://angular.io/guide/creating-libraries)
From there he can create a new module and then someone else import this new lib into the main project and that's it.
The new lib can be maintained by the "customer" and he can release new version of it if the lib is hosted in npm repository and from the main application just need to npm i customer-lib#latest
Did I answerd to your question ?
The thing is we have a hosted cloud application, where we have a standard implementation which is already compiled and deployed in a docker container.
Now a customer should have the possibility to extend the functionality by adding scripts and modules. Like it is common for example in wordpress. Where you have a standard implementation and if you want another wysiwyg Editor you install a plugin.
I know the only way of injecting code is via javascript but I just wanted to ask if there is another solution for this which will not lead to redploy the whole application.

Automate stuff with Javascript

I want to automate some tasks as below:
For a particular url eg:www.xyz.com, there are list of tickets nos ..so I want to click, perform an action on it which it will result in different page..and in that page.
I need to check some already filled input boxes depending upon that..I need to add content to some other input boxes and perform submit button.
Can this type of automation be performed in js ..if yes please advise of any framework ..and if no why not and suggest any other language.
I researched quite a bit, I think it can be performed in python, but i prefer any js framework or just vanilla.
Surely you can. This can be achieved using Node.js + selenium-webdriver package to automate what you mentioned.
Here is the API document of selenium-webdriver: https://seleniumhq.github.io/selenium/docs/api/javascript/
Here you can find tutorial on how to create web automation scripts with JavaScript:
BDD Web Automation Tutorial

jQuery function to override system default browser and my own?

I have a C# project, which has created an Outlook 2010 plugin. On click of the plugin a web based form loads inside the Outlook. The project loads form using the system default browser. I checked the project code and saw that jQuery.browser method is used to detect the system default browser specifics, and then use it in the program.
Now, I want to make a change to this code. All I want is to render the form using a browser of my choice, and not the system default one. Is there any jQuery function to override the default browser and use a custom one?
I am new to jQuery, and till now the online search I did, and articles I read, I didn't find any such method.
Your help help is appreciated!
Since the browser is the one running jQuery, jQuery cannot decide which browser runs it. Also, it is unaware of the context in which it's running, which is inside outlook.
To change this behavior you need to control it through outlook, though I highly doubt ms made chrome/ff available inside outlook.

How can I use custom javascript in Spring Roo generated pages?

I have been working on a spring roo project and I've hit a wall in terms of being able to customize the web page.
The main thing I want to do is be able to dynamically hide certain fields as the client is filling out the web form. I have a drop down list driven by enumerations that has 4 options and a fifth "other" option. If the user selects "other" I want a text box to appear so the user can fill out their own selection.
I was talking to someone and they said "This really depends on the UI you choose. In case of MVC scaffolding you can use javascript to drive these relationships". I am indeed using MVC scaffolding so I guess I have to use javascript. I don't really know that much javascript but the problem lies in that I don't even know where the javascript code would go in term of my project files. And then the second problem of course is how to use javascript to hide the fields dynamically in Spring.
Thanks
Spring MVC scaffolding uses dojo by default as its javascript framework.
You are able to use standard dojo functions when you attach events to DOM elements. You can simply use the <script/> tag to contain your own custom javascript methods within a generated .jspx page.
Additionally, you can integrate another existing javascript framework such as jQuery. At the moment you can include jQuery manually, but it can possibly be expected in a future Spring Roo version.
You can play safe with dojo for now.

Categories