مرحباً بك في موقعنا..

عن

‏إظهار الرسائل ذات التسميات الترفيه. إظهار كافة الرسائل
‏إظهار الرسائل ذات التسميات الترفيه. إظهار كافة الرسائل

الخميس، 13 يونيو 2024

Writing E2E tests with Cypress

 

In the previous post, What Should I Test in the Frontend?, I focused on unit and integration testing in the frontend. In this post, I will learn about another type of frontend testing, E2E testing, and use Cypress, an E2E testing tool, to create an E2E test for my ongoing side project, and through this I will also cover how to create an E2E test. 

1. Why do we need to do E2E testing?

E2E (End-to-End) testing verifies the flow of an application from start to finish, and has a different meaning from the unit testing and integration testing mentioned above. Unit testing and integration testing verify that the developed modules are working properly from the developer's perspective, but E2E testing verifies the operation of the application from the user's perspective. Therefore, E2E testing is mainly performed in a browser environment where real users use the application, and most E2E testing tools provide the ability to view the testing process in snapshots or videos.

The advantage of E2E testing is that it can be carried out in a real user environment, but at the same time, it is also a disadvantage. This makes E2E testing heavy and requires the entire application to be put into a real environment, which means that the overhead is very large. Therefore, E2E testing should only be used to verify the main usage flow of users or to verify the integration between modules, and each module should be verified to work properly with unit tests or integration tests.

However, in the frontend, UI and logic are combined, and the inverted pyramid testing (ice cream cone) anti-pattern often occurs, where many tests are created in E2E tests. Because E2E tests take a long time to run and are difficult to manage, you should create independent tests for each component using a library such as @testing-library. For information on how to create independent tests, please refer to the article What should the frontend test?

Although it has its shortcomings, E2E testing is the only type of testing that can ensure that the modules created by developers are integrated and work properly when used by users at the application level. Therefore, E2E testing is also very important.


In my opinion, there are two cases where E2E tests are very useful. The first is to ensure that the user's main path works properly from a business perspective. The second is when applying ATDD (Acceptance Test Driven Development). If some modules are not working properly, but the user's main path works properly, it may not be a critical issue from a business perspective. But if the main path does not work properly, this may become a very big problem. When writing these tests, E2E tests are very suitable

I also believe that Acquisition Test Driven Development (ATDD) is a very suitable method for teams that develop in an agile manner with iterative cycles on a user story basis. ATDD can be very attractive because it can lead to deeper discussions about the development end product among stakeholders and clearly define the development end. In fact, the reason I introduced Cypress-based E2E testing to this side project is to try applying ATDD to the next project.

Why Cypress?

Cypress is a popular E2E testing tool. Cypress is often compared to Selenium, but the main difference between these two is in their architecture: Selenium runs outside the browser and executes commands remotely over the network, while Cypress executes commands in the run loop of your application, etc. Therefore, Selenium can be written without being tied to a specific programming language, but it is slower and requires additional configuration of language-appropriate modules. On the other hand, Cypress can only be written in JavaScript, but it is faster and more integrative. Therefore, if you are developing an application with a JavaScript-based framework, you can use Cypress to quickly apply E2E testing.

2.1 Page Object Model vs. Application Working Model

As mentioned before, E2E tests are more difficult to maintain than other tests, so we often apply techniques to make this easier. In Selenium, we often use a technique called the "Page Object Model" for this. However, the Cypress community recommends using the "Application Working Model". What is the difference between the two?

 Page Object Model

The page object model creates an object for the page, and defines the page's elements and actions in corresponding objects. In other words, it creates an abstraction layer above the page that encapsulates the tasks related to the page. This way, it is more flexible when changes occur; for example, if an element's ID changes, you would typically have to modify all your tests, but with the page object model you can just find the element in the Page class and modify it.

In cypress you can create a page object model like this:

Adobe Photoshop Lightroom Classic CC 2019 Latest Version Free Download

Adobe Photoshop Lightroom Classic CC 2019 Latest Version Free Download
Download Free Adobe Photoshop Lightroom Classic CC 2019 Latest Version (v8.2.0.10) Most Up-to-date Version for Your Windows Compatibility x64 (64-Bit). This video editing application Installing System File is a total Offline as well as Standalone Setup. You Can Simply Download This Graphics Designing Application without Any Analysis and Suffer.
Adobe Photoshop Lightroom Classic CC 2019 Latest Version Free Download
Adobe Photoshop Lightroom Classic CC 2019 Description:
Photoshop Lightroom Classic CC 2019 is an imposing as well as famous software for Graphics Design and also for Photo Editing these days. This is extremely helpful software for you in order to design graphics as well as edit images and manage RAW photos as well and this software has been created by the famed software creating company Adobe. This Adobe Photoshop Lightroom Classic CC has loads of options that have been decorated goodly they are- fixing chromatic aberrations, generating virtual copies as well as changing metadata. This graphic design software will give you five stages at all times and by these stages, your photo will pass through to get the ultimate result. You know you can simply control among these 5 stages through clicking once. It has been beautified along with an extensive library where you can control as well as choose the images that are referred to you. The development option that has been offered to your actual editing.
Adobe Photoshop Lightroom Classic CC 2019 Latest Version Free Download
You can take a look at the metadata which will be edited and you can also add your precise locality on there where the Map part has been provided. A variety of album as well as slideshows can be made without difficulty in a few cases. You can also take a look at the histogram of your images plus can crop the images which you would like to keep. We will get some red eye problem simply in our images. So for that trouble, we all know there has a suite which can remove that red-eye effect which has been also decorated goodly. Lightroom Classic CC’s most up-to-date version will provide you that control which is needed to you for maintaining the white balance, chromatic aberration fixing, lens correction & also sharpening image brightly. So on conclusive, we can say that this is an impressive application for you to design graphics, edit images & manage RAW photos. Photoshop Lightroom Classic CC 2019 is an imposing as well as famous software for designing graphics as well as editing images and managing RAW photos as well.
Adobe Photoshop Lightroom Classic CC 2019 Latest Version Free Download
Adobe Photoshop Lightroom Classic CC 2019 Features:
There are quantities of vital features that will help you to have sufficient experience to run plus work after downloading Adobe Photoshop Lightroom Classic CC 2019.
  • An imposing as well as famous software for Graphics Design and also for Photo Editing these days.
  • Extremely helpful software for you in order to design graphics as well as edit images and manage RAW photos as well.
  • Has loads of options that have been decorated goodly they are- fixing chromatic aberrations, generating virtual copies as well as changing metadata.
  • Will give you five stages at all times and by these stages, your photo will pass through to get the ultimate result.
  • Can simply control among these 5 stages through clicking once.
  • Has been beautified along with an extensive library where you can control as well as choose the images that are preferred to you.
  • Can take a look at the metadata which will be edited and you can also add your precise locality on there where the Map part has been provided.
  • Can also take a look at the histogram of your images plus can crop the images which you would like to keep.
  • Will get red-eye effect solution which has been also decorated goodly.
  • Will provide you with that control which are needed to you for maintaining the white balance, chromatic aberration fixing, lens correction & also sharpening image brightly.
Adobe Photoshop Lightroom Classic CC 2019 Latest Version Free Download

Adobe Photoshop Lightroom Classic CC 2019 v8.2.0.10 Technical Setup Details:
There Are Quantities Of Extremely Vital Technological Setup Details With This You Can Know The Whole Thing Plus Can Have Skills Previous To Using Adobe Photoshop Lightroom Classic CC 2019.
  • Software Full Title: Adobe Photoshop Lightroom Classic CC 2019.
  • Setup File Title: Adobe.Lightroom.Classic.CC.u3.Multilingual.iso + Adobe_Photoshop_Lightroom_Classic_CC_2019_v8.2.0.10_ x64.zip
  • Full Setup Size: 1.20 Gigabyte (GB).
  • Setup Type of Installing: A total Offline as well as Standalone Setup.
  • Compatibility-Architecture: 64-Bit (x64).
  • Latest Version Released: March 13th 2019.
  • Developers: Adobe
Adobe Photoshop Lightroom Classic CC 2019 Latest Version Free Download

Adobe Photoshop Lightroom Classic CC 2019 System Requirements:
Previous To Starting Download Adobe Photoshop Lightroom Classic CC 2019 Most Up-To-Date Version, You Need To Be Certain That Your PC Has Minimum Requirements of System.
  • Operating System (OS): Windows 7/ 8/ 8.1/ 10 or later (For Windows 64 Bit).
  • Memory: RAM needed 4 GB.
  • Hard Disk Space: Free space needed 2 GB.
  • Processor: Intel® or AMD processor supportable along with 64-bit & 2.00 Gigahertz or the updated processor.
  • PC Expresses: AMD, Intel, NVIDIA, and OpenGL (1.00 Gigabyte Video Card RAM 4.00 Gigabyte optional).
  • Monitor or Display: 1024 x 768 screen resolution or the updated.
Adobe Photoshop Lightroom Classic CC 2019 (v8.2.0.10.x64) Latest Version Download
Click At The Downward Button In Order To Begin Downloading Adobe Photoshop Lightroom Classic CC 2019 Latest Version (v8.2.0.10). This Is A Total Offline As Well As Standalone Setup Installing System File Of Lightroom Classic CC 2019. The Compatibility Has To Be x64 (64-Bit). Along With Accurate Requirements of System, You Can Effortlessly Download This Graphics Designing Application With No Analysis And Suffer.

الاثنين، 10 يونيو 2024

PlayStation 4 supports the possibility of soon playing computers using Windows and Mac




PlayStation 4 supports the possibility of soon playing computers using Windows and Mac
Sony has confirmed that the PlayStation gaming platform 4 supports the possibility of soon playing computers using Windows and Mac as head Shuhei Yoshida said Sony studios around the world.

Shuhei said in the tweet posted on his account in Twitter that some people did Asked whether Sony was planning to provide access remote play using the computer. He added that the company has already begun work on a tool that allows games to run the fourth generation of the PlayStation and play using computers that work by Regular Mac and Windows.

Currently provides Sony the possibility of broadcast games from the PlayStation 4 to PS Vita, mobile gaming platform from the company, but play using the computer better, especially with the presence of more than a means to control the game, such as the keyboard, mouse, as well as handles play.

After the release of Windows 10 and made available to platform games for Microsoft's Xbox One, the US company has provided the possibility of broadcast games from the platform to the computer and use it also to play, and therefore Sony platform remains without this possibility so far until the issuance of a formal application.

The team launched a few days ago tmacdev tool for Windows allows to broadcast games from the PlayStation 4 at a price of about US $ 10, where it is believed they are the reason that the President of Sony studios pay to respond to its fans and confirmation work on the official tool of the company.

The Sony also confirmed that it is working on a technology that allows to run their games Playstation 2 platform games on the PlayStation 4 according to the site Wired.
المقال السابق المقال التالي