Unable to configure Log4js in Protractor - protractor

Can anyone please suggest how to configure log4js in protractor. Unable to proper documentation with clear steps to configure. I want a log file to be created with the all the information.

You can use log4js-protractor-appender. log4js-protractor-appender overrides log4js' default console appender. Just install it as a dependency
$ npm install log4js-protractor-appender --save
Then you can load it as any file appender. For example:
{
"appenders": [
{
"type": "log4js-protractor-appender-file"
}
]
}
Then you can print log statements like below
logger.info('Navigating to /');
browser.get('/');
element(by.css('#someText')).getText().then(function (text) {
logger.info('Displayed text is: ', text);
});
logger.info('Should be displayed last');
You can refer the following thread as well
log4j-protractor-appender
Hope this helps

Related

Spawning language server with cmd`diagnostic-languageserver`failed. The language server is either not installed, missing from PATH, or not executable

enter image description here
" Spawning language server with cmd: diagnostic-languageserver failed. The language server is either not installed, missing from PATH, or not executable "
nvim problem
i copied devaslife's dotfiles and installed plugin
yesterday it work, but today i entered LSP info after that when i Enter shows that the error
I've resolved this problem by executing the below command
npm install -g diagnostic-languageserver
Use this:
yarn global add diagnostic-languageserver
Probably, it's because you have not set up the right programming language that you are using in the lspconfig.rc.vim, precisely in the nvim_lsp.tsserver.setup part.
I had the same problem because I was in javascript file (.js) and the lsp config that I was using from someone else only supports typescript files. So, I just had to add the javascript, javascriptreact and javascript.jsx. For example :
nvim_lsp.tsserver.setup {
on_attach = on_attach,
filetypes = { "typescript", "typescriptreact", "typescript.tsx", "javascript", "javascriptreact", "javascript.jsx" },
capabilities = capabilities
}
That is not working for me. In the lspconfig.re.vim, i had to delete the "javascipt", "javasriptreact", "javascript.jsx" types from the nvim_lsp.diagnosticls.setup/filetypes, and then put them in the nvim_lsp.tsserver.setup>filetypes
For windows you can use this:
nvim_lsp.tsserver.setup {
on_attach = on_attach,
filetypes = { "typescript", "typescriptreact", "typescript.tsx" },
cmd = { "typescript-language-server.cmd", "--stdio" }
}
This will make sure it will run the .cmd file that is along side the .ps1.

Issue with installing Facebook CTF

I am trying to install Facebook CTF from https://github.com/facebook/fbctf
Following the instructions, I execute ./extra/provision.sh -m prod -s $PWD
All goes well, until it gets to the section where it runs grunt. It's hitting this code in a javascript file
const proto = Object.defineProperties(() => {}, {
...styles,
level: {
enumerable: true,
get() {
return this._generator.level;
},
set(level) {
this._generator.level = level;
}
}
});
It's balking at the ellipsis in front of styles.
It's giving this error.
...styles,
^^^
SyntaxError: Unexpected token ...
Has anyone run into this error when install fbctf or can spot a Javascript error? Thanks for your help
I'm using the Quick Setup instructions and ran into a similar issue.
I resolved by it upgrading my nodejs version using npm in the instructions below.
https://phoenixnap.com/kb/update-node-js-version
Note: I did the nodejs installation on command line before running the install command.

Magento 2: setup upgrade error "We can't find the role for the user you wanted"

I got strange error while running command "php bin/magento setup:upgrade".
Error:
We can't find the role for the user you wanted...
Unable to complete my all command process.
Please help.
in my case it was caused by Shopial_Facebook (which I do not need). I ran
php bin/magento module:disable Shopial_Facebook
cleared cache and the error was gone. I hope it helps.
Solution:
Please go to file:
vendor/magento/module-authorization/Model/Acl/AclRetriever.php at line# 85 and edit below code into edit one:
Original Code:
if (!$role) {
throw new AuthorizationException(
__('We can\'t find the role for the user you wanted.')
);
}
$allowedResources = $this->getAllowedResourcesByRole($role->getId());
Edit Code:
if (!$role) {
$allowedResources = array();
}
Now, please run setup:upgrade and rest commands.
Important:
Once success, please revert back the file.
Thanks,

how do you get flow to work with babel module-alias?

I am trying to get flow to type check my code but it is giving me an error when it can't find paths that have been rewritten using babel-plugin-module-alias.
I have unsuccessfully tried to use the resolve_dirname option in the flowconfig.
Can someone please tell me if it is possible to use this babel plugin with flow?
.babelrc
{
"plugins": [
"transform-flow-strip-types",
["module-alias", [
{ "src": "./app", "expose": "app" },
]]
]
}
.flowconfig
[options]
module.system.node.resolve_dirname=app
app/main.js
import bar from 'app/foo';
app/main.js:3
3: import bar from 'app/foo';
^^^^^^^^^^ app/foo. Required module not found
module.system.node.resolve_dirname actually tells Flow where to start resolving things from. If you want Flow to resolve starting from 'app', you need to point it one directory higher than app.
Alternatively, you can probably also use `module.name_mapper='^app/([a-z-A-Z0-9$_/]+)$' -> 'src/\1'
Here is how this can be achieved with module.name_mapper setting in .flowconfig [options]. Works in flow version 0.56.0
module.name_mapper='^app/\([-a-zA-Z0-9$_/]+\)$' -> '<PROJECT_ROOT>/src/\1'

No provider for framework jasmine

when i try to start karma i am getting error below:
C:\*>karma start karma.conf.js
C:\Users\*\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:9
throw error('No provider for "' + name + '"!');
^
Error: No provider for "framework:jasmine"! (Resolving: framework:requirejs)
at error (C:\Users\*\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:22:
at Object.parent.get (C:\Users\*\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\inj
at get (C:\Users\*\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:54:19
at C:\Users\*\AppData\Roaming\npm\node_modules\karma\lib\server.js:31:14
at Array.forEach (native)
at start (C:\Users\XYZ\AppData\Roaming\npm\node_modules\karma\lib\server.js:30:21)
at invoke (C:\Users\XYZ\AppData\Roaming\npm\node_modules\karma\node_modules\di\lib\injector.js:75
at Object.exports.start (C:\Users\XYZ\AppData\Roaming\npm\node_modules\karma\lib\server.js:314:12
at Object.exports.run (C:\Users\XYZ\AppData\Roaming\npm\node_modules\karma\lib\cli.js:229:25)
at requireCliAndRun (C:\Users\*\AppData\Roaming\npm\node_modules\karma-cli\bin\karma:24:16)
I already check if i have jasmine installed :
C:\*>npm jasmine --version
1.4.28
and Karma:
C:\*>karma --version
Karma version: 0.12.31
and followed few more tutorials but can't get out of this error, can someone please help me?
Looks that you need install the dependency to jasmine. Try :
npm install karma-jasmine
Also you need to add the config karma-jasmine in your array of plugins inside your config file:
// list of karma plugins
plugins: [
'karma-chrome-launcher',
'karma-firefox-launcher',
'karma-phantomjs-launcher',
'karma-requirejs',
'karma-jasmine'
]