I have a play 2 framework app runnning in heroku. How do I add phantomjs support to the play 2 app?
I know a builspack exists for heroku for phantomjs. How do I specifically add this to my existing play 2 app?
Not sure if it is the only way, but it works for us
install phantomjs in your machine
in your build.sbt libraryDependencies add "com.github.detro.ghostdriver" % "phantomjsdriver" % "1.1.0" % "test",
in your test WithBrowser(webDriver = classOf[org.openqa.selenium.phantomjs.PhantomJSDriver])
Related
I am a newbie in Heroku-18
my buildpacks:
https://github.com/mcollina/heroku-buildpack-graphicsmagick
https://github.com/royalgarter/heroku-buildpack-phantomjs-2.0
https://github.com/heroku/heroku-buildpack-apt
heroku/nodejs
https://github.com/heroku/heroku-buildpack-google-chrome
heroku: 18
puppeteer: 1.8.0
project: Node JS
All worked fine for me but I need chrome headless = false
I changed https://github.com/heroku/heroku-buildpack-google-chrome to "https://github.com/royalgarter/heroku-buildpack-xvfb-google-chrome" then error: libcairo-gobject.so.2: cannot open shared object file: No such file or directory
I need another buidpack or a another way to launch Chrome with headless = false.
Thank for help!
I am using the MeanJS (https://github.com/meanjs/mean) framework, running on Heroku. When I try to run the application I get errors like:
Error: Cannot find module 'eslint-config-airbnb/legacy'
I am running in production mode (NODE_ENV=production).
The question I have is, it seems like gulpfile.js (when running the task prod) calls the task lint which calls the task eslint. But when I look at the packages.json file, I see that eslint-config-airbnb is only included in the devDependancies (and not dependancies). Now I tired to add it to dependancies, but I still get the same error about the missing module.
I'm new to MEAN.js, so I appreciate any help.
I use leaflet to show a map with some markers in my Rails 4 application.
In development environement, everything is ok. But when I deploy on heroku, the map is displayed but not the markers.
When I checked the errors in the browser, I've noticed the following:
Error: Couldn't autodetect L.Icon.Default.imagePath, set it manually.
What I understand is that the framework could not locate the icon image. So I downloaded the last version of leaflet from their site and moved files to vendor/assets/javascripts/leaflet and vendor/assets/stylesheets/leaflet and vendor/assets/images/leaflet.
I have config.assets.initialize_on_precompile = false in my configuration file:
# config/application.rb
config.assets.initialize_on_precompile = false
I run:
$> rake assets:precompile RAILS_ENV=staging
Then I deploy to my staging environment hosted by heroku.
Do you have any idea? Thank you,
You can also just set it manually:
L.Icon.Default.imagePath = 'path-to-your-leaflet-images-folder';
Updating leaflet from 0.6.2 to 0.6.4 solved the problem.
# Gemfile
...
gem 'leaflet-rails', '>=0.6.4'
...
We are currently working on an web application testing using Selenium-Webdriver with Ruby. Originally we only test the OSX platform, until recently we realize that Windows platform should also be tested, (IE, Firefox, Chrome, Opera). But those following lines code that work well on OSX fails on Windows(7 & 8).
I want to upload a zip file from relative directory on Windows, like "./assets/application/www.zip"
#driver.execute_script("arguments[0].style.visibility = 'visible'; arguments[0].style.width = '1px';arguments[0].style.height = '1px';arguments[0].style.opacity = 1",upload_a_zip_btn)
upload_a_zip_btn.send_keys (File.expand_path("../../assets/application/www.zip",__FILE__)) # 1
upload_a_zip_btn.send_keys ("assets\/application\/www.zip") # 2
upload_a_zip_btn.send_keys "C:\\www.zip" # 3
I tried all the 3 conditions, but only the 3rd works.
The error appeared in Browser said some error like "no attached file"
Does anyone know how to deal with such situation? Thanks
Running yeoman server:test opens Jasmine in my browser and says that my test has passed. Now I want to try the same, but without a browser - using PhantomJS on the CLI. Unfortunately, running yeoman test only throws a:
Running "jasmine:all" (jasmine) task
Running specs for index.html
>> 0 assertions passed in 0 specs (0ms)
Why doesn't it find any tests, even though everything is included in my test/index.html and works pretty well using yeoman server:test?
I used yeoman init jasmine:app --force over my project and adjusted the Gruntfile.js as described here. It looks like that:
...
// headless testing through PhantomJS
jasmine: {
all: ["test/**/*.html"]
},
...
// Alias the `test` task to run the `jasmine` task instead
grunt.registerTask("test", "jasmine");
...
Note: My tests are written in CoffeeScript.
After some research I found out that PhantomJS is not able to find the files at the same location as ´yeoman server´ or yeoman server:test does.
I precised my question in another thread: Running tests in both headless and browser