joelgriffith / navalia

A bullet-proof, fast, and reliable headless browser API
https://joelgriffith.github.io/navalia/
GNU General Public License v3.0
957 stars 33 forks source link

What do I do after installing Navalia to execute a test script? #74

Closed davidjeddy closed 6 years ago

davidjeddy commented 6 years ago

Hello All, awesome project, so much easier to setup than PhanstomJs + CasperJs.

I am attempting to get a POC of End-to-End testing using Navalia. This is in an effort to modernize our frontend testing process. We are wanting to use Javascript style syntax as is aligns better with our projects.

screen shot 2018-03-08 at 4 58 29 pm

I get Navalia running in the terminal... screen shot 2018-03-08 at 5 01 33 pm

Then I attempt to execute the following basic test:

./test_1.js:

const { Chrome } = require('navalia');
const chrome = new Chrome();

chrome
    .goto('https://amazon.com')
    .type('input', 'Kindle')
    .click('.buy-now')
    .end()
    .then((responses) => {
    console.log(responses); // ['https://www.amazon.com/', true, true, true]
});

...but now what? How do I tell node to execute the ./test_1.js again Navalia and this get a chrome session processing the commands.

Sorry if this is super-noob, my background as a server-side engineer leaves my client side knowledgte lacking.

Thank you in advance for the assistance.


After checking the backlog of issue this is a dependant issue of https://github.com/joelgriffith/navalia/issues/72