Coder Social home page Coder Social logo

Comments (4)

aik099 avatar aik099 commented on July 30, 2024

Does some simple JS page work for you, e.g. when you change page HTML via JS and then assert that in Mink?

from minkzombiedriver.

yajo10 avatar yajo10 commented on July 30, 2024

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?

from minkzombiedriver.

aik099 avatar aik099 commented on July 30, 2024

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.

from minkzombiedriver.

yajo10 avatar yajo10 commented on July 30, 2024

Thanks a lot for your reply. I'm sorry for bothering you!

Just as a reference: I've asked the question again there: assaf/zombie#1218

from minkzombiedriver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.