Skip to content

evaluate(func, args) does not seem to allow functions to be passed #95

@disophisis

Description

@disophisis

I've copied a client side script from protractor (waitforangular) and I am attempting to use it with chromy.

Here's a small snippet ( I don't know that the entire code is required)

let waitForAngular = function (rootSelector, callback) {
		console.log(callback);
		console.log(rootSelector);
		try {
			// Wait for both angular1 testability and angular2 testability.

			var testCallback = callback;

			// Wait for angular1 testability first and run waitForAngular2 as a callback
			var waitForAngular1 = function (callback) {

				if (window.angular) {

I call:

chromy.evaluate(waitForAngular, ['app-root', callback]));

in the case of this snippet, callback is an anonymous function that was declared earlier on.

callback seems to be converted to a boolean value by doing this. If I look at the output from the console log statements from the waitForAngular call, 'app-root' gets passed correctly and the callback will either be undefined or true.

Is there a way to pass a callback function to the waitForAngular function using evaluate?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions