strange behaviour Laravel Livewire with 2 instances - laravel-8

I have a simple page in Laravel 8 with livewire (jetstream). On that page i can open a modal form. In fact i have 2 modal forms in that page, one for editing and one for confirming prior to a delete.
I was testing and had Edge open with one instance (logged in a test user) and one instance in Chrome (logged in as another user).
When i opened the edit-modal on Chrome, the confirm-delete modal opened in my Edge browser.
I display my ConfirmDelete model with this:
<x-jet-dialog-modal wire:model="confirmDelete">
...
i watched my variable and it did go from false to true when i opende the other modal on my other browser.
{{-- modal form --}}
<x-jet-dialog-modal wire:model="modalFormVisible">
When i look at my Network tab in the Chrome diagnostics is see this:
{
"data": {
"modalFormVisible": true
},
"checksum": "7697e888b4472a9519f206d733a5d15e42a3f346b0d7fbcd349a25f67de67c86"
}
And at that same time, doing nothing in my edge browser, there i see this in my network tab:
{
"htmlHash": "f65525e2",
"data": {
"confirmDelete": true,
"modelId": null,
"name": null,
"myPermissions": null
},
"checksum": "60117ff32a9956f915e1a2dab4a6671ce2ff236435ae10c4955f94cb7f9d590d"
}
I am using Apache and am using browsersync.
Any Ideas? Is this normal behaviour?

Related

Unable to click intercepted element in wdio 7

