Hello i am using capybara test, to test app. However iframe isn't displayed with automated testing. Trying to test stripe elements, which are stored in iframe. I suspect it's something related with phanotmjs settings. Tried to add web-security option to conf
Capybara.register_driver :poltergeist do |app|
options = {
:timeout => DEFAULT_WAIT_TIME,
:debug => false,
:phantomjs_options => ['--ignore-ssl-errors=yes', '--ssl-protocol=any', '--disk-cache=false', '--load-images=no', '--web-security=false' ],
:inspector => false,
:js_errors => false
}
Capybara::Poltergeist::Driver.new(app, options)
end
anyone with some idea how to solve this, maybe with similar problem
Problem was in outdated version of capybara, try to update it, and this issue will gone, also update phantomJS
Related
Would really appreciate some help with this, have been trying to figure it out for a while.
I'm getting the below error. After some research, I figured out that you need to use "next/dynamic" with { ssr: false } to load modules dependent on window (since it's only avail in browser and not on server).
I added the below import to my app, but still getting the same error. Is there something wrong with the below and/or is there other configuration needed to make the dynamic loads function properly?
const Chart = dynamic(() => import("react-apexcharts"), { ssr: false });
Server Error
ReferenceError: window is not defined
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
Object.<anonymous>
...
UPDATE
So, it looks like I had to dynamic import the component where I was trying to use the component made with this import ... which seems redundant / i feel like I'm still doing something wrong.
So, now it's working, but I'm -
using const Chart = dynamic(() => import("react-apexcharts"), { ssr: false }); to build a component in ../barChart2.js
i'm again dynamic importing the component in barChart2.js when trying to use it (e.g., with const BarChart2 = dynamic(() => import('page-sections/charts/barChart2'), { ssr: false });
Is this actually how you are supposed to do it? Or is there a better way?
Didn't want to submit this as an answer, as I don't believe this is really the "correct" way even though it technically works.
I've recently upgraded a site to Drupal 7.59 with install profile:
Commerce Kickstart (commerce_kickstart-7.x-2.54)
Previously there was a function that had been added to the core which has now been removed because of the upgrade. This shouldn't have been added to the core and I'm not sure why it was. I've added this function back in and its not doing what it did previously so I'm not sure what other changes I would need to make to get it to work.
Here's the function which is found in /profiles/commerce_kickstart/themes/commerce_kickstart_admin/template.php -
function commerce_kickstart_admin_commerce_price_formatted_components($variables) {
// Add the CSS styling to the table.
drupal_add_css(drupal_get_path('module', 'commerce_price') . '/theme/commerce_price.theme.css');
// Build table rows out of the components.
$rows = array();
foreach ($variables['components'] as $name => $component) {
$rows[] = array(
'data' => array(
array(
'data' => $component['title'],
'class' => array('component-title'),
),
array(
'data' => $component['formatted_price'],
'class' => array('component-total'),
),
),
'class' => array(drupal_html_class('component-type-' . $name)),
);
}
if($variables['components']['discount']['price']['amount']){
unset($rows[0]);
unset($rows[2]);
}else{
$rows = array_splice($rows, 2);
}
return theme('table', array('rows' => $rows, 'attributes' => array('class' => array('commerce-price-formatted-components'))));
}
Can anyone give any pointers as to how to get this working? It doesn't appear to even be getting invoked.
Additional info from the comments:
it's a function in the profile?
yes
Was the function added afterwards (as in "Never hack core")?
Yes, looks like it.
Or was it removed by the maintainers?
Doesn't look like this was ever part of any official release
Do you use some version control system like Git?
Yes. This function was added on 14/05/2015 12:18 according to the repo.
Have you checked the profile's release notes and issue queue?
Had a look but don't see anything.
Thanks for adding the extra info!
Well, if this really was custom code than it should never have been added to the profile in the first place. Never ever add custom code to any core or contrib file. As it's going to be deleted as soon as you update. Like it has happened to you.
I guess the most important part of this custom function was drupal_add_css(drupal_get_path('module', 'commerce_price') . '/theme/commerce_price.theme.css'); and that this commerce_price.theme.css maybe also got deleted.
Apart from that it's hard to tell from far and I'm not an expert in the commerce module. So, what I would do now is to narrow down the issue systematically.
Restore your repo to a time in history before this module got updated and get the site running.
Find out what this code is doing exactly, what other functions or flows are involved. Maybe with the help of the Devel module and the mighty dpm() function.
Try to rebuild the custom code from the profile in a custom module.
Then reset the repo to the current state and see if your custom module's code is still firing. If not, debug it to match the updated profile's code.
Apart from that, find the person who added the code and ask them why and what this code is doing. And tell them to never ever again hack core or contrib code :)
Good luck!
There are some 3rd party Wordpress plugins that do not support automatic updates. So, if you have v1.0 of a plugin already installed and you try to install a new version (e.g. v1.1), you will end up getting the message:
Destination folder already exists. /home/.../.../...
This leaves two options, neither of which i'd like to use: Uninstall & re-install the plugin, or manually upload the new files via FTP.
In /wp-admin/includes/class-wp-upgrader.php line 428 I see this code:
public function install_package( $args = array() ) {
global $wp_filesystem, $wp_theme_directories;
$defaults = array(
'source' => '', // Please always pass this
'destination' => '', // and this
'clear_destination' => false,
'clear_working' => false,
'abort_if_destination_exists' => true,
'hook_extra' => array()
);
$args = wp_parse_args($args, $defaults);
...
Is it possible to add a line to my theme's functions.php file to re-declare 'clear_destination' as true, and thereby forcing Wordpress to overwrite plugin files when I upload them?
Thanks
I kept digging and think I found a solution. If I create a custom plugin I can re-declare the options by using the 'upgrader_package_options' filter:
function override_plugins( $options ) {
$options['clear_destination'] = true;
$options['abort_if_destination_exists'] = false;
return $options;
}
add_filter( 'upgrader_package_options', 'override_plugins' );
No, that's not possible. You would need to edit the core files.
However you could install a plugin on the relevant site(s) that would take care of the problem for you: http://w-shadow.com/blog/2010/09/02/automatic-updates-for-any-plugin/
Or you could incorporate an updater framework within your plugin, which makes it possible to serve updates from private repos(eg not WP): https://github.com/afragen/github-updater
Alternatively, you could use something like WPPusher, which can automatically update the plugin whenever an update is pushed to Github / BitBucket. I personally use this plugin for testing dev versions of plugins I'm building.
In addition to Phill Healey's answer, an alternative service to WPPusher dedicated to Wordpress Developement is WP Package Editor (WP2E)
The Package Installer overwrite plugin source and log installations into a panel to monitor script versions, upgrades and status.
I'm using the bundle of Symfony, Gregwar/CaptchaBundle. Itworks great exept that point: I need to renex the code to make it works, if not i have the message "code does not match".
I'm using it in the regitration form of the bundle FOSUser.
I tried to remove the renew option but it doen't make any change.
This is the code i use in my form:
$builder->add('captcha', 'captcha', array('as_url' => true, 'reload' => true));
Some one has an idea of how to resolve that? Or maybe there is another bundle i can use to do that?
Thank you and hope i was clear.
David
I am trying to learn how to use watir-webdriver in ruby. Whenever I run my watir-webdriver scripts on sites I am QA'ing, I encounter certain pages with missing CSS Files. This only occurs with watir-webdriver. When I test manually or in selenium-webdriver, everything works fine. The missing CSS is essential for the functionality for the site and ends up breaking my scripts. Is this a known issue (I didn't find anything googling around) and is there a known workaround?
Update
Anything which was removed from this sample of code was either stuff I could not Post (URL's and Titles) or actions such as checking boxes or filling out text fields.
Watir Edited Code (Fluff Removed)
b = Watir::Browser.start "URL"
b.driver.manage.timeouts.implicit_wait = 30
b.link(:text => 'Sign Up').click
#Fill Up Sign Up Forms
b.div(:id => "btn_continue").click
#This is where the the missing CSS problem occurs most frequently when this page loads it will be missing CSS and break the script
puts b.title = "Title"
b.buttion(:value => "Verify My Identity").click
Selenium WD Edited Code (Fluff Removed)
driver.get "URL"
assert_equal "Title", #driver.title
sleep(5)
#driver.find_element(:id, "signup").click
#Fill Up Sign Up Forms
#driver.find_element(:id, "btn_continue").click
sleep(30)
#No Missing CSS like there is in Watir
assert_equal "Title", #driver.title
#driver.find_element(:css, "input.orange").click
You could try disabling caching. It solved a similar issue for others, but it still seems fishy that selenium-webdriver and watir-webdriver would behave differently.
require 'watir-webdriver'
require 'selenium-webdriver'
profile = Selenium::WebDriver::Firefox::Profile.new
profile['browser.cache.disk.enable'] = false
b = Watir::Browser.new :firefox, :profile => profile