Рет қаралды 61,174
All FREE courses - automationstepbystep.com/
QUIZ - forms.gle/MJFQSFU6bkFP8Ter9
Cypress with JavaScript
Cypress with TypeScript
Assertions
Page Object Model
App Actions
Grouping Tests
In Next Part
CLI
Package.json
File Handling
(Read, Write, Upload, Download)
Reporting
Cypress with JavaScript
Cypress with TypeScript
Cypress tests run with JavaScript, so you can use JavaScript or any language that transpiles down to javascript like TypeScript
Cypress with TypeScript
• Cypress Beginner Tutor...
TypeScript
• TypeScript for Beginners
Assertions in Cypress
Implicit Assertions - in-built assertions
Command in cypress like should() check for the expected condition without having to use any assert or expect command separately
Explicit Assertions - not in-built or referred
Have to use specific assertion commands like assert() or expect()
What is Page Object Model
a design principle
keep the objects & methods separate from test script
efficient reusability
easier, efficient and faster changes & maintenance
Step 1 : Create a login test
Step 2 : Create a file and add a class for the page
export class LoginPage{
}
Step 3 : Add objects and functions in the class
Step 4 : Import the class in the test spec
import {LoginPage} from "../pages/login_page"
Step 5 : Create object of the class
const loginPage = new LoginPage()
Step 6 : call the class functions
loginPage.enterUsername('test')
App Actions
What are App Actions
How is it different from Page Objects
Shortcuts in app
provide users with quick ways to navigate to specific activities in app
change the state of your app without user interactions (GUI)
How to Group tests in Cypress
Step 1 : In the test file add 2 it blocks for login test and run
Step 2 : Have a login test with valid and invalid credentials
Step 3 : Group all tests (it blocks) in a describe block
describe()
.only
.skip
beforeEach block
within describe - Runs before each test in that describe group
outside describe - Runs before each test in that spec file
____________________________________________________________
Stories by Raghav - automationstepbystep.com/stor...
My Udemy Courses - automationstepbystep.com/udem...
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.
Ask Raghav - bit.ly/2CoJGWf
Interviews - bit.ly/2NIPPxk
All Playlists - bit.ly/2LSiezA
---------- Connect with Raghav -----------
Udemy Courses - www.udemy.com/user/raghav-pal-3/
Twitter - / learnwithraghav
KZbin - / automationstepbystep
Never Stop Learning
Raghav