-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Question:Error in sample step-by-step #36
Comments
Hi @vrathnayake, What version of ember-backstop & backstopjs are you using? |
ember-backstop 1.2.1 |
@vrathnayake Can you share a link to a sample repo that reproduces this problem ? |
@shankarsridhar looks like she was following this... https://github.com/garris/ember-backstop/issues/tutorial Does that work for you? |
Yes it does. I was able to generate screenshots, approve them to baseline, and then make the failing backstop tests pass again. On a separate note, maybe we should upgrade the @vrathnayake import Service from '@ember/service';
import { module, test } from 'qunit';
import { setupApplicationTest } from 'ember-qunit';
import setupMirage from 'ember-cli-mirage/test-support/setup-mirage';
import backstop from 'ember-backstop/test-support/backstop';
import { resolve } from 'rsvp';
import {
click,
currentURL,
visit,
fillIn,
triggerKeyEvent
} from '@ember/test-helpers'
let StubMapsService = Service.extend({
getMapElement() {
return resolve(document.createElement('div'));
}
});
module('Acceptance | list rentals', function(hooks) {
setupApplicationTest(hooks);
setupMirage(hooks);
hooks.beforeEach(function() {
this.owner.register('service:map-element', StubMapsService);
});
test('should redirect to rentals route', async function(assert) {
await visit('/');
assert.equal(currentURL(), '/rentals', 'should redirect automatically');
});
test('should link to information about the company', async function(assert) {
await visit('/');
await click(".menu-about");
assert.equal(currentURL(), '/about', 'should navigate to about');
});
test('should link to contact information', async function(assert) {
await visit('/');
await backstop(assert);
await click(".menu-contact");
assert.equal(currentURL(), '/contact', 'should navigate to contact');
});
test('should list available rentals', async function(assert) {
await visit('/');
await backstop(assert);
assert.equal(this.element.querySelectorAll('.results .listing').length, 3, 'should display 3 listings');
});
test('should filter the list of rentals by city', async function(assert) {
await visit('/');
await backstop(assert);
await fillIn('.list-filter input', 'seattle');
await triggerKeyEvent('.list-filter input', 'keyup', 69);
assert.ok(this.element.querySelectorAll('.results .listing').length, 1, 'should display 1 listing');
assert.ok(this.element.querySelector('.listing .location').textContent.includes('Seattle'), 'should contain 1 listing with location Seattle');
});
test('should show details for a specific rental', async function(assert) {
await visit('/rentals');
await backstop(assert);
await click(".grand-old-mansion");
assert.equal(currentURL(), '/rentals/grand-old-mansion', "should navigate to show route");
assert.ok(this.element.querySelector('.show-listing h2').textContent.includes("Grand Old Mansion"), 'should list rental title');
assert.ok(this.element.querySelector('.show-listing .description'), 'should list a description of the property');
});
}); |
On a side note, |
Hi @shankarsridhar, I am facing the same issue as @vrathnayake. Has there been a fix for this problem ? |
Followed the step-by-step tutorial
https://github.com/garris/ember-backstop-tutorial/
added "await backstop(assert);" to the last four tests and the tests failed as mentioned. Then I approved the screenshots(backstop-approve). BackstopJs Report shows all passing. But the four tests fail when run with following error;
Source: SyntaxError: Unexpected end of JSON input
at parse ()
The text was updated successfully, but these errors were encountered: