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

عن

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

الخميس، 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:

الجمعة، 10 مايو 2024

اعداد الميكروتك لدمج خطوط الإنترنت وتجنب فصل الخطوط وانقطاع الانترنت

اعداد الميكروتك لدمج خطوط الإنترنت وتجنب فصل الخطوط وانقطاع الانترنت 

اولاً علينا ضبط اعدادات المصنع للروتر وذلك بطريقه التاليه  

الدخول على الميكروتك بستخدام الوين بوكس WinBox 


 
من ثم الذهاب الى system من ثم اختيار Reset Confinguration

وبعد ذالك اختيار 

الان علينا الانتظر حتى اعادة تشغيل من جديد 
بعد اعاده التشغيل نفتح مره اخرى ونبدا بالاعاتدادت سوف نقوم بعمل موازنه التحميل الدمج لثلاثه خطوط dsl
الان لنفترض انه الخط الاول في ether1  والعنوان الخاص بروتر ال  dsl ليكون 192.168.103.1
علينا اضافه ال ip الى الميكروتك  كما في الصوره التاليه

يمكننا الان اضافه ip address 




 

الاثنين، 12 مارس 2018

افضل 5 العاب Battle Royale على الهواتف

باتيل رويال

هل أنت من محبين العاب Battle Royale ؟! ... في تدوينة اليوم سنضع عناوين 5 ألعاب على الهواتف الذكية والتي تضعك في أجواء التنافس الحقيقية مع أصدقائك، سنبدأ من المرتبة الخامسة الى الاولى.

5- لعبة Pixel's Unknown Battle Ground
هل تحب العاب البكسل ؟ .. فهذه اللعبة هي افضل خيار لالعاب البكسل باتيل رويال.


مجانية
ANDROID - IOS

4- لعبة TIO: Battlegrounds Royale


مجانية
ANDROID

3- لعبة Free Fire - Battlegrounds


مجانية
ANDROID - IOS

2- لعبة Knives Out


مجانية

1- لعبة Rules of Survival
وضعنا هذه اللعبة في المرتبة الاولى لانها بالفعل اقرب ما يكون لالعاب الحاسوب واجهزة الكونسول، اللعبة تستوعب 120 لاعب والان يتم تجربة بيتا لتستوعب 300 لاعب في المعركة الواحدة.


مجانية
ANDROID - IOS

شاركنا برأيك من خلال التعليقات...

السبت، 29 أبريل 2017

تطبيق Live Home 3D للتصميم الداخلي


تطبيق Live Home 3D يتيح لك تصميم المنازل داخليا ورسم غرف من الصفر بكل سهولة وبساطة ويحتوي التطبيق على اكثر من 2100 من الخامات واكثر من 1500 من المواد التي يمكنك استخدامها بكل سهولة ، التطبيق متوافر على متجر الويندوز لأجهزة الحاسوب والهواتف التي تعمل بنظام ويندوز 10 موبايل.

يتوفر نسختين من التطبيق وهم النسخة المجانية ونسخة Pro والتي تأتي بإضافات أكبر ، وبعض الامور التي يمكنك انشائها عبر التطبيق :
* إنشاء طوابق ثنائية الابعاد.
* انشاء صور ثلاثية الابعاد.
* رسم غرف كاملة.
* استخدام الادوات لرسم الجدران.
* تحديد وحدات القياس المطلوبة.
* تطبيق مواد والخامات والاضاءة واكثر من ذلك في بيئة 3D.
* استيراد النماذج.
* انشاء صور 360 درجة.
* والكثير من الامور قم باكتشافها بنفسك..

يمكنكم تحميل التطبيق من خلال الرابط التالي (هنا) او من خلال الذهاب الى متجر الويندوز وكتابة Live Home 3D ، والمواصفات التي يحتاجها التطبيق .. رام بحجم 2 جيجا وكرت شاشة بحجم 1 جيجا ومساحة داخلية بحجم 1-2 جيجا ، أخبرنا برأيك بهذا التطبيق من خلال التعليقات.

العاب الحاسوب والاكسبوكس والبلايستيشن على هاتفك


من فترة طويلة ونحن نحلم بأن نلعب الالعاب الكبيرة على هواتفنا وبشكل مباشر ولكن لم يعد حلم بعد اليوم !!
تطبيق Vortex cloud game يتيح لك الوصول الى العديد من الالعاب ولعبها بشكل مباشر ، التطبيق جديد وستجد العديد من الالعاب الجميلة وسيتم اضافة العاب اخرى خلال الايام والاشهر القادمة ، تابع الشرح في الفيديو..


(روابط التحميل في أسفل التدوينة)


قائمة الألعاب المتوفرة (هنا)
تحميل التطبيق (هنا)
الموقع الرسمي(هنا)


الاثنين، 24 أبريل 2017

تطبيق بديل اليوتيوب لتشغيل المقاطع في الخلفية


الجميع يبحث عن الطريقة المثلى لمشاهدة مقاطع الفيديو او الاستماع الى الموسيقى أثناء العمل على الهاتف في وقت واحد ، وهناك العديد من الطرق لهذا الأمر واليوم سأضع تطبيق OG Youtube بين أيديكم.

يعتبر هذا التطبيق من افضل التطبيقات بديلة اليوتيوب الرسمي والذي يأتي بواجهة مشابهة لواجهة اليوتيوب الرسمي بشكل كبير ويعطيك الصلاحية لتسجيل الدخول بحسابك المستخدم في اليوتيوب الرسمي ويتيح لك العديد من الميزات أهمها حفظ الفيديو على جهازك بعدة جودات أو حفظه كمقطع صوتي فقط بطريقة مباشرة  ، وأيضا تستطيع تشغيل مقطع الفيديو ومشاهدته أثناء العمل على تطبيق أخر وإن كنت تريد الاستماع فقط الى المقطع الصوتي من دون تحميله كل ما عليك فعله هو تشغيل المقطع وإغلاق الشاشة.

الروابط تجدها في الاسفل ، اولا قم بتحميل microG ومن ثم تحميل OG Youtube (التطبيق لاجهزة الاندرويد فقط).

microG
تطبيق OG YOUTUBE

الاثنين، 3 أبريل 2017

تحميل الفيديوهات من Netflix لمستخدمين ويندوز 10


من منا لا يعرف شبكة Netflix لمشاهدة الأفلام والمسلسلات والبرامج الوثائقية وكما يعلم مستخدميع على أجهزة الاندرويد و IOS أنه بإمكانه تحميل الفيديوهات لمشاهدتها بوضع الأوفلاين ، والان أصبح مستخدمين الويندوز 10 بإستطاعتهم تحميل الفيديوهات ومشاهدتها بوضع الاوفلاين ايضا.

وقد قالت نيتفليكس بأن المستخدمين قد يحتاجون مشاهدة الافلام أو المسلسلات والبرامج عندما لا يتوفر لديهم الانترنت لذلك تم توفير تحميل الفيديوهات ، واذا كنت تستخدم ويندوز 10 يجب عليك تحميل تطبيق نيتفليكس من متجر الويندوز لتستطيع تحميل ما تريده أو اذا كنت تستعمله من قبل فكل ما عليك هو تحديث التطبيق فقط.

جوجل تضيف لعبة Pacman لخرائطها


تطرقنا في موضوع سابق أن جوجل سترسل تحديث جديد لإضافة عدة ميزات جديدة كمشاركة الموقع مع أصدقائك وكما نعلم أن مشاركة الموقع موجودة في عدة تطبيقات مثل الواتس اب ، ولكن لعبة Pacman لن تجدها سوى بخرائط جوجل.

أرسلت جوجل تحديث جديد لتطبيق الخرائط الخاص بها وتم إضافة لعبة Pacman الشهيرة ، كل ما عليك فعله للإستمتاع باللعبة هو التأكد من وجود أخر تحديث من Google Maps وستجد اسفل يمين الشاشة ايقونة اللعبة.

google maps pacman

google maps pacman

المقال السابق المقال التالي