Skip to content
This repository was archived by the owner on Dec 16, 2023. It is now read-only.

How to Use Zombie.JS Without Test Framework #1164

Closed
Jitsusama opened this issue Jun 1, 2018 · 2 comments
Closed

How to Use Zombie.JS Without Test Framework #1164

Jitsusama opened this issue Jun 1, 2018 · 2 comments

Comments

@Jitsusama
Copy link

Hello,

I'm trying to use this library without a test framework in order to use it as a web navigation automation library. I'm having a hard time figuring out how to use it in such a capacity, as the documentation is geared towards using it in the Mocha test framework.

Could I get some pointers? I'm looking to use it to login via a web-form, and then navigate through various pages while pulling out pertinent details. I've tried looking through the project source code, but I'm not having much luck.

@momocow
Copy link

momocow commented Jun 20, 2018

Zombie methods do not depend on any testing frameworks; therefore, I guess you can just use it.

For example,

const Browser = require('zombie')

const browser = new Browser({
  // JSDom does not support MutationObserver, https://github.com/jsdom/jsdom/issues/639
  runScripts: false 
})

browser
  .visit('https://github.com/assaf/zombie/issues/1164')
  .then(function () {
    console.log(browser.text('#issue-328636238 .author')) // Jitsusama
  })

Under the hood, zombie uses JSDom to emulate browser environment so you may also want to take a look at it.

@Jitsusama
Copy link
Author

Thanks @momocow. I had pretty much gotten to that stage, but was having an issue figuring out some of the more advanced functionality. I'll just poke around through the code until I figure it out. Thanks for the pointer to JSDom as well, that should probably help me with some of the sticky stuff I was getting confused about.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants