I've recently upgraded a project to the new testing format, and followed the instructions in the README, however, the scope of this inside my step file is wrong as it does not have a this.element as the docs suggest it should.
Below is a simplified version of my steps file, have put it all in steps.js for brevity.
// steps.js
import { visit, click, currentURL } from '@ember/test-helpers';
import yadda from '../../helpers/yadda';
export default function(assert) {
return yadda.localisation.default.library()
.given('I am on the dashboard', async function() {
await visit('/');
})
.when('I click the learning link', async function() {
await click('a.learning');
})
.then('I should see a list of learning activities', async function() {
// this.element is undefined here
assert.equal(this.element.querySelector('ul.posts li').textContent, 'My new post');
})
}
I'm not sure if some of my setup is wrong or if this is a bug. Any help greatly appreciated.
Hi there,
I've recently upgraded a project to the new testing format, and followed the instructions in the README, however, the scope of
this
inside my step file is wrong as it does not have athis.element
as the docs suggest it should.Below is a simplified version of my steps file, have put it all in steps.js for brevity.
I'm not sure if some of my setup is wrong or if this is a bug. Any help greatly appreciated.
Thanks!