Lesson 1 / الدرس 1
What automation is actually for / ما الغرض الحقيقي من الأتمتة
Automated tests do not find bugs. They notice when something that used to work has stopped working — which is a narrower job than most people expect, and the reason automation frees a tester rather than replacing one.
الاختبارات الآلية لا تجد الأخطاء. بل تلاحظ حين يتوقف عن العمل شيء كان يعمل — وهذه مهمة أضيق مما يتوقعه معظم الناس، وهي سبب كون الأتمتة تحرّر المختبِر لا تستبدله.
An automated test can only check something a person already thought of, wrote down and proved once by hand. It has no curiosity. It will run the same forty steps ten thousand times without noticing that the page is now bright green, that the Arabic reads backwards, or that the button it clicked has moved somewhere absurd — because nobody told it to look.
What it is genuinely good at
-
Regression. The forty things that must still work after every change, checked in four minutes instead of a day. This is the whole reason automation exists. الانحدار. الأربعون شيئًا التي يجب أن تظل تعمل بعد كل تغيير، تُفحص في أربع دقائق بدل يوم. وهذا هو سبب وجود الأتمتة كله.
-
Repetition without fatigue. A person checking the same form for the ninth time stops seeing it. A machine does not get bored, and does not skip step 6 because step 6 has never failed. التكرار بلا كلل. فمن يفحص النموذج نفسه للمرة التاسعة يكفّ عن رؤيته. أما الآلة فلا تملّ، ولا تتخطى الخطوة السادسة لأن السادسة لم ترسب قط.
-
Scale a person cannot reach. The same test on six browsers, or a thousand rows of data, or every night at three in the morning. حجم لا يبلغه إنسان. الاختبار نفسه على ستة متصفحات، أو على ألف صف من البيانات، أو كل ليلة في الثالثة فجرًا.
-
Telling you fast. A test that fails eleven minutes after the code was written is a small correction; the same failure found three weeks later is an archaeology project. الإخبار السريع. فالاختبار الذي يرسب بعد إحدى عشرة دقيقة من كتابة الكود تصحيح صغير؛ والرسوب نفسه بعد ثلاثة أسابيع مشروع تنقيب أثري.
It buys time, and the time is the point
The value of automation is not the bugs it catches — it catches very few, and they are usually ones you already knew were possible. The value is the day it gives back. A tester who no longer spends every release re-checking the same forty paths by hand can spend that release exploring the new feature, which is where the bugs actually are. Automation is a machine for converting boring work into time for interesting work.
// The same check, twice.
//
// By hand, before every release: open the page, type a wrong password,
// read the message, check you are still on the sign-in page. Ninety seconds,
// and you must not be distracted.
test('wrong password is refused', async ({ page }) => {
await page.goto('/sign-in');
await page.getByLabel('Email').fill('sara@example.com');
await page.getByLabel('Password').fill('totallywrong');
await page.getByRole('button', { name: 'Sign in' }).click();
await expect(page).toHaveURL(/sign-in/);
await expect(page.getByText('Email or password is incorrect')).toBeVisible();
});
Check yourself / اختبر نفسك
1. What are automated tests genuinely best at?
A test only checks what someone wrote into it, so it cannot find the unanticipated. What it does perfectly is repeat a known check forever without getting bored — which is exactly what regression needs.
2. Why should you run a test by hand before automating it?
A test that always passes looks identical to a test that checks nothing. Proving you can make it fail is the only way to know the assertion has teeth — and a green test with no teeth is worse than no test, because it is trusted.
3. A team's pipeline is green, so they stop exploratory testing. What have they lost?
Green means the questions somebody wrote down still have the same answers. It says nothing about questions nobody asked, and those are where new bugs live — which is precisely the ground exploration covers.
Score / النتيجة: 0 / 3