selenium-cucumber-js
selenium-cucumber-js copied to clipboard
Assert and Expect
I want to assert a heading's text on a webpage. I want to assert "Hi" from the heading. I tried like this: this.Then(/^I should see Hi$/m, function(){ driver.wait(until.elementsLocated(by.css('#body-section > div > div.row > div')), 10000); return driver.findElement(by.css('h3.RTL')).then(function(e){ expect(e.getText()).to.include('Hi'); }) });
Please help...
Please clean up your post, it's hard to follow
Could you please provide some examples of how to use assert in this? Like we use assert.Equals(expected, actual) in JAVA. This is what I'm doing at present: I load a page-->I provide login credentials --> I click login button---> I am redirected to my account ----> I click My Profile button ---->I provide text in some fields in a form---->I submit the form.
I want to assert that there exists a text "Hi "in heading of that webpage. I want to assert the successful response message that appears after submitting the form.
You can check yourself: Website: www.phptravels.net/login username: [email protected] password: demouser