How to use the zombie function in zombie

To help you get started, we’ve selected a few zombie examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github darkwire / darkwire.io / test / app.js View on Github external
describe('Darkwire', () => {

  const browser = new Browser();

  before((done) => {
    browser.on('active', () => {
      // browser.evaluate needs a string, so this regex just extracts the body of the function as a string
      browser.evaluate(helpers.polyfillCrypto.toString().match(/function[^{]+\{([\s\S]*)\}$/)[1]);
    });

    browser.visit('/', done);
  });

  describe('Navigate to /', () => {
    it('should be running released version', () => {
      browser.assert.text('#appVersion', APPVER);
    });

    it('should be successful', () => {
github milankinen / react-combinators / test / helpers.js View on Github external
test(`run example "${example}" with "${lib}"`, t => {
      t.comment("example initialization")
      execInExampleDir(example, `./node_modules/.bin/browserify ${lib}.js -t babelify > bundle.js`)
      const browser = polyfillBrowser(new Browser())
      Promise.resolve(browser.visit("file://" + getExampleDir(example) + "/index.html"))
        .then(() => browser.assert.success())
        .then(() => awaitMs(500))
        .then(() => testCase(t, browser))
        .finally(() => t.end())
        .done()
    })
  })
github tinderjs / tindermatch / getTokenAndProfileScript.js View on Github external
import Browser from 'zombie'
import cheerio from 'cheerio'

let FACEBOOK_PROFILE = "http://www.facebook.com/"
let FACEBOOK_AUTHENTICATION_TOKEN_URL = 'https://www.facebook.com/dialog/oauth?client_id=464891386855067&redirect_uri=https://www.facebook.com/connect/login_success.html&scope=basic_info,email,public_profile,user_about_me,user_activities,user_birthday,user_education_history,user_friends,user_interests,user_likes,user_location,user_photos,user_relationship_details&response_type=token'

let email = process.env.FACEBOOK_EMAIL
let password = process.env.FACEBOOK_PASSWORD

let scraped_token, profile_id;

let browser = new Browser()

browser.on('loaded', function(){

    var t = browser.url.match(/#access_token=(.+)&/)

    if (t && t[1]){
        console.log(t[1])
    }
})

browser.visit(FACEBOOK_AUTHENTICATION_TOKEN_URL, function () {

    browser.fill('#email', email).fill('#pass', password).pressButton('#loginbutton', function(){

        browser.visit(FACEBOOK_PROFILE, function(){
github ForbesLindesay / taxi-rank / src / browser-api.js View on Github external
module.exports = function () {
  const browser = new Browser();
  browser.visit('about:blank');

  function throwError(status, message) {
    const err = new Error(message);
    err.webdriverError = {status, value: {message}};
    throw err;
  }

  const timeouts = {
    implicit: 5000,
  };

  const elements = new Map();

  function getElementById(id) {
    return elements.get(id);
github wildlyinaccurate / plait / features / step-definitions / common-steps.js View on Github external
this.Given(/^I am on the "([^"]+)" page$/, function (page) {
    this.browser = new Zombie()

    return this.browser.visit(`http://localhost:8888/${page}.html`)
  })

zombie

Insanely fast, full-stack, headless browser testing using Node.js

MIT
Latest version published 5 years ago

Package Health Score

56 / 100
Full package analysis