Where can I put the browser.ignoreSynchronization in my config file of protractor? - protractor

How and where can I put the browser.ignoreSynchronization=true; in the config file of protractor?

Related

TYPO3 Form Multicheckbox Partial

I tried to edit the core file form\Resources\Private\Frontend\Partials\Field\Field.html to change the html output in the frontend. If I change that file, it has not effetcs. If I change the core file form\Resources\Private\Frontend\Partials\Textarea.html it effects the output in the frontend.
I've tried to set a custom partial, layout and templates folder like this:
I've set the following in the setup part of the page template:
plugin.tx_form {
settings {
yamlConfigurations {
# register your own additional configuration
# choose a number higher than 30 (below is reserved)
100 = fileadmin/my_site_package/Configuration/Form/CustomFormSetup.yaml
}
}
}
In fileadmin/my_site_package/Configuration/Form/CustomFormSetup.yaml I have
TYPO3:
CMS:
Form:
prototypes:
standard:
formElementsDefinition:
Form:
renderingOptions:
templateRootPaths:
20:'fileadmin/my_site_package/Resources/Private/Templates/Form/Frontend/'
partialRootPaths:
20: 'fileadmin/my_site_package/Resources/Private/Partials/Form/Frontend/'
In the folder fileadmin/my_site_package/Resources/Private/Partials/Form/Frontend/ I have the copied Multicheckbox.html and the other copied partial files from the form core folder. I have edited the Multicheckbox.html, but it has not effects to the frontend.
Thank you so much for your input. The problem was because of the bootstrap package. There was a file Multicheckbox.html in the folder "typo3conf/ext/bootstrap_package/Resources/Private/Partials/Form". This one overrided the core file Multicheckbox.html
But what am I doing wrong in my steps? I'm getting now the following error in the frontend:
Oops, an error occurred!
Tried resolving a template file for controller action "FormFrontend->form" in format ".html", but none of the paths contained the expected template file (FormFrontend/Form.html). No paths configured.
More information regarding this error might be available online.
Did I set the paths in CustomFormSetup.yaml wrong?
I've also tried
TYPO3:
CMS:
Form:
prototypes:
standard:
formElementsDefinition:
Form:
renderingOptions:
templateRootPaths:
1:'/my_site_package/Resources/Private/Templates/Form/Frontend/'
partialRootPaths:
1:'/my_site_package/Resources/Private/Partials/Form/Frontend/'
with the same error.

Login is not being called before each test case i.e it() when written inside Onprepare() in config.js

I am new to Protractor and implemented login functionality inside conf.js.
var env = require('./environment.js');
// This is the configuration file showing how a suite of tests might
// handle log-in using the onPrepare field.
exports.config = {
seleniumAddress: env.seleniumAddress,
framework: 'jasmine',
specs: [
'login/login_spec.js'
],
capabilities: env.capabilities,
baseUrl: env.baseUrl + '/ng1/',
onPrepare: function() {
browser.driver.get(env.baseUrl + '/ng1/login.html');
browser.driver.findElement(by.id('username')).sendKeys('Jane');
browser.driver.findElement(by.id('password')).sendKeys('1234');
browser.driver.findElement(by.id('clickme')).click();
// Login takes some time, so wait until it's done.
// For the test app's login, we know it's done when it redirects to
// index.html.
return browser.driver.wait(function() {
return browser.driver.getCurrentUrl().then(function(url) {
return /index/.test(url);
});
}, 10000);
}
};
But this executes only before any of test case execution starts, as per details of the link for login functionality it should work before each it(,) block.
"Another option is to put your log-in code into an onPrepare function, which will be run once before any of your tests".
So is this OnPrepare intended for execution only once,which is before any of Test case[it()] starts?
There are several functions that can be used before it() and before test suites
onPrepare()
Part of your conf.js file
Runs at before a spec file is called, only running once per test, but will run on all test
beforeAll()
Part of a spec.js file
Runs at the beginning of a test, but will only execute on the spec file it is written in
beforeEach()
Part of a spec.js file
Runs before every it() block, and will only execute on it()s within the spec file
afterAll()
Part of spec.js file
Runs at the end of test, only execute inside spec file
afterEach()
Part of spec.js file
Runs after every it() block, and will only run after its in spec file
If you need your login to happen before every it() block then beforeEach() is your best solution, while if you only need to login once per spec file, then beforeAll() will work on a per test basis, while onPrepare() will work on a global basis

Override favicon.ico with addon in hybris

How can I override the favicon.ico in the Hybris using an addon?
I tried to overwrite the property img.favIcon but it doesn't work
As favicon.ico is rendered through master.tag of the storefront, so it would better you directly change it in the storefront itself, otherwise, you need to create master.tag file in your addon and also need to override all its references so it starts pointing to your addon master.tag file.
Simplest
Just override OOTB favicon.ico with your favicon.ico in the storefront. It's done.
Using javascript (Not recommended)
Copy your favicon.ico at the below-mentioned path in your addon (e.g myaddon)
/myaddon/acceleratoraddon/web/webroot/_ui/responsive/common/images/favicon.ico
Add below javascript in your addon js file (e.g. myaddon.js)
(function() {
var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
link.type = 'image/x-icon';
link.rel = 'shortcut icon';
link.href = 'https://www.yoursite.com/_ui/addons/myaddon/responsive/common/images/favicon.ico';
document.getElementsByTagName('head')[0].appendChild(link);
})();
Build and start the server
ant all && hybrisserver.bat start
I found the solution I copied the Theme.properties to the addons and changed the path

How to change the config file for MathJax in doxygen?

I am using doxygen 1.8.9.1 and want to use AsciiMath in the hmtl output. It requires me to use a new config file, i.e. http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=AM_HTMLorMML. However, the configuration "MATHJAX_RELPATH" can only set the root path of mathjax.
How could I change the config to mathjax? Thanks for any suggestions.
EDIT:
I have tried to use MATHJAX_CODEFILE to change the config file "config: ["local/local.js","MMLtoHTML.js"]", but don't work for me. The URL should be modified, not just the configuration files. (i.e. MathJax.js?config=AM_HTMLorMML).
BTW: The render html should be change from \[sum_(i=1)^n i^3=((n*(n+1))/2)^2\] to `sum_(i=1)^n i^3=((n*(n+1))/2)^2`.
One solution is to modify MATHJAX section of footer.html in the Doxygen folder.
For example, use this to modify the url to MathJax.js?config=local/local.js
<!-- BEGIN MATHJAX-->
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="../mathjax/MathJax.js?config=local/local.js"></script>
<!-- END MATHJAX-->
The $mathjax line of header.html should also be deleted.

sails.js Is it possible to set process.env variables from application?

I am trying to use npm module fb to use facebook api. The config file is located in the module and here is the snapshot of the same
var config = { };
// should end in /
config.rootUrl = process.env.ROOT_URL || 'http://localhost:3000/';
config.facebook = {
appId: process.env.FACEBOOK_APPID || '130243393813697',
appSecret: process.env.FACEBOOK_APPSECRET || 'c82696768ae4ad8b63db874cb64eb558',
appNamespace: process.env.FACEBOOK_APPNAMESPACE || 'nodescrumptious',
redirectUri: process.env.FACEBOOK_REDIRECTURI || config.rootUrl + 'login/callback'
};
module.exports = config;
I don't wish to change the config file of the module since node_modules folder is kept in the gitignore list. For configuring the module to use my app's appId and appSecret, I need to set the process.env variables FACEBOOK_APPID and FACEBOOK_APPSECRET
I understand that it can be done while calling the sails lift but is it by any means possible to set these values inside the app so that I only have to call
sails lift
without any of those variables and those should be set automatically ? Or what is the best way to achieve what I am trying to do here ?
You should set the environment-variables outside of your App.
Instead of sails lift you could also use node app.js. With that you can define environment-variables for your node-application with:
$> FOO='bar' node app.js
In your case:
$> FACEBOOK_APPID='232322a22' FACEBOOK_APPSECRET='mysecrete' node app.js
If you want to set this vars in your app (I wouldn't suggest that!) you could set them before including your npm-module. For example in your config/bootstrap.js:
module.exports.bootstrap = function(cb) {
process.env.FACEBOOK_APPID = "myvar";
process.env.FACEBOOK_APPSECRET = "mysecrete";
sails.facebook = require("yourmodule");
cb();
};
Here is a good link for setting environment variables when "Production", "Staging" and "Development" in Sails feels fragmented.
Here is a quick video tutorial which simply explains how to create environment variables in node.js
Step1:
Install the package dotenv as dependency
$ npm install dotenv --save
Step2:
Then require dotenv in app.js and load the .env file
var dotenv = require('dotenv');
dotenv.load();
Step3:
Create a .env file in the root folder (ie. at the same document level as app.js file)
Step4:
Add your environment variables
S3_KEY=enfiownqefniqofewqofnieqwvewlk
S3_SECRET=123456789
Now you can access those environment variables anywhere in the app (probably in some config/ files):
return {
key: process.env.S3_KEY,
secret: process.env.S3_SECRET,
region: 's3-eu-west-1',
bucket: 'myBucket',
s3params: {
ACL: 'public-read'
}
}
Credit goes to Noah Bass for providing this tutorial.