How can I edit divs with 'contenteditable' property with Laravel Dusk? - laravel

I have a wysiwyg editor in my project, that I need to test and it has a contenteditable property. I cant type directly, as it is a simple <trix-editor> tag:
<trix-editor input="28" placeholder="Type your message here..." contenteditable="" role="textbox" trix-id="2" toolbar="trix-toolbar-2">
</trix-editor>
As you can notice, it has contenteditable attribute. I can edit it easily with Selenium IDE when running Selenium tests and it shows command edit content.
Can the same be done with Laravel Dusk?

You can edit the content with keys():
$browser->keys('[trix-id="2"]', 'Text')

Related

Edit html in cypress

Is there a way to make cypress change the html of a page.
I am trying to make a test for a vulnerability on my site however the vulnerability requires the user to change a tag on a html element. Is there a way to make cypress do this?
the element is a checkbox and it is disabled, however what i want cypress to do is remove the disabled tag and then click the checkbox.
<input type="checkbox" disabled>
then i want cypress to remove the disabled tag so it is
<input type="checkbox">
You can use removeAttr to remove the disabled tag. Something like:
cy.get('input[type="checkbox"]').invoke('removeAttr', 'disabled')

Search-form action attribute with Advanced AJAX Page Loader wordpress plugin returns "more than one title tag on the page.." warning in debug mode

I'm trying to enable search functionality of the Advanced AJAX Page Loader plugin on a custom wordpress theme I'm building, but after I enter keyword into search and hit enter, loader.gif keeps on spinning and I get this message in debug mode : "WARNING: You seem to have more than one title tag on the page, this is going to cause some major problems so page title changing is disabled". It also passes the url of the website twice into the address bar and I believe this has something to do with the action attribute that's being passed by the form.
This is the site in question: http://natalija.co.nf
I left the debug mode of the AAPL plugin on for now
This is my searchform.php code:
<form method="get" id="searchform" class="searchform" action="<?php bloginfo('url'); ?>">
<input type="submit" id="searchsubmit" value="" class="btn" />
<input type="text" size="10" name="s" id="s" value="" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;"/>
</form>
I managed to ajaxify the theme with this plugin but I 'm having trouble getting the search to work properly so I was wondering if anyone here can help me out with this? It is driving me crazy.
I solved it. The code in search.php needs to be wrapped with a div class="searchform".

Trigger click on link on jquery mobile not working

I tried triggering a link via .trigger() function but is not working
<a data-role="button" id="redirectprofile_btn" href="profile.html" rel="external" style="display:block;">Profile</a>
Once i click the link manually, it will display the profile page (profile.html, with its own css and js) but if i use
$("#redirectprofile_btn").click() or $("#redirectprofile_btn").trigger('click'),
it wont redirect.
Im new to jquerymobile, any help would really be great.
Thanks
Use event.prevent default() followed by event.stopImmediatePropogation then changePage to the links href attr value.

Modify translation for value submit button of the joomla login module

i want to translate the submit value of the login joomla module
<input type="submit" name="Submit" class="button" value="<?php echo JText::_('JLOGIN') ?>" />
Exactly where can i find "JLOGIN" text and thnks in advance.
In Joomla 1.6 or above there is a user interface for overriding specific language strings in the language manager. Go to the language manager and select the overrides tab. There are detailed instructions for use in the UI.
These are always defined in your language ini files. A quick search shows: language/en-GB/en-GB.ini. The en-GB directory will vary depending on your default language.
The current value of this text is Log in, for en-GB that is.

FireFox: strange behavior on submiting a form

Can anyone help with this strange form submiting in FireFox?
So this form should be submitted after pushing "go to submit" button. There is an onclick event on the button that should submit form through JavaScript. In the form there is another button "test" without any onclick event. Following the script, the form should be submitted only after pushing the "go to submit" button, but it submits even pushing at "test" button.
In the Internet Explorer it works well! But this stupid FireFox browser behaves different.
Here is example of HTML page:
<script>
function func(){
document.form1.submit();
}
</script>
<form name="form1" method="post" action="somewhere.php">
<button>test</button>
<input type="button" value="go to submit" onclick="func();">
</form>
I have several buttons with <button onclick="...">option 1</button> options. I want to fix strange submiting a form in FireFox. Help please!
http://www.w3schools.com/tags/tag_button.asp
The tag defines a push button.
Inside a button element you can put content, like text or images. This is the difference between this element and buttons created with the input element.
Always specify the type attribute for the button. The default type for Internet Explorer is "button", while in other browsers (and in the W3C specification) it is "submit".

Resources