Closed yajo10 closed 2 years ago
Does some simple JS page work for you, e.g. when you change page HTML via JS and then assert that in Mink?
Thanks for your fast reply! I've added an simple JS-Script-Tag, that replaces some text after the js-event load is fired. I can not assert that successfully in Mink. Do I have to tell Zombie somehow to execute the JS?
Edit: after fiddling around I got that replacing some text with js-script is working quite well.
I did not assert correctly for that.
I assumed that after calling $page->getContent()
javascript was already executed. But this does not seem to be correct.
<!DOCTYPE html>
<html lang="de" translate="no">
<head>
<meta charset="utf-8"/>
<title>Some title</title>
<base href="/"/>
<meta name="color-scheme" content="light dark"/>
<meta name="viewport" content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta name="format-detection" content="telephone=no"/>
<meta name="msapplication-tap-highlight" content="no"/>
<link rel="icon" type="image/png" href="assets/icon/favicon.png"/>
<!-- add to homescreen for ios -->
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black"/>
<link rel="stylesheet" href="styles.css"></head>
<body>
<app-root></app-root>
<script src="runtime.js" type="module"></script><script src="polyfills.js" type="module"></script><script src="vendor.js" type="module"></script><script src="main.js" type="module"></script></body>
So that's my original response, I get. But asserting an item, that should be added after executing all the included scripts does not succeed. Is there any option to find out, what's going on there?
Do I have to tell Zombie somehow to execute the JS?
No.
We have a test suite in place on GitHub Actions, that tests that it works with both JS and HTML. It passes.
Maybe Zombie can't handle non-HTML5 tags, like <app-root></app-root>
. Mink is just a wrapper around Zombie. You need to contact the Zombie developer at http://zombie.js.org/ to see if it can deal with such HTML.
Thanks a lot for your reply. I'm sorry for bothering you!
Just as a reference: I've asked the question again there: https://github.com/assaf/zombie/issues/1218
Hey, I'm trying to get Min working. With Chromium everything works quite fine. All JavaScript is executed on a single page application. I've installed zombie global and followed strictly the examples. However, it does not executes JavaScript automatically. Did I miss a setting or anything else in the workflow?
Executing with Zombie the page just the correct html and the script-includes, that should be executed. But that's not done. In Chrome the includes are working properly. Any hints or needed additional information?
Thanks in advance!