Рет қаралды 6,515
00:00 TOPICS
What is TestCafe
Features
Prerequisites & project setup
How to write 1st Test
Step by Step DEMO
00:36 What is TestCafe
Automation testing framework for web applications
Free and Open Source
Supports Windows, Mac , Linux OS
Easy setup
Can be used with multiple browsers
Runs on Node.js
Tests can be created with JavaScript or TypeScript, CoffeeScript
01:39 Features of TestCafe
Test Recording
Parallel runs on multiple browsers
Local and remote runs
Automatic page load wait time
Page object model support
CI/CD Integrations
TestCafe Studio
All Free Tutorials 🟢 AutomationStepByStep.com/
03:27 TestCafe - Prerequisites & Project Setup
03:43 Step 1 - Check if node.js is installed
node --version
npm --version
04:22 Step 2 - Install Node.js nodejs.org
06:24 Step 3 - Create a new folder and open in IDE (like VS Code)
09:45 Step 4 - Open terminal in VS Code and run command
npm init -y check package.json file created
12:28 Step 5 - Install TestCafe npm install testcafe --save-dev
check package.json file updated
14:27 TestCafe - Write 1st Test
14:33 Step 1 - Create a new folder for tests and create a file test1.js
16:41 Step 2 - Create a fixture and test section
fixture('Getting Started')
.page('google.com');
test('1st test', async t => {
// Test code goes here
});
test('2nd test', async t => {
// Test code goes here
});
TestCafe test files consist of fixtures and tests
A fixture is a groups of tests that share the same starting URL
fixture is a keyword
page is method to set the starting URL of the fixture
20:27 Step 3 - Add steps to the test
test('1st test', async t => {
// Test code goes here
await t.typeText('#APjFqb', 'Learning TestCafe')
await t.click('.gNO89b')
await t.wait(2000)
})
24:16 Step 4 - Run test
testcafe chrome .\tests\test1.js
Tips
26:26 Tip 1. In a test we can chain multiple actions together
test('1st test', async t => {
// Test code goes here
await t
.typeText('#APjFqb', 'Learning TestCafe')
.click('.gNO89b')
.wait(2000)
})
27:07 Tip 2. Enable live mode to reload tests as you edit them
testcafe chrome .\tests\test1.js --live
Console Shortcuts in Live Mode
Ctrl+S stops the current test run
Ctrl+R restarts the current test run
Ctrl+W turns the file watcher off and on
Ctrl+C closes open browsers and terminates the process
TestCafe QUIZ - forms.gle/n8x9rycduCzAFwGQA
▬▬▬▬▬▬▬
Every Like & Subscription gives me great motivation to keep working for you
You can support my mission for education by sharing this knowledge and helping as many people as you can
If my work has helped you, consider helping any animal near you, in any way you can
Never Stop Learning
Raghav Pal
Learn how to set up TestCafe for automated testing
Learn how to get started with TestCafe, a powerful JavaScript testing framework, in this beginner-friendly tutorial
Web testing essentials with TestCafe for newcomers.
A step-by-step journey into TestCafe for new testers
▬▬▬▬ USEFUL LINKS ▬▬▬▬
Ask Raghav - bit.ly/2CoJGWf
Shorts Eng - bit.ly/3H9bifV
Shorts Hindi - bit.ly/3XY7XqN
GitHub Repositories - github.com/Raghav-Pal
Udemy - automationstepbystep.com/udem...
Stories - automationstepbystep.com/stor...
▬▬ IDE ▬▬
Eclipse - bit.ly/3AnRhQP
IntelliJ IDEA - bit.ly/3AnyDZ8
Visual Studio Code - bit.ly/2V15yvt
QnA Friday - bit.ly/2NgwGpw
Sunday Special - bit.ly/2wB23BO
-