I'm using Nightwatch.js for E2E testing.
In the test, there should be a click on specific element in a table list to select an article. Then the article gets loaded.
Now I want to check if the correct article has been loaded by comparing the title.
How do I get the text of the selected element? In my code, the element is just clicked. In the second part, this title should be compared. In my code below, it is just hard coded:
module.exports = {
'article': function(browser) {
browser
.click('#list tbody tr:first-child .selectable')
.waitForElementVisible('#article-wrapper', 10000)
browser.expect.element('h1').text.to.equal('specific title')
browser.end()
}
}
Aucun commentaire:
Enregistrer un commentaire