Trying to pinpoint the issue with my current setup, as I'm facing a challenge. The problem arises when using intern.js for JavaScript functional testing in conjunction with SauceLabs.
While the test itself passes without any errors, upon checking the screenshot on SauceLabs for window behavior, it becomes evident that there is an issue with scrolling to the element. It seems like the .moveMouseTo
function is not functioning correctly.
There is some scroll happening, but the desired element remains out of sight. I've researched Selenium and the focus feature, but being relatively new to intern.js, I'm uncertain how to incorporate these based solely on Selenium documentation.
Here's the specific test scenario:
'added comment shows the comment added': function () {
return this.get('remote')
.get(require.toUrl('index.html'))
.setFindTimeout(500)
.setWindowSize(800, 600)
.findByCssSelector('.ht-comment-box')
.click()
.type('My New Comment')
.end()
.findByCssSelector('#addComment')
.click()
.end()
.setFindTimeout(500)
.findByCssSelector('.commentRow:last-child > .commentContent ')
.moveMouseTo()
.getVisibleText()
.then(function (text) {
assert.strictEqual(text, 'My New Comment',
'Adding a comment should display the comment. Showed instead ' + text);
});
},
On inspection, it appears that the added comment is not visible due to scrolling issues.