You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 16, 2023. It is now read-only.
In release 6.0.0, 2018-04-02 the following breaking change was made (according to the changelog): "Various browser methods, like focus, fill, etc now take a callback, or return a promise."
According to the documentation, the following syntax should work:
browser
.fill('email', '[email protected]')
.fill('password', 'eat-the-living')
.pressButton('Sign Me Up!', done);
It implies that fill will return a copy of browser, enabling chaining. However, since 6.0.0 this isn't the case- fill (and a number of similar methods) returns a promise. If you try to run the basic example above from the Zombie documentation (from both the README, and the website http://zombie.js.org/) it won't work. Either the documentation needs to be updated, or chaining needs to be fixed.
The text was updated successfully, but these errors were encountered:
Proof of concept based on the example from README.md:
const Browser = require('zombie');
// We're going to make requests to http://example.com/signup
// Which will be routed to our test server localhost:3000
Browser.localhost('example.com', 3000);
describe('User visits signup page', function() {
const browser = new Browser();
before(function(done) {
browser.visit('http://www.google.com', done);
});
describe('submits form', function() {
before(function(done) {
browser
.fill('input', '[email protected]')
.fill('input', '[email protected]')
.pressButton('Sign Me Up!', done);
});
it('should be successful', function() {
browser.assert.success();
});
it('should see welcome page', function() {
browser.assert.text('title', 'Welcome To Brains Depot');
});
});
});
Running this outputs:
User visits signup page
submits form
1) "before all" hook
0 passing (263ms)
1 failing
1) User visits signup page
submits form
"before all" hook:
TypeError: browser.fill(...).fill is not a function
at Context.<anonymous> (test.js:20:10)
Because a promise does not have a fill function, it fails.
In release 6.0.0, 2018-04-02 the following breaking change was made (according to the changelog): "Various browser methods, like focus, fill, etc now take a callback, or return a promise."
According to the documentation, the following syntax should work:
It implies that
fill
will return a copy ofbrowser
, enabling chaining. However, since 6.0.0 this isn't the case- fill (and a number of similar methods) returns a promise. If you try to run the basic example above from the Zombie documentation (from both the README, and the website http://zombie.js.org/) it won't work. Either the documentation needs to be updated, or chaining needs to be fixed.The text was updated successfully, but these errors were encountered: