
| Current Path : /var/www/html/rocksensor1/web/core/tests/Drupal/Nightwatch/Tests/Olivero/ |
Linux ift1.ift-informatik.de 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64 |
| Current File : /var/www/html/rocksensor1/web/core/tests/Drupal/Nightwatch/Tests/Olivero/oliveroCommentTest.js |
const commentTitleSelector = 'h2.comments__title';
const commentCountSelector = 'h2.comments__title .comments__count';
module.exports = {
'@tags': ['core', 'olivero'],
before(browser) {
browser
.drupalInstall({
setupFile:
'core/tests/Drupal/TestSite/TestSiteOliveroInstallTestScript.php',
installProfile: 'minimal',
})
.drupalCreateUser({
name: 'user',
password: '123',
permissions: [
'access comments',
'post comments',
'skip comment approval',
],
})
.drupalLogin({ name: 'user', password: '123' });
},
after(browser) {
browser.drupalUninstall();
},
'Article without comments should not display count': (browser) => {
browser
.drupalRelativeURL('/node/1')
.assert.textContains('body', 'Article without comments')
.assert.not.elementPresent(commentCountSelector);
},
'Article with comments should display count': (browser) => {
browser
.drupalRelativeURL('/node/2')
.assert.textContains('body', 'Article with comments')
.assert.elementPresent(commentTitleSelector)
.assert.elementPresent(commentCountSelector)
.assert.textContains(commentCountSelector, '2');
},
};