What is different between package.json execution and other build tools in protractor for execution?

63 Views Asked by At

I am new in Protractor Automaton also able to execute test using npm test but don't know why we are using any other build tools like gulp, karma and grunt. i don't know which one is better for script run. we have lots of test script but it's typically manage

package.json

"scripts": {
        "test": "node ./node_modules/protractor/node_modules/webdriver-manager update && protractor config/conf.js"
    },
2

There are 2 best solutions below

0
yong On BEST ANSWER

You can think gulp and grunt is a tool like maven in Java world. There are many plugins for them, like plugins for maven to help to compile, minify, copy/move files and so on.

In additionally, you can split those take into separate files to make them can be re-used.

For scripts in package.json, you can't make it complex, like if/else or more complex logic or reuse. But gulp and 'grunt' supports.

0
nodeover On

From their docs, it seems that protactor is a "end to end test for angular"

So end to end means functionals tests, it's different from unit testing because it not test class or function, it load a website & then try to inspect pages, interact with them...

Protector seems to be angular oriented only

Just for information in your package.json you can just write it:

"scripts": {
   "test": "webdriver-manager update && protractor config/conf.js"
 },