-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Not A Bug
-
Affects Version/s: 10.10
-
Fix Version/s: None
-
Epic Link:
-
Team:UI
-
Sprint:QA - 11.1.19, QA - 11.1.25, QA - 11.1.32, QA - 11.1.33, nxApps 2020 Cycle 12, nxApps 2021 Cycle 1, nxApps 2021 Cycle 2
-
Story Points:3
When using the nuxeo-web-ui-ftest framework, when provisioning, the created documents are being created by a chosen user but the contributor is still Administrator. The creator of a document should also be a contributor.
Example in step used in search.feature
- search.js
Given(/^I have the following documents$/, (table) => { browser.pause(1000); const tasks = table.rows().map(row => () => { const doc = fixtures.documents.init(row[0]); doc.name = row[1]; doc.properties = { 'dc:title': row[1], 'dc:nature': row[2], 'dc:subjects': [row[3]], 'dc:coverage': row[4], }; if (row[0] === 'Note') { doc.properties = { 'dc:title': row[1], 'dc:nature': row[2], 'dc:subjects': [row[3]], 'dc:coverage': row[4], 'note:note': 'Lorem Ipsum', }; } // create the document return fixtures.documents.createWithAuthor(row[6], doc, row[5]).then((docWithAuthor) => { if (row[7].length > 0) { return fixtures.collections.addToCollection(docWithAuthor, row[7]).then((docInCollection) => { if (row[8].length > 0) { return fixtures.documents.addTag(docInCollection, row[8]).then((docWithTag) => { if (row[9].length > 0) { return fixtures.documents.attach(docWithTag, fixtures.blobs.get(row[9])); } }); } }); } }); }); return tasks.reduce((current, next) => current.then(next), Promise.resolve([])); });
- document.js:
createWithAuthor: (parent, document, username) => nuxeo.repository() .create(parent, document) .then((doc) => { liveDocuments.push(doc.uid); if (username) { return doc.set({ 'dc:creator': username, }).save(); } return doc; }),