3

I need to perform smoke-test of my AngularJS application on Unix, from terminal. I tried accessing application from

  • links2
  • links
  • w3m
  • elinks
  • lynx

All above-mentioned browsers show empty screen. In most of them I am able to view source using \ (backslash), so I could do basic verification if application server works properly at least.

Is there any unix text browser with javascript support? I am not looking for complete support (so application would be usable). It would be great to have ability just to view some elements of the page

2 Answers 2

4

Try to install libmozjs (on debian/ubuntu aptitude install libmozjs185-dev), then (don't forget to do a sudo ldconfig first) compile from the source elinks.

wget http://elinks.or.cz/download/elinks-current-0.13.tar.bz2
tar xjvf elinks-current-0.13.tar.bz2
cd elinks-0.13*
./configure
make -j8
sudo make install

Check after ./configure if ECMAScript is flagged SpiderMonkey document scripting.

p.s. Ubuntu 14.04 here.

Sign up to request clarification or add additional context in comments.

1 Comment

You will need to install libmozjs185-dev pkg-config as explained there : link
2

I guess the best way to do it would be with a headless browser such as PhantomJS http://phantomjs.org/. It has a programmable interface, so you can run a simple JS script to open your webpage, and do a simple check.

Or, you can write a more complete test using Protractor https://github.com/angular/protractor. It will give you a nice API to write tests targeting Selenium Webdriver http://www.seleniumhq.org/projects/webdriver/, that can target many browsers, including PhantomJS.

If you do a lot of AngularJS development you should take a look a Protractor anyway.

1 Comment

google chrome headless browser is launched already which has way better JS support then phantomjs developers.google.com/web/updates/2017/04/headless-chrome

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.