How to run botium-cli in headless mode using google chrome - automated-tests

How do I run botium-cli + botium-webdriver-connector in headless mode using chrome browser?
The webpage doesn't work with phantomjs browser
edit: Florian answer works, im running jenkins on ubuntu, also need to add --no-sanbox and --disable-dev-shm-usage option
my final config
"WEBDRIVERIO_OPTIONS": {
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"args": [ "--headless", "--no-sandbox", "--disable--dev-shm-usage" ]
}
}
}

There is a Botium sample available using Chrome in headless mode: https://github.com/codeforequity-at/botium-connector-webdriverio/blob/master/samples/botbuilderwebchat/
In botium.json, the webdriver options should be set something like this:
"WEBDRIVERIO_OPTIONS": {
"desiredCapabilities": {
"browserName": "chrome",
"chromeOptions": {
"args": [ "--headless" ]
}
}
},

Related

Add custom CSS to ExtJS App

I've been trying to add a custom CSS file to the final build from Sencha CMD on ExtJS Application. The application has been generated using the CMD.
My CSS file is located in resources/Custom/myfile.css
try to do many different approach that i found but with no success.
My app.json looks like
{
"builds": {
"production": {
"default": true,
"compressor": {
"type": "closure"
}
}
},
"name": "Test.App",
"css": [
{
"path": "resources/Custom/_body.css",
"remote": true
}
],
"requires": [
],
"id": "fb0cc613-c7e3-4e2e-9f9f-aa569fcf2465"
}
But when try to build i got the error:
BUILD FAILED
[ERR] com.sencha.exceptions.ExBuild: Combining x-compile in HTML page with Microloader in app.json is not supported
If i remove the CSS part fo the app.json it does work !!!
I am using ExtJS 4.1.1
Any Help?

Artifactory AQL download artifact

Is there a way to download an artifact using AQL?
I have a query sent with:
curl -u user:pass \
-X POST https://artifactoryURL/artifactory/api/search/aql \
-H 'content-type: text/plain' \
-T query.aql
And my query.aql:
items.find(
{
"repo":{"$eq":"repo"},
"$and": [
{
"path": { "$match": "path/*"},
"name": { "$match": "*.rpm"}
}
]
}
)
.sort({ "$desc": ["modified"] })
.limit(1)
Now that I know it returns what I want, Is there a way to change the request from api/search/aql to something like api/download/aql and get those items?
EDIT:
I had also tried doing this with the jfrog cli but they don't fully support AQL there (sort and limit didn't work).
This is the command I tried:
jfrog rt s --spec=query-aql.json
And the spec that failed to sort and limit results:
{
"files": [
{
"aql": {
"items.find": {
"repo": "repo",
"$and": [
{
"path": { "$match": "path/*"},
"name": { "$match": "*.rpm"}
}
]
}
},
"sort": {
"$asc": ["modified"]
},
"limit": 1
}
]
}
EDIT 2:
Added a jfrog-cli-go issue: https://github.com/JFrogDev/jfrog-cli-go/issues/56
An easy way to use your aql script to download files from artifactory is to use the JFrog cli as mention here : https://www.jfrog.com/confluence/display/CLI/CLI+for+JFrog+Artifactory#CLIforJFrogArtifactory-Download,CopyandMoveCommandsSpecSchema
The cli can be downloaded as an executable for linux, mac or windows and should fit your needs
With the curl command the only thing you can do is then to parse the result from your aql query and perform download request for each file.
I was just looking for a very similar thing -- use a download spec file to download the latest artifact from a given repo and path. I don't care if I use AQL or not, I just want it in the download-spec.json file. If you go to the link above look at Example 5.
Modified for your example:
{
"files": [
{
"pattern": "path/*.rpm",
"target": "my/download/path/",
"sortBy": "created",
"sortOrder": "desc",
"limit": 1,
}
]
}
jfrog cli supports --limit, --sort-order, and --sort-by arguments.
The following works for me:
jfrog rt search --spec=/tmp/jfrogfilespec.json --sort-by created --sort-order=desc --limit 1
The contents of the json spec file are:
{ "files": [ { "aql": { "items.find": { "repo":{"$eq":"my-release-repo"}, "name":{"$match":"my-artifact-prefix*"} } } } ] }
This generates the following query (according to debug mode):
items.find( { "repo":{"$eq":"my-release-repo"}, "name":{"$match":"my-artifact-prefix*"} } ).include("name","repo","path","actual_md5","actual_sha1","size","type","created").sort({"$desc":["created"]}).limit(1)
What is frustrating is that I cannot seem to find a way to use "jfrog rt search" with a filespec that allows me to influence the "include" modifier portion of the search.

Browserify, shim different libraries in different browserify builds

I am using browserify + grunt to produce two separate JS outputs, a clientside and a serverside version of my app. eg.
gruntfile.js
browserify: {
server: {
files: { 'dist/server.js': ['src/serverside.js'], }
},
client: {
files: { 'dist/client.js': ['src/clientside.js'], }
}
}
Everything works nicely and I get 2 separate files.
Now I want my clientside app to use browserify-shim to reference some common libraries from a CDN.
eg.
"browserify-shim": {
"libThing": "global:LibThing"
},
"browserify": {
"transform": [
"browserify-shim"
]
}
The issue is that this shims it for both the client and server versions, on the server this stuff doesn't exist in global.
I want to apply this shim just to the client (not the server)
I have tried
"browserify-shim": {
"server": {
}
"client": {
"libThing": "global:LibThing"
}
},
"browserify": {
"transform": [
"browserify-shim"
]
}
but I cant seem to work out how to tell browserify to use a separate set of shims for each file.

Yeoman Angular, grunt server always launches IE

Just started using Yeoman Angular generator, but when I run grunt server command, it always opens IE. Tried changes in GruntFile.js
autoprefixer: {
options: {
browsers: ['last 1 version', 'Chrome']
}
But it gives error
Any clues how to get it working?
Simply in your Gruntfile.js you can add an app parameter:
open: {
server: {
url: 'http://localhost:XXXXXXXX',
app: 'Google Chrome'
}
},
This will work.
For reference check this link https://github.com/GabLeRoux/grunt-open/commit/6f2c7069767e58160ec96aaaa8fa20ed210ba183
If you are still having problems, the following should work:
livereload: {
options: {
open: {
appName: "google-chrome"
},

Running Dalekjs Tests on Saucelabs with Grunt

what i want:
run dalekjs-tests on saucelabs with grunt
what i did:
installed grunt-dalek, dalek-driver-sauce
created grunt config:
dalek: {
options: {
driver: ['sauce'],
browser: ['chrome'],
advanced: {
"driver.sauce": {
user: "xxx",
key: "xxx"
}
}
}
}
what my problem is
Warning: Cannot read property '0' of null Use --force to continue.
finally i had some time to dig deeper into this. the error came from dalek-driver-sauce.
Function _verfiyBrowserConfig inside browser.js caused the problem.
var browser = browsers[0][browserName] || null;
in my config i was missing the browsers property.
the dalek-driver-sauce docs are kind of misleading there:
if you would like to have a more control over the browser/OS combinations that are available, you are able to configure you custom combinations
the browsers config inside advanced-config is mandatory!
a final working grunt-config looked like this:
dalek: {
options: {
driver: ['sauce'],
advanced: {
"driver.sauce": {
user: "xxx",
key: "xxx"
},
browsers: [{
chrome: {
"platform": "OS X 10.6",
"actAs": "chrome",
"version": 27
}
}]
}
},
mytest: ['test.js']
}

Resources