Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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', () => {
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()
})
})
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(){
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);
this.Given(/^I am on the "([^"]+)" page$/, function (page) {
this.browser = new Zombie()
return this.browser.visit(`http://localhost:8888/${page}.html`)
})