I'm using wdio 7 last couple of weeks. but still unable to resolve intercepted element.
In protractor, I'm using
browser.actions().
click($(".pay-modal-container i[class='webfont-date_range']")).
sendKeys(protractor.Key.TAB).
sendKeys(protractor.Key.TAB).
sendKeys(protractor.Key.ENTER).
perform();
Don't know In Wdio how it works. Please help me if anyone has an idea of it.
Note : Already used browser.execute("arguments[0].click()", locator); not doing anything if i used into script
The ElementClickInterceptedException occurs when a pop-up gets in the way of a regular Selenium/WebDriver click, (eg: How do I close pop-up windows with Selenium in Python when I don't know when they will pop up?)
When that happens, you have two options:
First click to close the pop-up that's in the way.
Use a Javascript click instead of a regular click.
Given that WDIO is already a Javascript framework, you should have no troubles running a Javascript command to perform that click. Or you may decide to click to close the pop-up first.
browser.performActions([{
"type": "pointer",
"id": "click on add button",
parameters: { pointerType: 'mouse' },
actions: [
{ type: 'pointerMove', x: 1, y: 1, origin: browser.findElement("css selector", locator) },
{ type: 'pointerDown', button: 0 },
{ type: 'pointerUp', button: 0 },
]
}
]);

BigCommerce Stencil Custom Page template not appearing

In Page Builder I've added a page called About Us which has the url '/about-us/'
I've been following the instructions found here
https://developer.bigcommerce.com/stencil-docs/storefront-customization/custom-templates
in order to make a custom template for that page.
I made a file called about-us.html in templates/pages/custom/page with the contents:
<h1>About Us Page Test</h1>
My .stencil file looks like the following
{
"normalStoreUrl": "my url",
"accessToken": "my access token",
"port": "3003",
"customLayouts": {
"brand": {},
"category": {},
"page": {
"about-us.html": "/about-us/"
},
"product": {}
}
}
I've stopped and reran 'stencil start' but every time I visit localhost:3003/about-us/ it just shows the normal page instead of the custom template I build.
Is there something I'm missing? Is this an issue with using the page builder in combination with stencil?
I assume you haven't set the custom template for your page yet.
Go to Web Pages and edit your About Us page then look for the Template Layout File dropdown. Your custom template should appear there if it is setup correctly.
The issue was resolved when a full system reboot was performed. I'm not sure why stopping and restarting stencil did not resolve this.

Get notified when execution context is changed or created

I am injecting bunch of javascript code to a website by means of selenium webdriver (over chromedriver).
While the method i use works most of the time, it fails when an iframe is loaded or page is reloaded by website's javascript code.
I can trace the problem from the chromedriver's log.
For example:
[6.203][DEBUG]: DEVTOOLS EVENT Runtime.executionContextDestroyed {
"executionContextId": 1
}
[6.203][DEBUG]: DEVTOOLS EVENT Runtime.executionContextsCleared {
}
[6.203][DEBUG]: DEVTOOLS EVENT Runtime.executionContextCreated {
"context": {
"auxData": {
"frameId": "274.1",
"isDefault": true
},
"id": 5,
"name": "",
"origin": "https://<some url>"
}
}
When i see executionContextDestroyed i know that, most probably my injected scripts are destroyed too. I have tried bunch of options like switch_to.default_content() or switch_to.parent_frame but they didn't help, as there is nothing to do in case of reload but re-inject the scripts.
My question is, is there a way to hook into executionContextCreated events, so i can inject my scripts/functions into the context again and again.

Casperjs switch MainFrame to a new tab

I'm using casperjs to navigate a site, but I'm having trouble with the login process:
In the site, when you login, the browser is switched to a new tab and the login form is reset back to blank, I'm seeing this new tab with the data I need being requested in the navigation debug, like this:
[debug] [phantom] Navigation requested: url=www.thesite.com, type=FormSubmitted, willNavigate=true, isMainFrame=false
I've noticed the isMainFrame = false and I've tried to switch the frame with some methods like switchToChildFrame, casper.withFrame() or casper.withPopup(), but I've failed.
Is there any way that I can retrieve and interact with the content of that request?
My code so far:
casper.start('www.thesite.com', function() {
casper.userAgent('Mozilla/5.0 (Macintosh; Intel Mac OS X)');
this.wait(2000);
casper.withFrame('centro', function() {
this.fillSelectors('form[name="teclado"]', {
'input[name="IdGroup"]': 'AAA',
'input[name="IdUser"]': 'BBB',
'input[name="password"]': 'CCC'
}, false);
//this capture retrieves the form filled with my data
this.capture('../../../1.png');
this.click("a[onclick='enviar();return true;']");
});
});
casper.withFrame( 0, function(){
//2.png is getting the form with blank fields
this.capture('../../../2.png');
});
Thanks in advance.
Ok I solved my issue
The problem was that I wrote the withPopup code badly
I wrote the regex to match the popup url too strict by putting most of the url I expected:
casper.withPopup(/Estatico\/BEComponentesGeneralesAccesoSEI\/Html\/login.htm/, function() {
This works OK for me:
casper.withPopup(/true$/, function() {
this.capture('../../../2.png');
});

casperjs click twitter button

i use casperjs for automatical click on twitter share button. Twitter use iframe for create this buttons:
<iframe src="some src">
</iframe>
When i click it open popup window, but when i trying to login into twitter, i got error, form not found
casper.withFrame(0) { //it twitter iframe
this.fill("#twitter-widget-0 form#update-form", {
"session[username_or_email]": "myemail#email.com",
"session[password]": "password"
}, true);
});
Why? It possible with casperjs?
I'm not familiar with Twitter widgets, but are you sure #twitter-widget-0 is not the id of the iframe you just switched in to? It seems that way, because I found code like this: https://dev.twitter.com/discussions/11450
If you switched into the iframe, you cannot access elements from the parent page anymore, and you are trying to access the iframe element, which resides in the parent.
You should just select form#update-form, because it's not a child element of #twitter-widget-0: it is just an element that is contained in the iframe.
If so, the solution is simply omitting #twitter-widget-0 from your selector inside the iframe.
casper.withFrame(0) { //it twitter iframe
this.fill("form#update-form", {
"session[username_or_email]": "myemail#email.com",
"session[password]": "password"
}, true);
});