Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
419 views
in Technique[技术] by (71.8m points)

bdd - In cypress Is there any method to run 3 dependent forms individually?

I have 3 forms, and one form is depending on other 2 forms(Each form is in each test file), So my question is can i know is there any solution(method) to run those 3 forms individually? (The purpose is i want to run each forms individually)

This is maker form
This is maker form

This is Category form
This is Category form

This is maker type form
This is maker type form

These are the three forms which i have mentioned above. Maker form, and Category form are depending on Maker type form, (The value i'm adding in maker and Category forms as above images, will have to choose from Maker type form) So these Each three forms are in each test files. When i run the test i can not run the maker type form individually, because its' maker and category values are taken by Maker form and Category form added values.

question from:https://stackoverflow.com/questions/65661323/in-cypress-is-there-any-method-to-run-3-dependent-forms-individually

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Your tests (e2e tests) should follow the user flow, so if one form requires another to complete the task, then that's how you test them.

BUT you can test forms independently using Component Testing. In this type of test you mount just one component (form) at a time and supply input values (normally coming from the other forms) via props.

Here is some info about it My Vision for Component Tests in Cypress


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...