Running codecept using jenkins - codeceptjs

Can we change helper configuration options on the fly from a test? I saw the Dynamic configuration settings, gave the below command
npx codeceptjs run --override '{ "helpers": {"Protractor": {"browser": "firefox"}}}'
but when i run at i get the below error
undefined:1
{helpers:
^
SyntaxError: Unexpected token h in JSON at position 1
at JSON.parse (<anonymous>)
at Command.module.exports (D:\Finlevit_Codecept_Cucumber\node_modules\codeceptjs\lib\command\run.js:21:33)
at Command.listener (D:\Finlevit_Codecept_Cucumber\node_modules\commander\index.js:315:8)
at Command.emit (events.js:311:20)
at Command.parseArgs (D:\Finlevit_Codecept_Cucumber\node_modules\commander\index.js:651:12)
at Command.parse (D:\Finlevit_Codecept_Cucumber\node_modules\commander\index.js:474:21)
at Object.<anonymous> (D:\Finlevit_Codecept_Cucumber\node_modules\codeceptjs\bin\codecept.js:228:9)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
Can someone help me?

Looks like you use Windows with CMD tool.
That tool works with strings in double quotes. Don't forget to escape JSON double quotes with \"
npx codeceptjs run --override "{ \"helpers\": {\"Protractor\": {\"browser\": \"firefox\"}}}"
Or you can try shell/linux builder.

Related

Xcode Import Localizations failed

We use the 'Export Localizations...' and 'Import Localizations...' tool of Xcode for localization in our project and it works well on Xcode 12.4. But after we upgrade Xcode to 12.5.0, errors raised with the same 'xliff' file, with message:Localizable.strings: Missing ';' on line 1028, Check the strings file with plutil or/and check_strings and fix the syntax error.
We do something below:
check all string files find ./ -name '*.strings' -exec plutil -lint {} \; but no errors found
run command line tool xcodebuild -importLocalizations -localizationPath xxx.xliff -project Project.xcodeproj, and we find some error like this genstrings: error: bad entry in file .../xxx.m (line = 603): Argument is not a literal string., so we fix all the error raised by NSLocalizedString and NSLocalizedStringFromTableInBundle.
but the import is still not working with error 2021-08-05 09:36:17.801 xcodebuild[29848:4770072] CFPropertyListCreateFromXMLData(): Old-style plist parser: missing semicolon in dictionary on line 1028. Parsing will be abandoned. Break on _CFPropertyListMissingSemicolon to debug. xcodebuild: error: Localizable.strings: Missing ';' on line 1028
If anyone can shed a light it would be wonderful.

syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE)

I am using laravel5.0 on centos 6.9, when I try to run php artisan migarate , getting error PHP Parse error:
syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /root/.local/share/Trash/files/keystone_laravel.2/laravel/artisan on line 3
please anyone help
Change the version of your php for L5.0 you need to install a
PHP >= 5.4, PHP < 7
https://laravel.com/docs/5.0
I'm using Laravel5.4 and CentOS7.4, and PHP5.4 pre-installed into the system, but I installed php7.0 manually by source-code without link it to /usr/bin so when I run php artisan schedule:run, it actually run the command with php5.4, and of course I get the same error. So I link php7.0 to /usr/bin to make it as default php, then I fixed it.

Unable to run command line for iOS UI Automation

