This was so great. I'm an Angular dev trying to learn testing so I can explore code patterns on random GitHub projects without worrying about screwing anything up. I'd have to rewrite unit tests every time, so Cypress is perfect. And your video was straight to the point and perfectly clear. Thank you Edit: I'm making my own KZbin video and linking to this. This was great
@Long_Le29 Жыл бұрын
Your two tips at the end conclude all. Thank you Nikolay
@test-automation-experience Жыл бұрын
My pleasure
@zain.sadaqat11 ай бұрын
You said, it's considered a bad practice if the second test is dependent on the first test. But I've a condition of testing a CRUD functionality. First Test Block: Creating an Item Second Test Block: Searching that previously created item Third Test Block: Editing the previously created item Fourth Test Block: Deleting the previously edited item In this way, I'm testing the CRUD functionality but how can I improve it using the Best Practices?
@test-automation-experience11 ай бұрын
Take a read and let me know if this helps - ultimateqa.com/automation-patterns-antipatterns#Best_Practice_Tests_Should_Be_Atomic
@cvetkovicslobodanАй бұрын
I have a case where my individual tests are dependent on eachother. First I test that I can create a entry, then edit it, and lastly try to deactivate it. If create is not successful, none of the others will be. However, if I combine these tests, the test will be very large, and thus harder to read and maintain. Is there any other tehnique how to keep it orginized, clean, readable, while not having the dependencies? Thank you!
@nikolay.advolodkinАй бұрын
Cleaning up interdependent tests #automationtesting #playwrightautomation #softwaredevelopment
@powertester5596 Жыл бұрын
5:52 : I think this totally depends and is not an anti pattern to use afterEach or afterAll. I would even say that both before and after method serves complimentary purpose and are both equally necessary to use. Take for example, with junit5, I want to have a singleton instance of a database with a connection pool that I only want to start once for the whole test run in the beginning and close only once at the end of whole test execution. Using a thread locked class with an afterAll method is the only clean way to get it done. You cannot close something that was not opened before in a beforeEach or beforeAll method. Also the example to reset database in the beginning of each test makes little sense since that for sure 💯 percent will affect other tests using the same database. So maybe you want to rethink your position on this one?
@test-automation-experience Жыл бұрын
These are Cypress best practices ;) JavaScript operates differently from Java
@powertester5596 Жыл бұрын
@@test-automation-experience that is true but the use case I mentioned is independent of Java or JavaScript. So for example in my tests, I had to not only create a database pool connection but a Kafka producer for the whole run. The use case remains the same that I want to create only one producer for the whole run and close it after the whole run. Trying to create one for each test would be super inefficient and not advisable. Also to avoid the test environment getting cluttered with automation test runs data, I often like to clean up the resource created as a part of test - in a afterEach method. For all these you need after methods to clean/close properly. I understand that setting assumptions before a test is better than assuming that some other test would have done it for us in an after each method but that is a completely different (and valid) use case of before methods and that’s why we need both. To say that generally using afterEach and afterAll is an anti pattern is bad advice.
@test-automation-experience Жыл бұрын
@@powertester5596 okay, so then why do you need to wait until the end to close the database? Why can't you extract all the data that you want into an object and then close the DB? Also, for what purpose are you opening a database?
@powertester5596 Жыл бұрын
@@test-automation-experience : ofcourse the RS connection is closed after storing the result into a object but you wouldn’t close the connection pool after each test - right? Same applies for all the other use cases I mentioned (clean up test run data, Kafka producer etc). If not, where would you handle the above use cases? On your question of use case, there are legacy apps that does not have an API or a front end and only contains a black box third party engine and a database where the result lands. P.S: I hope you seriously don’t stop believing that there are no activities that you should only do after the test and not always before just based on recommendation from someone 🙏.
@jopadjr6 ай бұрын
80th...Hi, just a quick question. I have installed an IDE ( Visual Studio Code) and Node JS. And installed cypress using the commands. We have done some proxy setup to install the cypress. npm config set proxy npm config set https-proxy When I used an external link (e.g. google, yahoo) the cy.visit() is working. It is not working when I tried running an internal URL/link. It says "Cypress could not verify that this server is running" Can you please advise on what to do here please or create a new video please if possible?
@test-automation-experience6 ай бұрын
I could create a video! But maybe the fastest way to your solution is to try ChatGPT? Or Google.com AI feature? Those should give you an answer more quickly
@jopadjr6 ай бұрын
@@test-automation-experience Thanks for the reply. Only if you have time. Yes, we did ask both AI tools. We are trying to install in Ubuntu instead of Windows. We'll see if that works.
@sarosilucian57911 ай бұрын
What is ironic is that after you install Cypress on your machine, the automation test examples provided by them are using id, classes, even but textElement from buttons using contains() command. From my point of view this topic approached by Cypress is nonsense. You can use id or classes and store them in the custom commands file where if some changes occur you will have to change 100 test i.e from only one file.
@test-automation-experience10 ай бұрын
I did a write up on this, please take a read ultimateqa.com/data-attributes/