Is there a way to set breakpoints in Cypress tests? - automated-tests

Like the title says. I've recently gotten a hold of a Cypress codebase that I need to convert into Playwright. I'm new to both Cypress and Playwright but have experience using other automated testing systems. The last one I used made it pretty easy to set breakpoints on any line that would let me step through the code and see what each line was doing. I figured if I could do this, it would make my deciphering of the Cypress code so I could turn it into something that works with Playwright an easier prospect. Google has not been the most helpful here.

You can use Cypress' debugger to achieve something similar to setting breakpoints while executing via cypress open.
cy.get('foo').debug();

If you prefer VSCode, there is a similar SO question. It seems it require some manual setup to get debugger to work.
For IntelliJ (IDEA, WebStorm etc.), there is a paid Cypress Support Pro plugin (I'm the author). It fully integrates the IDE debugger with Cypress. See this video overview.

Related

Unable to build ASP.Net apps

I am trying to build and compile an ASP.Net solution. The solution is new. Here is how I create it:
For this demonstration I avoid creating anything post-creating the project,
And here are the errors that I am getting:
All errors above, lead to the following place:
Any direction would be greatly appreciated!
Thanks!
Ok, assuming you looking to create a asp.net webforms app?
Your screen caps look ok, and it not clear why your resulting application has errors, or build issues.
I would try to create another project, different name. See if that works.
Better, try tapping windows key, type in 2022, and then right click and try run as administrator, and see if that helps. (the default source folder might for some reason require elevated rights to work).
And if above does not work?
then I would try a repair, or even re-install of VS. Perhaps the templates are messed up.
Following your exact steps, my vs2022 created asp.net web applcation without issues.
best guess:
Your VS install is messed up, re-install, or repair.
tools->get tools and features.
Then: close the modifying window, and you should see this:
Try a repair.
Thanks Albert and everyone attempting to help!
What I did that solved the issue is to click the errors, and I was redirected to the following document:
Here, I deleted every tag that was highlighted in any of the errors, more specifically, things related to Video Builder Cloud Services (VBCS), and off I go :)

How can you specify your terminal emulator in Corda

Xterm is used when running Corda locally on one computer using gradle.
Is there a way to specify your terminal editor when running as suggested by the following issue?
https://github.com/corda/corda/issues/2605
I completely share your pain on this. The way that runnodes has its tooling baked in makes it impossible for you to customize how the cordform plugin runs the nodes without digging into the internals.
Some other ideas for you
one thing you could do would be to stop using cordform altogether and run your corda network using dockerform (example here: https://github.com/corda/samples-java/blob/master/Features/dockerform-yocordapp/build.gradle#L93) so that the plugin doesn't need to actually create new terminals.
the much harder way would be to actually download the corda gradle plugins (https://github.com/corda/corda-gradle-plugins#installing-locally) and install it locally with your edits to the cordform task so that it opens the terminal of your choice. You may be able to PR them as the cordform task that's usually used to generate the runnodes script comes from here as far as I know.
As a separate note, I saw your github issue and I was disappointed by how that got handled. I'm sorry you had that experience and I'm going to dig into that issue internally to find out what's happening with that.
feel free to reach out to me (David Awad) on slack.corda.net and I can let you know what's going on there.
Thanks as always

Is there any video recorder for Selenium WebDriver?

i am working in Selennium Webdriver2 with IE specific application. i know we can take the screenshots of the execution. similarly, Is there any option to record selenium execution as a video?
There is nothing in WebDriver.
Sauce uses http://www.ffmpeg.org/ to record video's. There are other options like https://code.google.com/p/java-remote-control/.
Generally the answer is that if you want to do it, you are going to have to implement it yourself.
This API helped me in solving the above problem, this is for your reference guys,
Selenium provides us with the feature to run the automation code/suite and record the output as a video and save it on your system. This video can then be shared with anyone who can see what the automation is doing. First of all, to enable video recording, we need to download some important jars. They are freely available to download from Google. Below are the jars to be downloaded. These are the latest version available, any other version can also be downloaded:
ATUReporter_Selenium_testNG_5.1.1 and ATUTestRecorder_2.1
Complete code can be found here:
https://mytechdevice.com/how-to-record-video-of-automation-output-in-selenium/

Selenium IDE and Drupal

Can I use Selenium IDE on a Drupal system?
I found http://drupal.org/project/selenium but that involves downloading Core and not using my current machine.
Does anybody know of a way to use the IDE with Drupal, or if not what do you suggest I do?
You can, in the same way that you can use selenium on just about any web page.
From what I can see (though I haven’t' used it) the selenium module seems to be more about using Drupal to store and run selenium tests, which is useful, but will not explicitly test your Drupal site. (edit: this module dosn't look like it is currently maintained)
Drupal comes with it's own testing framework which uses simpletest. This can do a lot of the testing that you will need. It can handle form submissions and check for text in a page. There are two cases that I personally have found that it is not very useful for:
Data integrity, where you would like to check that the content of a particular page is correct where you know what to expect on your system
Two is checking the site layout, where you wish to check your live site that certain elements appear as they should do.
Selenium can be used for both of these, in the simplest case you can record tests against your site and play them back to check it. You can check for an elements existence and style. You can check that elements have the text you would expect. Even a few of these can be useful as a tool for checking the configuration of your site.
It is also possible to integrate selenium with simplest so that while running your simpletests through Drupal it will run selenium tests, however this can get very complicated and confusing.
There's a nice new module that takes Selenium exports (in PHP) and converts them to Drupal SimpleTest suites. http://drupal.org/project/simpletest_selenium
This is nice because you can then do continuous integration testing by using Drush to script the running of your tests.
The question is what do you want to achieve?
testing a Drupal site?
saving / playing back configuration settings (automation through the browser)?
The Firefox & Selenium IDE (FF extension) combination works great with Drupal for functional testing.
It also works great if you want to capture some Drupal configuration settings (that you'd like to play back e.g. in another environment) but there are better ways - Patterns and Strongarm modules - to achieve that.
A couple of tips & tricks:
while capturing clicks be careful with timings (between clicks), sometimes you need to add "pause" lines to your test case,
for HTML form checkboxes Selenium often records the "click" action instead of the much safer "check" or "uncheck" action (this is important if you run your test case several times against the same page / form),
if your page reloads when you click a certain link, use "clickAndWait" instead of the simple "click" action,
use "verifyTextPresent" often, especially if you're running your tests "blindly", using Selenium RC.
I use selenium IDE all the time. It's an awesome tool for productivity and communication.
But Drupal's Simpletest framework has a built in browser for user testing. So you probably won't that module.
See:
http://www.lastcraft.com/web_tester_documentation.php
http://drupal.org/node/265762
http://www.lullabot.com/articles/drupal-module-developer-guide-simpletest
You can test Drupal 7 with SeLite, which extends Selenium IDE. It allows your tests to access (read and write to) a test DB (isolated from the DB of the tested application).
It's especially good for Drupal 7, which can have its data in (separate) SQLite DB. So if your test environment can use SQLite, your test data lifecycle will be very easy. However, you can benefit from SeLite even if your test Drupal instance uses other type of DB.
See https://code.google.com/p/selite/wiki/ProjectHome and https://code.google.com/p/selite/wiki/DrupalTutorial.

Doh / dijit robot - no mouse actions happening

I wrote an automated test using dijit robot - but in order to be able to use relative paths within our web application, I created an OSGi service for our tests and put the test code in a velocity template. When I try to run the tests, nothing happens. If I use the same script in an html file and access it directly from windows explorer (not via localhost), it works fine. I find that there are many cases that will make the dijit robot tests just not run - has anyone ran into this and found out all the little gotchas to make dijit tests run?
Check out dijit.initRobot(), that might take care of some things for you.
One thing that was screwing up a lot of my tests is described in this blog post - basically the robot was not initializing because I was obscuring a special div that the robot clicks to initialize.
However I have realized that there are still quite a few problems with the doh robot - it just seems very fragile. Often I will have a working test, then add 1 robot command and the test will break. When I remove the line and try it again...well the robot wont run even though it is the exact same code as before.
I've found the best thing to do when writing robot code is to just clear the cache every time and cross your fingers. Good luck.
Problem can be if you trying it with openjdk, run it on oracle java version

Resources