I used the template from this website: http://blog.manbolo.com/2012/04/08/ios-automated-tests-with-uiautomation and created my own command line to run the automation test on terminal.
Here are some useful information about my script:
I'm using xCode 6.4.
I ran this automation script in Xcode instrument and it works fine.
Here is my command line:
instruments -w 927b666816e2d4377b208a872b42a1d3xxxxxxxx -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate ConsumeriOS -e UIASCRIPT/Users/wendywang/Documents/TIO/ConsumeriOS/ConsumeriOS/ConsumeriOSTests/automationScript/LogIn.js
But I received this error:
2015-10-05 14:16:34.122 instruments[23330:551118] WebKit Threading Violation - initial use of WebKit from a secondary thread. Instruments Usage Error : Failed to resolve target for Instrument 'Automation' instruments, version 6.4 (57082) usage: instruments [-t template] [-D document] [-l timeLimit] [-i #] [-w device] [[-p pid] | [application [-e variable value] [argument ...]]] tio-spare:~ wendywang$ ConsumeriOS -e UIASCRIPT /Users/wendywang/Documents/xxx/ConsumeriOS/ConsumeriOS/ConsumeriOSTests/automationScript/LogIn.js -bash: ConsumeriOS: command not found
I double checked that
The UDID is correct
The automation trace template is in the correct path
The LogIn.js file is in the correct path
One thing I am not sure:
The ConsumeriOS is the name of the code. But inside the code, it can actually produce a few apps. I am testing the app called Consumer. So I am not sure if I should write ConsumeriOS as the name of the app, or Consumer instead.
Does anyone know why it is generating this error? Thanks!
Huhu,
try this:
Give the
complete path to the app with the .app extension,
Put the DeviceID and the script into "",
try it with the device name, if it doesn't
work.
Here a sample that works for me.
instruments -w "DeviceID" -t PATHTOTEMPLATE/Automation.tracetemplate PATHTOAPP/ConsumeriOS.app -e UIASCRIPT "PATHTOSCRIPT/UITest.js"
Let me know!
The relevant message is this one:
tio-spare:~ wendywang$ ConsumeriOS -e UIASCRIPT /Users/wendywang/Documents/xxx/ConsumeriOS/ConsumeriOS/ConsumeriOSTests/automationScript/LogIn.js -bash: ConsumeriOS: command not found
It appears that you may have copy-pasted this command:
instruments -w 927b666816e2d4377b208a872b42a1d3xxxxxxxx -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate ConsumeriOS -e UIASCRIPT/Users/wendywang/Documents/TIO/ConsumeriOS/ConsumeriOS/ConsumeriOSTests/automationScript/LogIn.js
But incorrectly -- in two separate pieces, part 1:
instruments -w 927b666816e2d4377b208a872b42a1d3xxxxxxxx -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate
And part 2 (separated by a newline):
ConsumeriOS -e UIASCRIPT/Users/wendywang/Documents/TIO/ConsumeriOS/ConsumeriOS/ConsumeriOSTests/automationScript/LogIn.js
Separately, it looks like you wrote the name of your app (ConsumeriOS) instead of the full path to your app (/path/to/ConsumeriOS.app).

topojson-svg : how to make it works?

Tweet: Mike Bostock recently tweeted:
If you like making maps in Illustrator, TopoJSON 1.6.9 supports conversion to SVG. No code
required! https://github.com/mbostock/topojson/blob/master/bin/topojson-svg
——Mike Bostock (#mbostock) 30 Avril 2014
Cool !
Topojson version: on my terminal, I checked the version...
$topojson --version
>1.6.11
$node --version
>v0.10.25
Seems good.
Topojson-svg trial: so I gave it a shoot...
curl -o uk.topo.json 'http://bost.ocks.org/mike/map/uk.json' #get an online topoJSON file
topojson-svg -o output.svg uk.topo.json #this fails
Error: I get a corrupt .svg file together with this ugly error message
fs.js:393
binding.close(fd, makeCallback(callback));
^
TypeError: Bad argument
at Object.fs.close (fs.js:393:11)
at Object.<anonymous> (/home/yug/local/lib/node_modules/topojson/bin/topojson-svg:85:32)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:902:3
Question: How to process to successfully use topojson-svg ?
Edit: also occured with recently installed local (non-global) /node_module :
npm install topojson #locally install topojson.js & topojson-svg
curl -o uk.topo.json 'http://bost.ocks.org/mike/map/uk.json' #get an online topoJSON file
node_modules/.bin/topojson-svg -o output.svg uk.topo.json #this fails
Fixed on github within 4minutes after reporting the issue.
Will be available within hours/days on npm, with topojson v.1.6.12+

Deploy hook syntax error

Trying to give permissions to /public/uploads with deploy hook, during cloud66 deploy to digitalocean, to get carrierwave file uploads working.
I'm receiving the following error:
Error during deployment: Error during after_rails hook: Execution of sudo
/tmp/open_folder_permissions.sh returned a non-zero exit code. Output was:
/tmp/open_folder_permissions.sh:5: syntax error, unexpected tGVAR, expecting keyword_do or
'{' or '(' sudo chmod 0775 -R $RAILS_STACK_PATH/public/uploads ^
open_folder_permissions.sh
#! /usr/bin/env ruby
#load environment variables
source /var/.cloud66_env
#assign desired permissions
sudo chmod 0775 -R $RAILS_STACK_PATH/public/uploads
deploy_hooks.yml
production:
after_rails:
- source: /.cloud66/files/open_folder_permissions.sh
destination: /tmp/open_folder_permissions.sh
target: rails
execute: true
run_on: all_servers
apply_during: all
sudo: true
What could cause the error?
Your open_folder_permissions.sh doesn't contain valid Ruby code. From the looks of it, it's supposed to be a shell script, not a Ruby script, so you should change the shebang line to a shell interpreter instead of a Ruby interpreter.
#! bin/bash is the right interpreter.

Resources