Quantcast
Viewing all articles
Browse latest Browse all 4837

Qunit assert throws not working

@leofoto123 wrote:

I am trying to assert that a few steps in the code (visiting page, providing wrong card-number, password combination and clicking submit)should generate an error from the backend service - I have referred to this already…

and tried the suggestion of using Error Object as the second argument to assert.throws but that doesn’t work for me.

Here’s my Qunit test

test('ERROR_CASE_visiting /signon, provide cardNumber(2342314) and ' +
'password, submit and expect to see invalid cardnumber/password error',
function (assert) {

 assert.expect(2);
 assert.throws(
function () {
  visit('/signon');
  fillIn('#a8n-signon-card-number input', '2342314');
  fillIn('#a8n-signon-password input', 'password');
  click('#a8n-signon-submit-button button');
},
Error,
"Error Thrown"
 );
});

Is there anything else that i can try to get it to work.

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4837

Trending Articles