简体   繁体   中英

Can I test a dynamic html view using javascript in the chrome console?

Let's say I'm testing an angular app but it's way too time-consuming for me to learn the codebase and write code for it. I'm purely testing the view. Is it possible to use javascript in the chrome console to test the view?

Like if I want to test whether or not clicking on a button renders a view with a certain element with class 'class1', can I do this?

$(".class").click();
if ($(".class1") != null){console.log("class 1 is here!")};
history.back();

Is there any standardized way to do this?

You're describing either an end-to-end test (or integration test). You can do that using a framework like protractor: https://angular.github.io/protractor/#/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM